Skip to content

Commit a8c6991

Browse files
ajpeacock0Leiwang3SQL
authored andcommitted
[Communication] Adding 2022-02-01 NetworkTraversal API version for General Availability (Azure#16946)
* Adding base-line 2022-02-01 swagger * Making updates based on REST API feedback * Comments
1 parent ad394b1 commit a8c6991

File tree

3 files changed

+211
-0
lines changed

3 files changed

+211
-0
lines changed

specification/communication/data-plane/NetworkTraversal/readme.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ input-file:
5858
- preview/2021-10-08-preview/CommunicationNetworkTraversal.json
5959
```
6060

61+
### Tag: package-2022-02-01
62+
63+
These settings apply only when `--tag=package-2022-02-01` is specified on the command line.
64+
65+
```yaml $(tag) == 'package-2022-02-01'
66+
input-file:
67+
- stable/2022-02-01/CommunicationNetworkTraversal.json
68+
```
69+
6170
---
6271

6372
# Code Generation
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "CommunicationNetworkTraversalClient",
5+
"description": "Azure Communication Network Traversal Service",
6+
"version": "2022-02-01"
7+
},
8+
"paths": {
9+
"/networkTraversal/:issueRelayConfiguration": {
10+
"post": {
11+
"tags": [
12+
"Turn"
13+
],
14+
"summary": "Issue a configuration for an STUN/TURN server.",
15+
"operationId": "CommunicationNetworkTraversal_IssueRelayConfiguration",
16+
"consumes": [
17+
"application/json"
18+
],
19+
"produces": [
20+
"application/json"
21+
],
22+
"parameters": [
23+
{
24+
"$ref": "#/parameters/ApiVersionParameter"
25+
},
26+
{
27+
"description": "Optional request for providing the id and/or route type for the returned relay configuration.",
28+
"in": "body",
29+
"name": "body",
30+
"schema": {
31+
"$ref": "#/definitions/CommunicationRelayConfigurationRequest"
32+
}
33+
}
34+
],
35+
"responses": {
36+
"200": {
37+
"description": "Success",
38+
"schema": {
39+
"$ref": "#/definitions/CommunicationRelayConfiguration"
40+
}
41+
},
42+
"default": {
43+
"description": "Error",
44+
"schema": {
45+
"$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
46+
}
47+
}
48+
},
49+
"x-ms-examples": {
50+
"Issue Relay Configuration": {
51+
"$ref": "./examples/IssueRelayConfiguration.json"
52+
}
53+
}
54+
}
55+
}
56+
},
57+
"definitions": {
58+
"CommunicationRelayConfigurationRequest": {
59+
"description": "Request for a CommunicationRelayConfiguration.",
60+
"type": "object",
61+
"properties": {
62+
"id": {
63+
"description": "An identity to be associated with telemetry for data relayed using the returned credentials. Must be an existing ACS user identity. If not provided, the telemetry will not contain an associated identity value.",
64+
"type": "string"
65+
},
66+
"routeType": {
67+
"description": "Filter the routing methodology returned. If not provided, will return all route types in separate ICE servers.",
68+
"$ref": "#/definitions/RouteType"
69+
}
70+
}
71+
},
72+
"CommunicationIceServer": {
73+
"description": "An instance of a STUN/TURN server with credentials to be used for ICE negotiation.",
74+
"required": [
75+
"credential",
76+
"urls",
77+
"username",
78+
"routeType"
79+
],
80+
"type": "object",
81+
"properties": {
82+
"urls": {
83+
"description": "List of STUN/TURN server URLs.",
84+
"type": "array",
85+
"items": {
86+
"type": "string"
87+
}
88+
},
89+
"username": {
90+
"description": "User account name which uniquely identifies the credentials.",
91+
"type": "string"
92+
},
93+
"credential": {
94+
"description": "Credential for the server.",
95+
"type": "string"
96+
},
97+
"routeType": {
98+
"$ref": "#/definitions/RouteType"
99+
}
100+
}
101+
},
102+
"CommunicationRelayConfiguration": {
103+
"description": "A relay configuration containing the STUN/TURN URLs and credentials.",
104+
"required": [
105+
"expiresOn",
106+
"iceServers"
107+
],
108+
"type": "object",
109+
"properties": {
110+
"expiresOn": {
111+
"format": "date-time",
112+
"description": "The date for which the username and credentials are not longer valid. Will be 48 hours from request time.",
113+
"type": "string"
114+
},
115+
"iceServers": {
116+
"description": "An array representing the credentials and the STUN/TURN server URLs for use in ICE negotiations.",
117+
"type": "array",
118+
"items": {
119+
"$ref": "#/definitions/CommunicationIceServer"
120+
}
121+
}
122+
}
123+
},
124+
"RouteType": {
125+
"description": "The routing methodology to where the ICE server will be located from the client. \"any\" will have higher reliability while \"nearest\" will have lower latency. It is recommended to default to use the \"any\" routing method unless there are specific scenarios which minimizing latency is critical.",
126+
"enum": [
127+
"any",
128+
"nearest"
129+
],
130+
"type": "string",
131+
"x-ms-enum": {
132+
"name": "RouteType",
133+
"modelAsString": true
134+
}
135+
}
136+
},
137+
"parameters": {
138+
"ApiVersionParameter": {
139+
"in": "query",
140+
"name": "api-version",
141+
"description": "Version of API to invoke.",
142+
"required": true,
143+
"enum": [
144+
"2022-02-01"
145+
],
146+
"type": "string"
147+
}
148+
},
149+
"securityDefinitions": {
150+
"azure_auth": {
151+
"type": "oauth2",
152+
"flow": "implicit",
153+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
154+
"scopes": {
155+
"user_impersonation": "impersonate your user account"
156+
}
157+
}
158+
},
159+
"x-ms-parameterized-host": {
160+
"hostTemplate": "{endpoint}",
161+
"useSchemePrefix": false,
162+
"parameters": [
163+
{
164+
"name": "endpoint",
165+
"description": "The communication resource, for example https://my-resource.communication.azure.com",
166+
"required": true,
167+
"type": "string",
168+
"in": "path",
169+
"x-ms-skip-url-encoding": true,
170+
"x-ms-parameter-location": "client"
171+
}
172+
]
173+
}
174+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"parameters": {
3+
"api-version": "2022-02-01",
4+
"content-type": "application/json",
5+
"body": {
6+
"id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081"
7+
},
8+
"endpoint": "https://my-resource.communication.azure.com"
9+
},
10+
"responses": {
11+
"200": {
12+
"body": {
13+
"expiresOn": "2022-01-10T21:39:39.3244584+00:00",
14+
"iceServers": [
15+
{
16+
"urls": [
17+
"turn:131.107.255.255:3478",
18+
"stun:131.107.255.255:3478"
19+
],
20+
"username": "AgAAJNOeygwB1uVGvuwAVMHV4PLhYDgY66Fg1dUZvQ4AAAAEhXrhc8uJFjOK8lxEsZk3KIpWxc0=",
21+
"credential": "9rl8ablFWj6/aqSuPLgLykLZKqw=",
22+
"routeType": "any"
23+
}
24+
]
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)