From cf016863a605baed55e55b1458d6cab2d221c7e0 Mon Sep 17 00:00:00 2001 From: Chenyang Liu Date: Fri, 9 Jun 2023 10:35:01 +0800 Subject: [PATCH 1/9] Original --- .../examples/HealthApi_GetServiceStatus.json | 8 + .../WebPubSub_AddConnectionToGroup.json | 11 + .../examples/WebPubSub_AddUserToGroup.json | 11 + .../examples/WebPubSub_CheckPermission.json | 13 + .../WebPubSub_CloseAllConnections.json | 10 + .../examples/WebPubSub_CloseConnection.json | 11 + .../WebPubSub_CloseGroupConnections.json | 11 + .../WebPubSub_CloseUserConnections.json | 11 + .../examples/WebPubSub_ConnectionExists.json | 11 + .../WebPubSub_GenerateClientToken.json | 15 + .../examples/WebPubSub_GrantPermission.json | 12 + .../examples/WebPubSub_GroupExists.json | 11 + ...bPubSub_RemoveConnectionFromAllGroups.json | 10 + .../WebPubSub_RemoveConnectionFromGroup.json | 11 + .../WebPubSub_RemoveUserFromAllGroups.json | 10 + .../WebPubSub_RemoveUserFromGroup.json | 11 + .../examples/WebPubSub_RevokePermission.json | 12 + .../examples/WebPubSub_SendToAll.json | 11 + .../examples/WebPubSub_SendToConnection.json | 11 + .../examples/WebPubSub_SendToGroup.json | 12 + .../examples/WebPubSub_SendToUser.json | 12 + .../examples/WebPubSub_UserExists.json | 11 + .../stable/2023-07-01/webpubsub.json | 1622 +++++++++++++++++ 23 files changed, 1868 insertions(+) create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json new file mode 100644 index 000000000000..a3dd73c9ab1b --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json @@ -0,0 +1,8 @@ +{ + "parameters": { + "api-version": "2022-11-01" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json new file mode 100644 index 000000000000..83e293bdaf0a --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "group": "group1", + "connectionId": "connection1" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json new file mode 100644 index 000000000000..6e9f866f587b --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "group": "group1", + "userId": "user1" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json new file mode 100644 index 000000000000..766641513697 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "permission": "joinLeaveGroup", + "connectionId": "connection1", + "targetName": "group1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json new file mode 100644 index 000000000000..bfabc81aedf9 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json new file mode 100644 index 000000000000..189d836fc3ed --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "connectionId": "connection1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json new file mode 100644 index 000000000000..f8d9981bf22a --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "group": "group1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json new file mode 100644 index 000000000000..3bf5928d83ce --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "userId": "user1", + "reason": "Close reason" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json new file mode 100644 index 000000000000..af2778a44fd8 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "connectionId": "connection1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json new file mode 100644 index 000000000000..9c989649ae3b --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "userId": "user1", + "minutesToExpire": 5 + }, + "responses": { + "200": { + "body": { + "token": "ABCDEFG.ABC.ABC" + } + } + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json new file mode 100644 index 000000000000..f8f82fc10903 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "permission": "joinLeaveGroup", + "connectionId": "connection1", + "targetName": "group1" + }, + "responses": { + "200": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json new file mode 100644 index 000000000000..c0b418e392b3 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "group": "group1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json new file mode 100644 index 000000000000..f7e426b06d41 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "connectionId": "connection1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json new file mode 100644 index 000000000000..5c18ad8cd16a --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "group": "group1", + "connectionId": "connection1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json new file mode 100644 index 000000000000..5ac427379c00 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "userId": "user1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json new file mode 100644 index 000000000000..4925b3d49bc0 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "group": "group1", + "userId": "user1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json new file mode 100644 index 000000000000..b079d5e01bef --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "permission": "joinLeaveGroup", + "connectionId": "connection1", + "targetName": "group1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json new file mode 100644 index 000000000000..a39bf74a9df1 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "filter": "startswith(userId, 'listener-')", + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json new file mode 100644 index 000000000000..beef27df4967 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "connectionId": "connection1", + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json new file mode 100644 index 000000000000..5a61521d45b0 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "group": "group1", + "filter": "startswith(userId, 'listener-')", + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json new file mode 100644 index 000000000000..392369ee6c14 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "userId": "user1", + "filter": "startswith(userId, 'listener-')", + "message": "Message to send" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json new file mode 100644 index 000000000000..98566cf28a92 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-11-01", + "hub": "hub1", + "userId": "user1" + }, + "responses": { + "200": {}, + "404": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json new file mode 100644 index 000000000000..0a9543453051 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json @@ -0,0 +1,1622 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Web PubSub Service REST API", + "version": "2022-11-01" + }, + "paths": { + "/api/health": { + "head": { + "tags": [ + "general" + ], + "summary": "Get service health status.", + "operationId": "HealthApi_GetServiceStatus", + "parameters": [ + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The service is healthy" + }, + "default": { + "description": "Error response" + } + }, + "x-ms-examples": { + "HealthApi_GetServiceStatus": { + "$ref": "./examples/HealthApi_GetServiceStatus.json" + } + } + } + }, + "/api/hubs/{hub}/:closeConnections": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Close the connections in the hub.", + "operationId": "WebPubSub_CloseAllConnections", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "excluded", + "description": "Exclude these connectionIds when closing the connections in the hub.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "reason", + "description": "The reason closing the client connection.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_CloseAllConnections": { + "$ref": "./examples/WebPubSub_CloseAllConnections.json" + } + } + } + }, + "/api/hubs/{hub}/:generateToken": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Generate token for the client to connect Azure Web PubSub service.", + "operationId": "WebPubSub_GenerateClientToken", + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "userId", + "description": "User Id.", + "type": "string" + }, + { + "in": "query", + "name": "role", + "description": "Roles that the connection with the generated token will have.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "minutesToExpire", + "description": "The expire time of the generated token.", + "type": "integer", + "format": "int32", + "default": 60, + "minimum": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "group", + "description": "Groups that the connection will join when it connects.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ClientTokenResponse" + } + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_GenerateClientToken": { + "$ref": "./examples/WebPubSub_GenerateClientToken.json" + } + } + } + }, + "/api/hubs/{hub}/:send": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Broadcast content inside request body to all the connected client connections.", + "operationId": "WebPubSub_SendToAll", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "excluded", + "description": "Excluded connection Ids.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "The payload body.", + "required": true, + "schema": { + "format": "binary", + "type": "string" + } + }, + { + "in": "query", + "name": "filter", + "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", + "type": "string" + } + ], + "responses": { + "202": { + "description": "The message is accepted. The service follows fire-and-forget pattern when sending messages." + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_SendToAll": { + "$ref": "./examples/WebPubSub_SendToAll.json" + } + } + } + }, + "/api/hubs/{hub}/connections/{connectionId}": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Close the client connection.", + "operationId": "WebPubSub_CloseConnection", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "reason", + "description": "The reason closing the client connection.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_CloseConnection": { + "$ref": "./examples/WebPubSub_CloseConnection.json" + } + } + }, + "head": { + "tags": [ + "webpubsub" + ], + "summary": "Check if the connection with the given connectionId exists.", + "operationId": "WebPubSub_ConnectionExists", + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "connectionId", + "description": "The connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" + }, + "default": { + "description": "Error response", + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_ConnectionExists": { + "$ref": "./examples/WebPubSub_ConnectionExists.json" + } + } + } + }, + "/api/hubs/{hub}/connections/{connectionId}/:send": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Send content inside request body to the specific connection.", + "operationId": "WebPubSub_SendToConnection", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "connectionId", + "description": "The connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "The payload body.", + "required": true, + "schema": { + "format": "binary", + "type": "string" + } + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_SendToConnection": { + "$ref": "./examples/WebPubSub_SendToConnection.json" + } + } + } + }, + "/api/hubs/{hub}/connections/{connectionId}/groups": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Remove a connection from all groups.", + "operationId": "WebPubSub_RemoveConnectionFromAllGroups", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "The connection is removed from all groups." + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RemoveConnectionFromAllGroups": { + "$ref": "./examples/WebPubSub_RemoveConnectionFromAllGroups.json" + } + } + } + }, + "/api/hubs/{hub}/groups/{group}": { + "head": { + "tags": [ + "webpubsub" + ], + "summary": "Check if there are any client connections inside the given group", + "operationId": "WebPubSub_GroupExists", + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" + }, + "default": { + "description": "Error response", + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_GroupExists": { + "$ref": "./examples/WebPubSub_GroupExists.json" + } + } + } + }, + "/api/hubs/{hub}/groups/{group}/:closeConnections": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Close connections in the specific group.", + "operationId": "WebPubSub_CloseGroupConnections", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "query", + "name": "excluded", + "description": "Exclude these connectionIds when closing the connections in the group.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "reason", + "description": "The reason closing the client connection.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_CloseGroupConnections": { + "$ref": "./examples/WebPubSub_CloseGroupConnections.json" + } + } + } + }, + "/api/hubs/{hub}/groups/{group}/:send": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Send content inside request body to a group of connections.", + "operationId": "WebPubSub_SendToGroup", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "query", + "name": "excluded", + "description": "Excluded connection Ids", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "The payload body.", + "required": true, + "schema": { + "format": "binary", + "type": "string" + } + }, + { + "in": "query", + "name": "filter", + "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", + "type": "string" + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_SendToGroup": { + "$ref": "./examples/WebPubSub_SendToGroup.json" + } + } + } + }, + "/api/hubs/{hub}/groups/{group}/connections/{connectionId}": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Remove a connection from the target group.", + "operationId": "WebPubSub_RemoveConnectionFromGroup", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RemoveConnectionFromGroup": { + "$ref": "./examples/WebPubSub_RemoveConnectionFromGroup.json" + } + } + }, + "put": { + "tags": [ + "webpubsub" + ], + "summary": "Add a connection to the target group.", + "operationId": "WebPubSub_AddConnectionToGroup", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_AddConnectionToGroup": { + "$ref": "./examples/WebPubSub_AddConnectionToGroup.json" + } + } + } + }, + "/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Revoke permission for the connection.", + "operationId": "WebPubSub_RevokePermission", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "permission", + "description": "The permission: current supported actions are joinLeaveGroup and sendToGroup.", + "required": true, + "type": "string", + "enum": [ + "sendToGroup", + "joinLeaveGroup" + ], + "x-ms-enum": { + "name": "WebPubSubPermission", + "modelAsString": true + } + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "targetName", + "description": "The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RevokePermission": { + "$ref": "./examples/WebPubSub_RevokePermission.json" + } + } + }, + "head": { + "tags": [ + "webpubsub" + ], + "summary": "Check if a connection has permission to the specified action.", + "operationId": "WebPubSub_CheckPermission", + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "permission", + "description": "The permission: current supported actions are joinLeaveGroup and sendToGroup.", + "required": true, + "type": "string", + "enum": [ + "sendToGroup", + "joinLeaveGroup" + ], + "x-ms-enum": { + "name": "WebPubSubPermission", + "modelAsString": true + } + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "targetName", + "description": "The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" + }, + "default": { + "description": "Error response", + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_CheckPermission": { + "$ref": "./examples/WebPubSub_CheckPermission.json" + } + } + }, + "put": { + "tags": [ + "webpubsub" + ], + "summary": "Grant permission to the connection.", + "operationId": "WebPubSub_GrantPermission", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "permission", + "description": "The permission: current supported actions are joinLeaveGroup and sendToGroup.", + "required": true, + "type": "string", + "enum": [ + "sendToGroup", + "joinLeaveGroup" + ], + "x-ms-enum": { + "name": "WebPubSubPermission", + "modelAsString": true + } + }, + { + "in": "path", + "name": "connectionId", + "description": "Target connection Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "targetName", + "description": "The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_GrantPermission": { + "$ref": "./examples/WebPubSub_GrantPermission.json" + } + } + } + }, + "/api/hubs/{hub}/users/{userId}": { + "head": { + "tags": [ + "webpubsub" + ], + "summary": "Check if there are any client connections connected for the given user.", + "operationId": "WebPubSub_UserExists", + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "userId", + "description": "Target user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" + }, + "default": { + "description": "Error response", + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_UserExists": { + "$ref": "./examples/WebPubSub_UserExists.json" + } + } + } + }, + "/api/hubs/{hub}/users/{userId}/:closeConnections": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Close connections for the specific user.", + "operationId": "WebPubSub_CloseUserConnections", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "userId", + "description": "The user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "excluded", + "description": "Exclude these connectionIds when closing the connections for the user.", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "reason", + "description": "The reason closing the client connection.", + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_CloseUserConnections": { + "$ref": "./examples/WebPubSub_CloseUserConnections.json" + } + } + } + }, + "/api/hubs/{hub}/users/{userId}/:send": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Send content inside request body to the specific user.", + "operationId": "WebPubSub_SendToUser", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "userId", + "description": "The user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "The payload body.", + "required": true, + "schema": { + "format": "binary", + "type": "string" + } + }, + { + "in": "query", + "name": "filter", + "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", + "type": "string" + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_SendToUser": { + "$ref": "./examples/WebPubSub_SendToUser.json" + } + } + } + }, + "/api/hubs/{hub}/users/{userId}/groups": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Remove a user from all groups.", + "operationId": "WebPubSub_RemoveUserFromAllGroups", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "userId", + "description": "Target user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "The user is removed from all groups." + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RemoveUserFromAllGroups": { + "$ref": "./examples/WebPubSub_RemoveUserFromAllGroups.json" + } + } + } + }, + "/api/hubs/{hub}/users/{userId}/groups/{group}": { + "delete": { + "tags": [ + "webpubsub" + ], + "summary": "Remove a user from the target group.", + "operationId": "WebPubSub_RemoveUserFromGroup", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "path", + "name": "userId", + "description": "Target user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "The user is removed from the group." + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RemoveUserFromGroup": { + "$ref": "./examples/WebPubSub_RemoveUserFromGroup.json" + } + } + }, + "put": { + "tags": [ + "webpubsub" + ], + "summary": "Add a user to the target group.", + "operationId": "WebPubSub_AddUserToGroup", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "path", + "name": "userId", + "description": "Target user Id.", + "required": true, + "type": "string", + "minLength": 1 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_AddUserToGroup": { + "$ref": "./examples/WebPubSub_AddUserToGroup.json" + } + } + } + } + }, + "definitions": { + "ClientTokenResponse": { + "description": "The response object containing the token for the client", + "type": "object", + "properties": { + "token": { + "description": "The token value for the WebSocket client to connect to the service", + "type": "string" + } + } + }, + "ErrorDetail": { + "description": "The error object.", + "type": "object", + "properties": { + "code": { + "description": "One of a server-defined set of error codes.", + "type": "string" + }, + "message": { + "description": "A human-readable representation of the error.", + "type": "string" + }, + "target": { + "description": "The target of the error.", + "type": "string" + }, + "details": { + "description": "An array of details about specific errors that led to this reported error.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorDetail" + } + }, + "inner": { + "$ref": "#/definitions/InnerError" + } + } + }, + "InnerError": { + "type": "object", + "properties": { + "code": { + "description": "A more specific error code than was provided by the containing error.", + "type": "string" + }, + "inner": { + "$ref": "#/definitions/InnerError" + } + } + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "Endpoint", + "description": "HTTP or HTTPS endpoint for the Web PubSub service instance.", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + } + ] + } +} From cdcf3fbefdc9fd804a2ea6d3c643c43c80272c23 Mon Sep 17 00:00:00 2001 From: Chenyang Liu Date: Fri, 9 Jun 2023 10:48:25 +0800 Subject: [PATCH 2/9] Add 2023-07-01 --- .../examples/HealthApi_GetServiceStatus.json | 2 +- .../WebPubSub_AddConnectionToGroup.json | 2 +- .../WebPubSub_AddConnectionsToGroups.json | 9 + .../examples/WebPubSub_AddUserToGroup.json | 2 +- .../examples/WebPubSub_CheckPermission.json | 2 +- .../WebPubSub_CloseAllConnections.json | 2 +- .../examples/WebPubSub_CloseConnection.json | 2 +- .../WebPubSub_CloseGroupConnections.json | 2 +- .../WebPubSub_CloseUserConnections.json | 2 +- .../examples/WebPubSub_ConnectionExists.json | 2 +- .../WebPubSub_GenerateClientToken.json | 2 +- .../examples/WebPubSub_GrantPermission.json | 2 +- .../examples/WebPubSub_GroupExists.json | 2 +- .../examples/WebPubSub_GroupInvoke.json | 15 + ...bPubSub_RemoveConnectionFromAllGroups.json | 2 +- .../WebPubSub_RemoveConnectionFromGroup.json | 2 +- ...WebPubSub_RemoveConnectionsFromGroups.json | 9 + .../WebPubSub_RemoveUserFromAllGroups.json | 2 +- .../WebPubSub_RemoveUserFromGroup.json | 2 +- .../examples/WebPubSub_RevokePermission.json | 2 +- .../examples/WebPubSub_SendToAll.json | 3 +- .../examples/WebPubSub_SendToConnection.json | 3 +- .../examples/WebPubSub_SendToGroup.json | 3 +- .../examples/WebPubSub_SendToUser.json | 3 +- .../examples/WebPubSub_UserExists.json | 2 +- .../stable/2023-07-01/webpubsub.json | 312 +++++++++++++++++- specification/webpubsub/data-plane/readme.md | 37 ++- 27 files changed, 391 insertions(+), 39 deletions(-) create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupInvoke.json create mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json index a3dd73c9ab1b..5d01bd171145 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/HealthApi_GetServiceStatus.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01" + "api-version": "2023-07-01" }, "responses": { "200": {} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json index 83e293bdaf0a..c8f5a88d113f 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionToGroup.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "group": "group1", "connectionId": "connection1" diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json new file mode 100644 index 000000000000..31b180029e47 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json @@ -0,0 +1,9 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json index 6e9f866f587b..012f55fe4b9d 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddUserToGroup.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "group": "group1", "userId": "user1" diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json index 766641513697..2410bb4c9cc3 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CheckPermission.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "permission": "joinLeaveGroup", "connectionId": "connection1", diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json index bfabc81aedf9..d0ced81dd1a8 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseAllConnections.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "reason": "Close reason" }, diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json index 189d836fc3ed..483f7dfae401 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseConnection.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "connectionId": "connection1", "reason": "Close reason" diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json index f8d9981bf22a..fa11c8f8c235 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseGroupConnections.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "group": "group1", "reason": "Close reason" diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json index 3bf5928d83ce..995b3b194cac 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_CloseUserConnections.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "userId": "user1", "reason": "Close reason" diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json index af2778a44fd8..1b0ea37b08a0 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_ConnectionExists.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "connectionId": "connection1" }, diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json index 9c989649ae3b..f19f589041f4 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GenerateClientToken.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "userId": "user1", "minutesToExpire": 5 diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json index f8f82fc10903..4414ae64b7ad 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GrantPermission.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "permission": "joinLeaveGroup", "connectionId": "connection1", diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json index c0b418e392b3..19bfe3a196fa 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupExists.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "group": "group1" }, diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupInvoke.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupInvoke.json new file mode 100644 index 000000000000..3a661c046f83 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupInvoke.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1", + "group": "group1", + "filter": "startswith(userId, 'listener-')", + "messageTtlSeconds": 15, + "message": "Message to send" + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json index f7e426b06d41..6d09523e774e 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromAllGroups.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "connectionId": "connection1" }, diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json index 5c18ad8cd16a..6c8e239b6ee0 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionFromGroup.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "group": "group1", "connectionId": "connection1" diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json new file mode 100644 index 000000000000..31b180029e47 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json @@ -0,0 +1,9 @@ +{ + "parameters": { + "api-version": "2023-07-01", + "hub": "hub1" + }, + "responses": { + "202": {} + } +} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json index 5ac427379c00..928c2bccaf86 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromAllGroups.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "userId": "user1" }, diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json index 4925b3d49bc0..786cf0fd2a3c 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveUserFromGroup.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "group": "group1", "userId": "user1" diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json index b079d5e01bef..fa567ada5480 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RevokePermission.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "permission": "joinLeaveGroup", "connectionId": "connection1", diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json index a39bf74a9df1..e5ad3a993457 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToAll.json @@ -1,8 +1,9 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "filter": "startswith(userId, 'listener-')", + "messageTtlSeconds": 15, "message": "Message to send" }, "responses": { diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json index beef27df4967..ab590a886b0d 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToConnection.json @@ -1,8 +1,9 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "connectionId": "connection1", + "messageTtlSeconds": 15, "message": "Message to send" }, "responses": { diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json index 5a61521d45b0..c7a2eeeb2a86 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToGroup.json @@ -1,9 +1,10 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "group": "group1", "filter": "startswith(userId, 'listener-')", + "messageTtlSeconds": 15, "message": "Message to send" }, "responses": { diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json index 392369ee6c14..181d2f93c940 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_SendToUser.json @@ -1,9 +1,10 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "userId": "user1", "filter": "startswith(userId, 'listener-')", + "messageTtlSeconds": 15, "message": "Message to send" }, "responses": { diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json index 98566cf28a92..ba4aa1b5a1c7 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_UserExists.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2022-11-01", + "api-version": "2023-07-01", "hub": "hub1", "userId": "user1" }, diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json index 0a9543453051..d47dfc34f539 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "Azure Web PubSub Service REST API", - "version": "2022-11-01" + "version": "2023-07-01" }, "paths": { "/api/health": { @@ -36,6 +36,72 @@ } } }, + "/api/hubs/{hub}/:addToGroup": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Add filtered connections to multiple groups.", + "operationId": "WebPubSub_AddConnectionsToGroups", + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "Target groups and connection filter.", + "schema": { + "$ref": "#/definitions/MultiGroupJoinRequest" + } + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_AddConnectionsToGroups": { + "$ref": "./examples/WebPubSub_AddConnectionsToGroups.json" + } + } + } + }, "/api/hubs/{hub}/:closeConnections": { "post": { "tags": [ @@ -196,6 +262,72 @@ } } }, + "/api/hubs/{hub}/:removeFromGroup": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Remove filtered connections from multiple groups.", + "operationId": "WebPubSub_RemoveConnectionsFromGroups", + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "Target groups and connection filter.", + "schema": { + "$ref": "#/definitions/MultiGroupLeaveRequest" + } + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_RemoveConnectionsFromGroups": { + "$ref": "./examples/WebPubSub_RemoveConnectionsFromGroups.json" + } + } + } + }, "/api/hubs/{hub}/:send": { "post": { "tags": [ @@ -252,6 +384,15 @@ "name": "filter", "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", "type": "string" + }, + { + "in": "query", + "name": "messageTtlSeconds", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "type": "integer", + "format": "int32", + "maximum": 300, + "minimum": 0 } ], "responses": { @@ -448,6 +589,15 @@ "format": "binary", "type": "string" } + }, + { + "in": "query", + "name": "messageTtlSeconds", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "type": "integer", + "format": "int32", + "maximum": 300, + "minimum": 0 } ], "responses": { @@ -672,6 +822,113 @@ } } }, + "/api/hubs/{hub}/groups/{group}/:invoke": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Send content inside request body to a group of connections and wait for acknowledgement.", + "operationId": "WebPubSub_GroupInvoke", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], + "produces": [ + "application/json", + "application/octet-stream" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "path", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "required": true, + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "query", + "name": "excluded", + "description": "Excluded connection Ids", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "messageTtlSeconds", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "type": "integer", + "format": "int32", + "maximum": 300, + "minimum": 0 + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "The payload body.", + "required": true, + "schema": { + "format": "binary", + "type": "string" + } + }, + { + "in": "query", + "name": "filter", + "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "format": "binary", + "type": "string" + } + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_GroupInvoke": { + "$ref": "./examples/WebPubSub_GroupInvoke.json" + } + } + } + }, "/api/hubs/{hub}/groups/{group}/:send": { "post": { "tags": [ @@ -738,6 +995,15 @@ "name": "filter", "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", "type": "string" + }, + { + "in": "query", + "name": "messageTtlSeconds", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "type": "integer", + "format": "int32", + "maximum": 300, + "minimum": 0 } ], "responses": { @@ -1326,6 +1592,15 @@ "name": "filter", "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", "type": "string" + }, + { + "in": "query", + "name": "messageTtlSeconds", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "type": "integer", + "format": "int32", + "maximum": 300, + "minimum": 0 } ], "responses": { @@ -1602,18 +1877,49 @@ "$ref": "#/definitions/InnerError" } } + }, + "MultiGroupJoinRequest": { + "description": "The request object containing targets groups and connection filter", + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, + "connectionFilter": { + "type": "string" + } + } + }, + "MultiGroupLeaveRequest": { + "description": "The request object containing targets groups and connection filter", + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, + "connectionFilter": { + "type": "string" + } + } } }, "x-ms-parameterized-host": { - "hostTemplate": "{Endpoint}", + "hostTemplate": "{endpoint}", "useSchemePrefix": false, "parameters": [ { - "name": "Endpoint", + "name": "endpoint", "description": "HTTP or HTTPS endpoint for the Web PubSub service instance.", "x-ms-parameter-location": "client", "required": true, "type": "string", + "format": "url", "in": "path", "x-ms-skip-url-encoding": true } diff --git a/specification/webpubsub/data-plane/readme.md b/specification/webpubsub/data-plane/readme.md index 993817ba69e1..2af5241e4544 100644 --- a/specification/webpubsub/data-plane/readme.md +++ b/specification/webpubsub/data-plane/readme.md @@ -24,14 +24,14 @@ To see additional help and options, run: These are the global settings for the Web PubSub Service API. -```yaml +``` yaml openapi-type: data-plane -tag: package-2022-11-01 +tag: package-2023-07-01 ``` ### Suppression -```yaml +``` yaml directive: - suppress: LROStatusCodesReturnTypeSchema reason: For this data plane API, it is not a long run operation and the status code indicates the results. @@ -39,11 +39,20 @@ directive: reason: There are a lot of APIs that does not have the example. While it is being worked upon disabling this to ensure that we catch and fix other violations ``` + +### Tag: package-2023-07-01 + +These settings apply only when `--tag=package-2023-07-01` is specified on the command line. + +```yaml $(tag) == 'package-2023-07-01' +input-file: + - WebPubSub/stable/2023-07-01/webpubsub.json +``` ### Tag: package-2022-11-01 These settings apply only when `--tag=package-2022-11-01` is specified on the command line. -```yaml $(tag) == 'package-2022-11-01' +``` yaml $(tag) == 'package-2022-11-01' input-file: - WebPubSub/stable/2022-11-01/webpubsub.json title: AzureMessagingWebPubSubServiceClient @@ -53,7 +62,7 @@ title: AzureMessagingWebPubSubServiceClient These settings apply only when `--tag=package-2021-10-01` is specified on the command line. -```yaml $(tag) == 'package-2021-10-01' +``` yaml $(tag) == 'package-2021-10-01' input-file: - WebPubSub/stable/2021-10-01/webpubsub.json title: AzureMessagingWebPubSubServiceClient @@ -63,7 +72,7 @@ title: AzureMessagingWebPubSubServiceClient These settings apply only when `--tag=package-2021-08-01-preview` is specified on the command line. -```yaml $(tag) == 'package-2021-08-01-preview' +``` yaml $(tag) == 'package-2021-08-01-preview' input-file: - WebPubSub/preview/2021-08-01-preview/webpubsub.json title: AzureMessagingWebPubSubServiceClient @@ -73,7 +82,7 @@ title: AzureMessagingWebPubSubServiceClient These settings apply only when `--tag=package-2021-05-01-preview` is specified on the command line. -```yaml $(tag) == 'package-2021-05-01-preview' +``` yaml $(tag) == 'package-2021-05-01-preview' input-file: - WebPubSub/preview/2021-05-01-preview/webpubsub.json title: AzureMessagingWebPubSubServiceClient @@ -86,7 +95,7 @@ title: AzureMessagingWebPubSubServiceClient This section describes what SDK should be generated by the automatic system. This is not used by Autorest itself. -```yaml $(swagger-to-sdk) +``` yaml $(swagger-to-sdk) swagger-to-sdk: - repo: azure-sdk-for-net-track2 ``` @@ -96,7 +105,7 @@ swagger-to-sdk: These settings apply only when `--csharp` is specified on the command line. Please also specify `--csharp-sdks-folder=`. -```yaml $(csharp) +``` yaml $(csharp) csharp: # last generated with AutoRest.0.17.3 azure-arm: false @@ -112,7 +121,7 @@ These settings apply only when `--python` is specified on the command line. Please also specify `--python-sdks-folder=`. Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. -```yaml $(python) +``` yaml $(python) python-mode: create azure-arm: false license-header: MICROSOFT_MIT_NO_VERSION @@ -122,12 +131,12 @@ package-version: 1.0.0b1 clear-output-folder: true ``` -```yaml $(python) && $(python-mode) == 'update' +``` yaml $(python) && $(python-mode) == 'update' no-namespace-folders: true output-folder: $(python-sdks-folder)/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice ``` -```yaml $(python) && $(python-mode) == 'create' +``` yaml $(python) && $(python-mode) == 'create' basic-setup-py: true output-folder: $(python-sdks-folder)/webpubsub/azure-messaging-webpubsubservice ``` @@ -138,7 +147,7 @@ AutoRest V3 generators require the use of `--tag=all-api-versions` to select api This block is updated by an automatic script. Edits may be lost! -```yaml $(tag) == 'all-api-versions' /* autogenerated */ +``` yaml $(tag) == 'all-api-versions' /* autogenerated */ # include the azure profile definitions from the standard location require: $(this-folder)/../../../profiles/readme.md @@ -150,7 +159,7 @@ input-file: If there are files that should not be in the `all-api-versions` set, uncomment the `exclude-file` section below and add the file paths. -```yaml $(tag) == 'all-api-versions' +``` yaml $(tag) == 'all-api-versions' #exclude-file: # - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json ``` From 0f65275a74888f2d8b90be4421e986f8e1eac406 Mon Sep 17 00:00:00 2001 From: xingsy97 <87063252+xingsy97@users.noreply.github.com> Date: Wed, 14 Jun 2023 11:01:09 +0800 Subject: [PATCH 3/9] update --- .../stable/2023-07-01/webpubsub.json | 253 +++++++++--------- 1 file changed, 126 insertions(+), 127 deletions(-) diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json index d47dfc34f539..0cd4351973fd 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json @@ -36,7 +36,7 @@ } } }, - "/api/hubs/{hub}/:addToGroup": { + "/api/hubs/{hub}/:addToGroups": { "post": { "tags": [ "webpubsub" @@ -73,7 +73,7 @@ "name": "message", "description": "Target groups and connection filter.", "schema": { - "$ref": "#/definitions/MultiGroupJoinRequest" + "$ref": "#/definitions/AddToGroupsRequest" } } ], @@ -262,7 +262,113 @@ } } }, - "/api/hubs/{hub}/:removeFromGroup": { + "/api/hubs/{hub}/:invoke": { + "post": { + "tags": [ + "webpubsub" + ], + "summary": "Send content inside request body to a group of connections and wait for acknowledgement.", + "operationId": "WebPubSub_GroupInvoke", + "consumes": [ + "application/octet-stream", + "text/plain", + "application/json" + ], + "produces": [ + "application/json", + "application/octet-stream" + ], + "parameters": [ + { + "in": "path", + "name": "hub", + "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", + "required": true, + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" + }, + { + "in": "query", + "name": "group", + "description": "Target group name, which length should be greater than 0 and less than 1025.", + "type": "string", + "maxLength": 1024, + "minLength": 1, + "pattern": "^(?!\\s+$).+$" + }, + { + "in": "query", + "name": "excluded", + "description": "Excluded connection Ids", + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "in": "query", + "name": "api-version", + "description": "The version of the REST APIs.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message", + "description": "The payload body.", + "required": true, + "schema": { + "format": "binary", + "type": "string" + } + }, + { + "in": "query", + "name": "filter", + "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", + "type": "string" + }, + { + "in": "query", + "name": "messageTtlSeconds", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "type": "integer", + "format": "int32", + "maximum": 300, + "minimum": 0 + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "format": "binary", + "type": "string" + } + }, + "default": { + "description": "Error response", + "schema": { + "$ref": "#/definitions/ErrorDetail" + }, + "x-ms-error-response": true, + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + } + } + }, + "x-ms-examples": { + "WebPubSub_GroupInvoke": { + "$ref": "./examples/WebPubSub_GroupInvoke.json" + } + } + } + }, + "/api/hubs/{hub}/:removeFromGroups": { "post": { "tags": [ "webpubsub" @@ -299,7 +405,7 @@ "name": "message", "description": "Target groups and connection filter.", "schema": { - "$ref": "#/definitions/MultiGroupLeaveRequest" + "$ref": "#/definitions/RemoveFromGroupsRequest" } } ], @@ -822,113 +928,6 @@ } } }, - "/api/hubs/{hub}/groups/{group}/:invoke": { - "post": { - "tags": [ - "webpubsub" - ], - "summary": "Send content inside request body to a group of connections and wait for acknowledgement.", - "operationId": "WebPubSub_GroupInvoke", - "consumes": [ - "application/octet-stream", - "text/plain", - "application/json" - ], - "produces": [ - "application/json", - "application/octet-stream" - ], - "parameters": [ - { - "in": "path", - "name": "hub", - "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", - "required": true, - "type": "string", - "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" - }, - { - "in": "path", - "name": "group", - "description": "Target group name, which length should be greater than 0 and less than 1025.", - "required": true, - "type": "string", - "maxLength": 1024, - "minLength": 1, - "pattern": "^(?!\\s+$).+$" - }, - { - "in": "query", - "name": "excluded", - "description": "Excluded connection Ids", - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "in": "query", - "name": "messageTtlSeconds", - "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", - "type": "integer", - "format": "int32", - "maximum": 300, - "minimum": 0 - }, - { - "in": "query", - "name": "api-version", - "description": "The version of the REST APIs.", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "message", - "description": "The payload body.", - "required": true, - "schema": { - "format": "binary", - "type": "string" - } - }, - { - "in": "query", - "name": "filter", - "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "format": "binary", - "type": "string" - } - }, - "default": { - "description": "Error response", - "schema": { - "$ref": "#/definitions/ErrorDetail" - }, - "x-ms-error-response": true, - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - } - } - }, - "x-ms-examples": { - "WebPubSub_GroupInvoke": { - "$ref": "./examples/WebPubSub_GroupInvoke.json" - } - } - } - }, "/api/hubs/{hub}/groups/{group}/:send": { "post": { "tags": [ @@ -1828,6 +1827,21 @@ } }, "definitions": { + "AddToGroupsRequest": { + "description": "The request object containing targets groups and connection filter", + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, + "connectionFilter": { + "type": "string" + } + } + }, "ClientTokenResponse": { "description": "The response object containing the token for the client", "type": "object", @@ -1878,22 +1892,7 @@ } } }, - "MultiGroupJoinRequest": { - "description": "The request object containing targets groups and connection filter", - "type": "object", - "properties": { - "groups": { - "type": "array", - "items": { - "type": "string" - } - }, - "connectionFilter": { - "type": "string" - } - } - }, - "MultiGroupLeaveRequest": { + "RemoveFromGroupsRequest": { "description": "The request object containing targets groups and connection filter", "type": "object", "properties": { From 46ee023b628676407c019907cc92520bda692ae7 Mon Sep 17 00:00:00 2001 From: xingsy97 <87063252+xingsy97@users.noreply.github.com> Date: Wed, 14 Jun 2023 15:49:52 +0800 Subject: [PATCH 4/9] update --- .../WebPubSub_AddConnectionsToGroups.json | 2 +- ...GroupInvoke.json => WebPubSub_Invoke.json} | 2 - ...WebPubSub_RemoveConnectionsFromGroups.json | 2 +- .../stable/2023-07-01/webpubsub.json | 42 ++++--------------- 4 files changed, 9 insertions(+), 39 deletions(-) rename specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/{WebPubSub_GroupInvoke.json => WebPubSub_Invoke.json} (80%) diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json index 31b180029e47..1e46eb54d2cf 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json @@ -4,6 +4,6 @@ "hub": "hub1" }, "responses": { - "202": {} + "200": {} } } diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupInvoke.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_Invoke.json similarity index 80% rename from specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupInvoke.json rename to specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_Invoke.json index 3a661c046f83..3461fa64cf1e 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_GroupInvoke.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_Invoke.json @@ -2,9 +2,7 @@ "parameters": { "api-version": "2023-07-01", "hub": "hub1", - "group": "group1", "filter": "startswith(userId, 'listener-')", - "messageTtlSeconds": 15, "message": "Message to send" }, "responses": { diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json index 31b180029e47..1e46eb54d2cf 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json @@ -4,6 +4,6 @@ "hub": "hub1" }, "responses": { - "202": {} + "200": {} } } diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json index 0cd4351973fd..c456fefc954b 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json @@ -78,8 +78,8 @@ } ], "responses": { - "202": { - "description": "Accepted" + "200": { + "description": "Success" }, "default": { "description": "Error response", @@ -268,7 +268,7 @@ "webpubsub" ], "summary": "Send content inside request body to a group of connections and wait for acknowledgement.", - "operationId": "WebPubSub_GroupInvoke", + "operationId": "WebPubSub_Invoke", "consumes": [ "application/octet-stream", "text/plain", @@ -287,25 +287,6 @@ "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" }, - { - "in": "query", - "name": "group", - "description": "Target group name, which length should be greater than 0 and less than 1025.", - "type": "string", - "maxLength": 1024, - "minLength": 1, - "pattern": "^(?!\\s+$).+$" - }, - { - "in": "query", - "name": "excluded", - "description": "Excluded connection Ids", - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, { "in": "query", "name": "api-version", @@ -328,15 +309,6 @@ "name": "filter", "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", "type": "string" - }, - { - "in": "query", - "name": "messageTtlSeconds", - "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", - "type": "integer", - "format": "int32", - "maximum": 300, - "minimum": 0 } ], "responses": { @@ -362,8 +334,8 @@ } }, "x-ms-examples": { - "WebPubSub_GroupInvoke": { - "$ref": "./examples/WebPubSub_GroupInvoke.json" + "WebPubSub_Invoke": { + "$ref": "./examples/WebPubSub_Invoke.json" } } } @@ -410,8 +382,8 @@ } ], "responses": { - "202": { - "description": "Accepted" + "200": { + "description": "Success" }, "default": { "description": "Error response", From 3a6551f692bcb339aec888c5dea2bce0e4d7193c Mon Sep 17 00:00:00 2001 From: xingsy97 <87063252+xingsy97@users.noreply.github.com> Date: Wed, 14 Jun 2023 17:46:06 +0800 Subject: [PATCH 5/9] remove invoke --- .../2023-07-01/examples/WebPubSub_Invoke.json | 13 ---- .../stable/2023-07-01/webpubsub.json | 78 ------------------- 2 files changed, 91 deletions(-) delete mode 100644 specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_Invoke.json diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_Invoke.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_Invoke.json deleted file mode 100644 index 3461fa64cf1e..000000000000 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_Invoke.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "api-version": "2023-07-01", - "hub": "hub1", - "filter": "startswith(userId, 'listener-')", - "message": "Message to send" - }, - "responses": { - "200": { - "body": {} - } - } -} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json index c456fefc954b..f131a49e8ea7 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json @@ -262,84 +262,6 @@ } } }, - "/api/hubs/{hub}/:invoke": { - "post": { - "tags": [ - "webpubsub" - ], - "summary": "Send content inside request body to a group of connections and wait for acknowledgement.", - "operationId": "WebPubSub_Invoke", - "consumes": [ - "application/octet-stream", - "text/plain", - "application/json" - ], - "produces": [ - "application/json", - "application/octet-stream" - ], - "parameters": [ - { - "in": "path", - "name": "hub", - "description": "Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.", - "required": true, - "type": "string", - "pattern": "^[A-Za-z][A-Za-z0-9_`,.[\\]]{0,127}$" - }, - { - "in": "query", - "name": "api-version", - "description": "The version of the REST APIs.", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "message", - "description": "The payload body.", - "required": true, - "schema": { - "format": "binary", - "type": "string" - } - }, - { - "in": "query", - "name": "filter", - "description": "Following OData filter syntax to filter out the subscribers receiving the messages.", - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "format": "binary", - "type": "string" - } - }, - "default": { - "description": "Error response", - "schema": { - "$ref": "#/definitions/ErrorDetail" - }, - "x-ms-error-response": true, - "headers": { - "x-ms-error-code": { - "x-ms-client-name": "ErrorCode", - "type": "string" - } - } - } - }, - "x-ms-examples": { - "WebPubSub_Invoke": { - "$ref": "./examples/WebPubSub_Invoke.json" - } - } - } - }, "/api/hubs/{hub}/:removeFromGroups": { "post": { "tags": [ From fdcbdfd578fbc3d872b84f0c424e87b90ba35f6b Mon Sep 17 00:00:00 2001 From: xingsy97 <87063252+xingsy97@users.noreply.github.com> Date: Thu, 15 Jun 2023 00:01:04 +0800 Subject: [PATCH 6/9] resolve comments --- .../stable/2023-07-01/webpubsub.json | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json index f131a49e8ea7..36a419c21946 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json @@ -44,10 +44,7 @@ "summary": "Add filtered connections to multiple groups.", "operationId": "WebPubSub_AddConnectionsToGroups", "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" + "application/json" ], "produces": [ "application/json" @@ -72,6 +69,7 @@ "in": "body", "name": "message", "description": "Target groups and connection filter.", + "required": true, "schema": { "$ref": "#/definitions/AddToGroupsRequest" } @@ -270,10 +268,7 @@ "summary": "Remove filtered connections from multiple groups.", "operationId": "WebPubSub_RemoveConnectionsFromGroups", "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" + "application/json" ], "produces": [ "application/json" @@ -298,6 +293,7 @@ "in": "body", "name": "message", "description": "Target groups and connection filter.", + "required": true, "schema": { "$ref": "#/definitions/RemoveFromGroupsRequest" } @@ -1722,16 +1718,18 @@ }, "definitions": { "AddToGroupsRequest": { - "description": "The request object containing targets groups and connection filter", + "description": "The request object containing targets groups and a connection filter", "type": "object", "properties": { "groups": { + "description": "A list of groups which target connections will be added into", "type": "array", "items": { "type": "string" } }, "connectionFilter": { + "description": "An OData filter which target connnections satisfy", "type": "string" } } @@ -1787,16 +1785,18 @@ } }, "RemoveFromGroupsRequest": { - "description": "The request object containing targets groups and connection filter", + "description": "The request object containing targets groups and a connection filter", "type": "object", "properties": { "groups": { + "description": "A list of groups which target connections will be removed from", "type": "array", "items": { "type": "string" } }, "connectionFilter": { + "description": "An OData filter which target connnections satisfy", "type": "string" } } From b3fdf036160d255651a2fd510f635fedb3b4aa0c Mon Sep 17 00:00:00 2001 From: xingsy97 <87063252+xingsy97@users.noreply.github.com> Date: Thu, 15 Jun 2023 11:00:27 +0800 Subject: [PATCH 7/9] resolve comments --- .../WebPubSub/stable/2023-07-01/webpubsub.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json index 36a419c21946..9e9adfd3e820 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json @@ -67,7 +67,7 @@ }, { "in": "body", - "name": "message", + "name": "groupsToAdd", "description": "Target groups and connection filter.", "required": true, "schema": { @@ -291,7 +291,7 @@ }, { "in": "body", - "name": "message", + "name": "groupsToRemove", "description": "Target groups and connection filter.", "required": true, "schema": { @@ -384,7 +384,7 @@ { "in": "query", "name": "messageTtlSeconds", - "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", "type": "integer", "format": "int32", "maximum": 300, @@ -589,7 +589,7 @@ { "in": "query", "name": "messageTtlSeconds", - "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", "type": "integer", "format": "int32", "maximum": 300, @@ -888,7 +888,7 @@ { "in": "query", "name": "messageTtlSeconds", - "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", "type": "integer", "format": "int32", "maximum": 300, @@ -1485,7 +1485,7 @@ { "in": "query", "name": "messageTtlSeconds", - "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", + "description": "The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.", "type": "integer", "format": "int32", "maximum": 300, @@ -1728,7 +1728,7 @@ "type": "string" } }, - "connectionFilter": { + "filter": { "description": "An OData filter which target connnections satisfy", "type": "string" } @@ -1795,7 +1795,7 @@ "type": "string" } }, - "connectionFilter": { + "filter": { "description": "An OData filter which target connnections satisfy", "type": "string" } From 669db689d5ec676b350450e62375e84e8c418c4d Mon Sep 17 00:00:00 2001 From: xingsy97 <87063252+xingsy97@users.noreply.github.com> Date: Thu, 15 Jun 2023 16:28:10 +0800 Subject: [PATCH 8/9] resolve failed check --- .../2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json | 3 ++- .../examples/WebPubSub_RemoveConnectionsFromGroups.json | 3 ++- .../data-plane/WebPubSub/stable/2023-07-01/webpubsub.json | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json index 1e46eb54d2cf..54128e90bffc 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json @@ -1,7 +1,8 @@ { "parameters": { "api-version": "2023-07-01", - "hub": "hub1" + "hub": "hub1", + "body": {"groups": ["group1", "group2"], "filter": "startswith(userId, 'listener-')"} }, "responses": { "200": {} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json index 1e46eb54d2cf..54128e90bffc 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json @@ -1,7 +1,8 @@ { "parameters": { "api-version": "2023-07-01", - "hub": "hub1" + "hub": "hub1", + "body": {"groups": ["group1", "group2"], "filter": "startswith(userId, 'listener-')"} }, "responses": { "200": {} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json index 9e9adfd3e820..ff900383ec32 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/webpubsub.json @@ -1729,7 +1729,7 @@ } }, "filter": { - "description": "An OData filter which target connnections satisfy", + "description": "An OData filter which target connections satisfy", "type": "string" } } @@ -1796,7 +1796,7 @@ } }, "filter": { - "description": "An OData filter which target connnections satisfy", + "description": "An OData filter which target connections satisfy", "type": "string" } } From efe2ec0e7099d1815b97bb003b6ad40a935370af Mon Sep 17 00:00:00 2001 From: xingsy97 <87063252+xingsy97@users.noreply.github.com> Date: Thu, 15 Jun 2023 16:59:48 +0800 Subject: [PATCH 9/9] resolve failed check --- .../examples/WebPubSub_AddConnectionsToGroups.json | 8 +++++++- .../examples/WebPubSub_RemoveConnectionsFromGroups.json | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json index 54128e90bffc..df30f8ddc124 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_AddConnectionsToGroups.json @@ -2,7 +2,13 @@ "parameters": { "api-version": "2023-07-01", "hub": "hub1", - "body": {"groups": ["group1", "group2"], "filter": "startswith(userId, 'listener-')"} + "groupsToAdd": { + "groups": [ + "group1", + "group2" + ], + "filter": "startswith(userId, 'listener-')" + } }, "responses": { "200": {} diff --git a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json index 54128e90bffc..907ec74cb9bb 100644 --- a/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json +++ b/specification/webpubsub/data-plane/WebPubSub/stable/2023-07-01/examples/WebPubSub_RemoveConnectionsFromGroups.json @@ -2,7 +2,13 @@ "parameters": { "api-version": "2023-07-01", "hub": "hub1", - "body": {"groups": ["group1", "group2"], "filter": "startswith(userId, 'listener-')"} + "groupsToRemove": { + "groups": [ + "group1", + "group2" + ], + "filter": "startswith(userId, 'listener-')" + } }, "responses": { "200": {}