diff --git a/specification/communication/data-plane/Microsoft.CommunicationServicesTurn/preview/2021-02-22-preview1/CommunicationTurn.json b/specification/communication/data-plane/Microsoft.CommunicationServicesTurn/preview/2021-02-22-preview1/CommunicationTurn.json new file mode 100644 index 000000000000..98b462771b22 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesTurn/preview/2021-02-22-preview1/CommunicationTurn.json @@ -0,0 +1,180 @@ +{ + "swagger": "2.0", + "info": { + "title": "CommunicationIdentityClient", + "description": "Azure Communication Relay Service", + "version": "2021-02-22-preview1" + }, + "paths": { + "/turn/{id}/:issueCredentials": { + "post": { + "tags": [ + "Turn" + ], + "summary": "Issue TURN credentials for an existing identity.", + "operationId": "CommunicationIdentity_IssueTurnCredentials", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Identifier of the existing identity to issue credentials for.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/TurnCredentialsResponse" + } + } + }, + "x-ms-examples": { + "Issue Turn Credentials": { + "$ref": "./examples/IssueTurnCredentials.json" + } + } + } + } + }, + "definitions": { + "CommunicationError": { + "description": "The Communication Services error.", + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "description": "The error code.", + "type": "string" + }, + "message": { + "description": "The error message.", + "type": "string" + }, + "target": { + "description": "The error target.", + "type": "string", + "readOnly": true + }, + "details": { + "description": "Further details about specific errors that led to this error.", + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationError" + }, + "readOnly": true + }, + "innerError": { + "$ref": "#/definitions/CommunicationError" + } + } + }, + "CommunicationErrorResponse": { + "description": "The Communication Services error.", + "required": [ + "error" + ], + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/CommunicationError" + } + } + }, + "TurnServer": { + "description": "An instance of a TURN server with credentials.", + "required": [ + "credential", + "urls", + "username" + ], + "type": "object", + "properties": { + "urls": { + "description": "URL of the server.", + "type": "string" + }, + "username": { + "description": "User account name which uniquely identifies the credentials.", + "type": "string" + }, + "credential": { + "description": "Credential for the server.", + "type": "string" + } + } + }, + "TurnCredentialsResponse": { + "description": "A TURN credentials response.", + "required": [ + "expiresOn", + "turnServers" + ], + "type": "object", + "properties": { + "expiresOn": { + "format": "date-time", + "description": "The date for which the username and credentials are not longer valid.", + "type": "string" + }, + "turnServers": { + "description": "An array representing the credentials and the TURN server URL.", + "type": "array", + "items": { + "$ref": "#/definitions/TurnServer" + } + } + } + } + }, + "parameters": { + "ApiVersionParameter": { + "in": "query", + "name": "api-version", + "description": "Version of API to invoke.", + "required": true, + "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/Microsoft.CommunicationServicesTurn/preview/2021-02-22-preview1/examples/IssueTurnCredentials.json b/specification/communication/data-plane/Microsoft.CommunicationServicesTurn/preview/2021-02-22-preview1/examples/IssueTurnCredentials.json new file mode 100644 index 000000000000..97c1b3d68e95 --- /dev/null +++ b/specification/communication/data-plane/Microsoft.CommunicationServicesTurn/preview/2021-02-22-preview1/examples/IssueTurnCredentials.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2021-02-22-preview1", + "content-type": "application/json", + "id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081", + "endpoint": "https://my-resource.communication.azure.com" + }, + "responses": { + "200": { + "body": { + "turnServers": [ + { + "urls": "turn:131.107.255.255:3478", + "username": "AgAAJNOeygwB1uVGvuwAVMHV4PLhYDgY66Fg1dUZvQ4AAAAEhXrhc8uJFjOK8lxEsZk3KIpWxc0=", + "credential": "9rl8ablFWj6/aqSuPLgLykLZKqw=" + } + ], + "expiresOn": "2020-09-10T21:39:39.3244584+00:00" + } + } + } +} diff --git a/specification/communication/data-plane/readme.md b/specification/communication/data-plane/readme.md index ee7144770271..ece0fd81a290 100644 --- a/specification/communication/data-plane/readme.md +++ b/specification/communication/data-plane/readme.md @@ -86,6 +86,15 @@ input-file: - Microsoft.CommunicationServicesIdentity/stable/2021-03-07/CommunicationIdentity.json ``` +### Tag: package-2021-02-22-preview1 + +These settings apply only when `--tag=package-2021-02-22-preview1` is specified on the command line. + +```yaml $(tag) == 'package-2021-02-22-preview1' +input-file: + - Microsoft.CommunicationServicesTurn/preview/2021-02-22-preview1/CommunicationTurn.json +``` + ### Tag: package-2020-11-19-preview1 These settings apply only when `--tag=package-2020-11-19-preview1` is specified on the command line.