forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the ACS TURN API swagger (Azure#12561)
- Loading branch information
1 parent
510bbe9
commit f384a49
Showing
3 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
180 changes: 180 additions & 0 deletions
180
...ne/Microsoft.CommunicationServicesTurn/preview/2021-02-22-preview1/CommunicationTurn.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
....CommunicationServicesTurn/preview/2021-02-22-preview1/examples/IssueTurnCredentials.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters