Skip to content

Commit 6282e52

Browse files
authored
Adding ACS NetworkTraversal 2022-03-01 API (#17502)
1 parent c56b44b commit 6282e52

File tree

3 files changed

+216
-1
lines changed

3 files changed

+216
-1
lines changed
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "CommunicationNetworkTraversalClient",
5+
"description": "Azure Communication Network Traversal Service",
6+
"version": "2022-03-01-preview"
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+
"ttl": {
71+
"type": "integer",
72+
"format": "int32",
73+
"description": "The credential Time-To-Live (TTL), in seconds. The default value will be used if given value exceeds it.",
74+
"minimum": 0,
75+
"maximum": 172800,
76+
"default": 172800
77+
}
78+
}
79+
},
80+
"CommunicationIceServer": {
81+
"description": "An instance of a STUN/TURN server with credentials to be used for ICE negotiation.",
82+
"required": [
83+
"credential",
84+
"urls",
85+
"username",
86+
"routeType"
87+
],
88+
"type": "object",
89+
"properties": {
90+
"urls": {
91+
"description": "List of STUN/TURN server URLs.",
92+
"type": "array",
93+
"items": {
94+
"type": "string"
95+
}
96+
},
97+
"username": {
98+
"description": "User account name which uniquely identifies the credentials.",
99+
"type": "string"
100+
},
101+
"credential": {
102+
"description": "Credential for the server.",
103+
"type": "string"
104+
},
105+
"routeType": {
106+
"$ref": "#/definitions/RouteType"
107+
}
108+
}
109+
},
110+
"CommunicationRelayConfiguration": {
111+
"description": "A relay configuration containing the STUN/TURN URLs and credentials.",
112+
"required": [
113+
"expiresOn",
114+
"iceServers"
115+
],
116+
"type": "object",
117+
"properties": {
118+
"expiresOn": {
119+
"format": "date-time",
120+
"description": "The date for which the username and credentials are not longer valid. Will be 48 hours from request time.",
121+
"type": "string"
122+
},
123+
"iceServers": {
124+
"description": "An array representing the credentials and the STUN/TURN server URLs for use in ICE negotiations.",
125+
"type": "array",
126+
"items": {
127+
"$ref": "#/definitions/CommunicationIceServer"
128+
}
129+
}
130+
}
131+
},
132+
"RouteType": {
133+
"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.",
134+
"enum": [
135+
"any",
136+
"nearest"
137+
],
138+
"type": "string",
139+
"x-ms-enum": {
140+
"name": "RouteType",
141+
"modelAsString": true
142+
}
143+
}
144+
},
145+
"parameters": {
146+
"ApiVersionParameter": {
147+
"in": "query",
148+
"name": "api-version",
149+
"description": "Version of API to invoke.",
150+
"required": true,
151+
"type": "string"
152+
}
153+
},
154+
"securityDefinitions": {
155+
"azure_auth": {
156+
"type": "oauth2",
157+
"flow": "implicit",
158+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
159+
"scopes": {
160+
"user_impersonation": "impersonate your user account"
161+
}
162+
}
163+
},
164+
"x-ms-parameterized-host": {
165+
"hostTemplate": "{endpoint}",
166+
"useSchemePrefix": false,
167+
"parameters": [
168+
{
169+
"name": "endpoint",
170+
"description": "The communication resource, for example https://my-resource.communication.azure.com",
171+
"required": true,
172+
"type": "string",
173+
"in": "path",
174+
"x-ms-skip-url-encoding": true,
175+
"x-ms-parameter-location": "client"
176+
}
177+
]
178+
}
179+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"parameters": {
3+
"api-version": "2022-03-01-preview",
4+
"content-type": "application/json",
5+
"body": {
6+
"id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081",
7+
"ttl": 3600
8+
},
9+
"endpoint": "https://my-resource.communication.azure.com"
10+
},
11+
"responses": {
12+
"200": {
13+
"body": {
14+
"expiresOn": "2022-03-01T21:39:39.3244584+00:00",
15+
"iceServers": [
16+
{
17+
"urls": [
18+
"turn:131.107.255.255:3478",
19+
"stun:131.107.255.255:3478"
20+
],
21+
"username": "AgAAJNOeygwB1uVGvuwAVMHV4PLhYDgY66Fg1dUZvQ4AAAAEhXrhc8uJFjOK8lxEsZk3KIpWxc0=",
22+
"credential": "9rl8ablFWj6/aqSuPLgLykLZKqw=",
23+
"routeType": "any"
24+
}
25+
]
26+
}
27+
}
28+
}
29+
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ input-file:
5858
- preview/2021-10-08-preview/CommunicationNetworkTraversal.json
5959
```
6060

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

6370
# Code Generation
6471

0 commit comments

Comments
 (0)