From 0353c5d9dff5b3c9a4b2703ba370a22742dc185d Mon Sep 17 00:00:00 2001 From: Andrew Peacock Date: Tue, 30 Nov 2021 16:17:01 -0800 Subject: [PATCH 1/3] Adding base-line 2022-02-01 swagger --- .../CommunicationNetworkTraversal.json | 172 ++++++++++++++++++ .../examples/IssueRelayConfiguration.json | 28 +++ 2 files changed, 200 insertions(+) create mode 100644 specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json create mode 100644 specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/examples/IssueRelayConfiguration.json diff --git a/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json b/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json new file mode 100644 index 000000000000..3220c95b063c --- /dev/null +++ b/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json @@ -0,0 +1,172 @@ +{ + "swagger": "2.0", + "info": { + "title": "CommunicationNetworkingClient", + "description": "Azure Communication Networking Service", + "version": "2022-02-01" + }, + "paths": { + "/networktraversal/:issueRelayConfiguration": { + "post": { + "tags": [ + "Turn" + ], + "summary": "Issue a configuration for an STUN/TURN server for an existing identity.", + "operationId": "CommunicationNetworkTraversal_IssueRelayConfiguration", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/CommunicationRelayConfigurationRequest" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CommunicationRelayConfiguration" + } + }, + "default": { + "description": "Error", + "schema": { + "$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse" + } + } + }, + "x-ms-examples": { + "Issue Relay Configuration": { + "$ref": "./examples/IssueRelayConfiguration.json" + } + } + } + } + }, + "definitions": { + "CommunicationRelayConfigurationRequest": { + "description": "Request for a CommunicationRelayConfiguration.", + "type": "object", + "properties": { + "id": { + "description": "An existing ACS identity.", + "type": "string" + }, + "routeType": { + "$ref": "#/definitions/RouteType" + } + } + }, + "CommunicationIceServer": { + "description": "An instance of a STUN/TURN server with credentials to be used for ICE negotiation.", + "required": [ + "credential", + "urls", + "username", + "routeType" + ], + "type": "object", + "properties": { + "urls": { + "description": "List of STUN/TURN server URLs.", + "type": "array", + "items": { + "type": "string" + } + }, + "username": { + "description": "User account name which uniquely identifies the credentials.", + "type": "string" + }, + "credential": { + "description": "Credential for the server.", + "type": "string" + }, + "routeType": { + "$ref": "#/definitions/RouteType" + } + } + }, + "CommunicationRelayConfiguration": { + "description": "A relay configuration containing the STUN/TURN URLs and credentials.", + "required": [ + "expiresOn", + "iceServers" + ], + "type": "object", + "properties": { + "expiresOn": { + "format": "date-time", + "description": "The date for which the username and credentials are not longer valid.", + "type": "string" + }, + "iceServers": { + "description": "An array representing the credentials and the STUN/TURN server URLs for use in ICE negotiations.", + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationIceServer" + } + } + } + }, + "RouteType": { + "description": "The routing methodology to where the ICE server will be located from the client.", + "enum": [ + "any", + "nearest" + ], + "type": "string", + "x-ms-enum": { + "name": "RouteType", + "modelAsString": true + } + } + }, + "parameters": { + "ApiVersionParameter": { + "in": "query", + "name": "api-version", + "description": "Version of API to invoke.", + "required": true, + "enum": [ + "2022-02-01" + ], + "type": "string" + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "description": "The communication resource, for example https://my-resource.communication.azure.com", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client" + } + ] + } +} diff --git a/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/examples/IssueRelayConfiguration.json b/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/examples/IssueRelayConfiguration.json new file mode 100644 index 000000000000..74c90e02a2dd --- /dev/null +++ b/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/examples/IssueRelayConfiguration.json @@ -0,0 +1,28 @@ +{ + "parameters": { + "api-version": "2022-02-01", + "content-type": "application/json", + "body": { + "id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081" + }, + "endpoint": "https://my-resource.communication.azure.com" + }, + "responses": { + "200": { + "body": { + "expiresOn": "2021-11-10T21:39:39.3244584+00:00", + "iceServers": [ + { + "urls": [ + "turn:131.107.255.255:3478", + "stun:131.107.255.255:3478" + ], + "username": "AgAAJNOeygwB1uVGvuwAVMHV4PLhYDgY66Fg1dUZvQ4AAAAEhXrhc8uJFjOK8lxEsZk3KIpWxc0=", + "credential": "9rl8ablFWj6/aqSuPLgLykLZKqw=", + "routeType": "any" + } + ] + } + } + } +} From 96ad1f8022c5244f4533890ade3e23494ba476d9 Mon Sep 17 00:00:00 2001 From: Andrew Peacock Date: Thu, 2 Dec 2021 14:08:33 -0800 Subject: [PATCH 2/3] Making updates based on REST API feedback --- .../2022-02-01/CommunicationNetworkTraversal.json | 12 +++++++----- .../2022-02-01/examples/IssueRelayConfiguration.json | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json b/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json index 3220c95b063c..dc701b80990a 100644 --- a/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json +++ b/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json @@ -6,12 +6,12 @@ "version": "2022-02-01" }, "paths": { - "/networktraversal/:issueRelayConfiguration": { + "/networkTraversal/:issueRelayConfiguration": { "post": { "tags": [ "Turn" ], - "summary": "Issue a configuration for an STUN/TURN server for an existing identity.", + "summary": "Issue a configuration for an STUN/TURN server.", "operationId": "CommunicationNetworkTraversal_IssueRelayConfiguration", "consumes": [ "application/json" @@ -24,6 +24,7 @@ "$ref": "#/parameters/ApiVersionParameter" }, { + "description": "Optional request for providing the id and/or route type for the returned relay configuration.", "in": "body", "name": "body", "schema": { @@ -59,10 +60,11 @@ "type": "object", "properties": { "id": { - "description": "An existing ACS identity.", + "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.", "type": "string" }, "routeType": { + "description": "Filter the routing methodology returned. If not provided, will return all route types in separate ICE servers.", "$ref": "#/definitions/RouteType" } } @@ -107,7 +109,7 @@ "properties": { "expiresOn": { "format": "date-time", - "description": "The date for which the username and credentials are not longer valid.", + "description": "The date for which the username and credentials are not longer valid. Will be 48 hours from request time.", "type": "string" }, "iceServers": { @@ -120,7 +122,7 @@ } }, "RouteType": { - "description": "The routing methodology to where the ICE server will be located from the client.", + "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.", "enum": [ "any", "nearest" diff --git a/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/examples/IssueRelayConfiguration.json b/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/examples/IssueRelayConfiguration.json index 74c90e02a2dd..3264ddc9e800 100644 --- a/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/examples/IssueRelayConfiguration.json +++ b/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/examples/IssueRelayConfiguration.json @@ -10,7 +10,7 @@ "responses": { "200": { "body": { - "expiresOn": "2021-11-10T21:39:39.3244584+00:00", + "expiresOn": "2022-01-10T21:39:39.3244584+00:00", "iceServers": [ { "urls": [ From 55c150f453cd91b6a326359469eab6624a809562 Mon Sep 17 00:00:00 2001 From: Andrew Peacock Date: Tue, 7 Dec 2021 12:34:59 -0800 Subject: [PATCH 3/3] Comments --- .../communication/data-plane/NetworkTraversal/readme.md | 9 +++++++++ .../stable/2022-02-01/CommunicationNetworkTraversal.json | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/specification/communication/data-plane/NetworkTraversal/readme.md b/specification/communication/data-plane/NetworkTraversal/readme.md index d8e5e19406b2..1e19106b9ffd 100644 --- a/specification/communication/data-plane/NetworkTraversal/readme.md +++ b/specification/communication/data-plane/NetworkTraversal/readme.md @@ -58,6 +58,15 @@ input-file: - preview/2021-10-08-preview/CommunicationNetworkTraversal.json ``` +### Tag: package-2022-02-01 + +These settings apply only when `--tag=package-2022-02-01` is specified on the command line. + +```yaml $(tag) == 'package-2022-02-01' +input-file: + - stable/2022-02-01/CommunicationNetworkTraversal.json +``` + --- # Code Generation diff --git a/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json b/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json index dc701b80990a..062d64ae1eed 100644 --- a/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json +++ b/specification/communication/data-plane/NetworkTraversal/stable/2022-02-01/CommunicationNetworkTraversal.json @@ -1,8 +1,8 @@ { "swagger": "2.0", "info": { - "title": "CommunicationNetworkingClient", - "description": "Azure Communication Networking Service", + "title": "CommunicationNetworkTraversalClient", + "description": "Azure Communication Network Traversal Service", "version": "2022-02-01" }, "paths": {