azure.messaging.webpubsubservice.operations package¶
-
class
azure.messaging.webpubsubservice.operations.
WebPubSubServiceClientOperationsMixin
[source]¶ -
add_connection_to_group
(hub: str, group: str, connection_id: str, **kwargs: Any) → None[source]¶ Add a connection to the target group.
Add a connection to the target group.
- Parameters
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
add_user_to_group
(hub: str, group: str, user_id: str, **kwargs: Any) → None[source]¶ Add a user to the target group.
Add a user to the target group.
- Parameters
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
check_permission
(hub: str, permission: str, connection_id: str, **kwargs: Any) → None[source]¶ Check if a connection has permission to the specified action.
Check if a connection has permission to the specified action.
- Parameters
hub (str) – Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.
permission (str) – The permission: current supported actions are joinLeaveGroup and sendToGroup. Possible values are: “sendToGroup” or “joinLeaveGroup”.
connection_id (str) – Target connection Id.
- Keyword Arguments
target_name (str) – The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
close_all_connections
(hub: str, **kwargs: Any) → None[source]¶ Close the connections in the hub.
Close the connections in the hub.
- Parameters
hub (str) – Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.
- Keyword Arguments
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
close_connection
(hub: str, connection_id: str, **kwargs: Any) → None[source]¶ Close the client connection.
Close the client connection.
- Parameters
- Keyword Arguments
reason (str) – The reason closing the client connection.
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
close_group_connections
(hub: str, group: str, **kwargs: Any) → None[source]¶ Close connections in the specific group.
Close connections in the specific group.
- Parameters
- Keyword Arguments
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
close_user_connections
(hub: str, user_id: str, **kwargs: Any) → None[source]¶ Close connections for the specific user.
Close connections for the specific user.
- Parameters
- Keyword Arguments
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
connection_exists
(hub: str, connection_id: str, **kwargs: Any) → None[source]¶ Check if the connection with the given connectionId exists.
Check if the connection with the given connectionId exists.
-
generate_client_token
(hub: str, **kwargs: Any) → Any[source]¶ Generate token for the client to connect Azure Web PubSub service.
Generate token for the client to connect Azure Web PubSub service.
- Parameters
hub (str) – Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.
- Keyword Arguments
- Returns
JSON object
- Return type
Any
- Raises
~azure.core.exceptions.HttpResponseError
Example
# response body for status code(s): 200 response.json() == { "token": "str" # Optional. The token value for the WebSocket client to connect to the service. }
-
grant_permission
(hub: str, permission: str, connection_id: str, **kwargs: Any) → None[source]¶ Grant permission to the connection.
Grant permission to the connection.
- Parameters
hub (str) – Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.
permission (str) – The permission: current supported actions are joinLeaveGroup and sendToGroup. Possible values are: “sendToGroup” or “joinLeaveGroup”.
connection_id (str) – Target connection Id.
- Keyword Arguments
target_name (str) – The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
group_exists
(hub: str, group: str, **kwargs: Any) → None[source]¶ Check if there are any client connections inside the given group.
Check if there are any client connections inside the given group.
- Parameters
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
remove_connection_from_group
(hub: str, group: str, connection_id: str, **kwargs: Any) → None[source]¶ Remove a connection from the target group.
Remove a connection from the target group.
- Parameters
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
remove_user_from_all_groups
(hub: str, user_id: str, **kwargs: Any) → None[source]¶ Remove a user from all groups.
Remove a user from all groups.
-
remove_user_from_group
(hub: str, group: str, user_id: str, **kwargs: Any) → None[source]¶ Remove a user from the target group.
Remove a user from the target group.
- Parameters
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
revoke_permission
(hub: str, permission: str, connection_id: str, **kwargs: Any) → None[source]¶ Revoke permission for the connection.
Revoke permission for the connection.
- Parameters
hub (str) – Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.
permission (str) – The permission: current supported actions are joinLeaveGroup and sendToGroup. Possible values are: “sendToGroup” or “joinLeaveGroup”.
connection_id (str) – Target connection Id.
- Keyword Arguments
target_name (str) – The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name.
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
send_to_all
(hub: str, message: Union[IO, str], **kwargs: Any) → None[source]¶ Broadcast content inside request body to all the connected client connections.
Broadcast content inside request body to all the connected client connections.
- Parameters
- Keyword Arguments
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
send_to_connection
(hub: str, connection_id: str, message: Union[IO, str], **kwargs: Any) → None[source]¶ Send content inside request body to the specific connection.
Send content inside request body to the specific connection.
- Parameters
- Keyword Arguments
content_type (str) – Media type of the body sent to the API. Default value is “application/json”. Allowed values are: “application/json”, “application/octet-stream”, “text/plain.”
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
send_to_group
(hub: str, group: str, message: Union[IO, str], **kwargs: Any) → None[source]¶ Send content inside request body to a group of connections.
Send content inside request body to a group of connections.
- Parameters
- Keyword Arguments
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-
send_to_user
(hub: str, user_id: str, message: Union[IO, str], **kwargs: Any) → None[source]¶ Send content inside request body to the specific user.
Send content inside request body to the specific user.
- Parameters
- Keyword Arguments
content_type (str) – Media type of the body sent to the API. Default value is “application/json”. Allowed values are: “application/json”, “application/octet-stream”, “text/plain.”
- Returns
None
- Return type
- Raises
~azure.core.exceptions.HttpResponseError
-