Skip to content

Commit

Permalink
Adding the ACS TURN API swagger (Azure#12561)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpeacock0 committed Jan 28, 2021
1 parent 510bbe9 commit f384a49
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
9 changes: 9 additions & 0 deletions specification/communication/data-plane/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f384a49

Please sign in to comment.