IoTDataPlane / Client / delete_connection
delete_connection¶
- IoTDataPlane.Client.delete_connection(**kwargs)¶
Disconnects a connected MQTT client from Amazon Web Services IoT Core. When you disconnect a client, Amazon Web Services IoT Core closes the client’s network connection and optionally cleans the session state.
Requires permission to access the DeleteConnection action.
See also: AWS API Documentation
Request Syntax
response = client.delete_connection( clientId='string', cleanSession=True|False, preventWillMessage=True|False )
- Parameters:
clientId (string) –
[REQUIRED]
The unique identifier of the MQTT client to disconnect. The client ID can’t start with a dollar sign ($).
MQTT client IDs must be URL encoded (percent-encoded) when they contain characters that are not valid in HTTP requests, such as spaces, forward slashes (/), and UTF-8 characters.
cleanSession (boolean) – Specifies whether to remove the client’s persistent session state when disconnecting. Set to
TRUEto delete all session information, including subscriptions and queued messages. Set toFALSEto preserve the session state for persistent sessions. For clean sessions this parameter will be ignored. By default, this is set toFALSE(preserves the session state).preventWillMessage (boolean) – Controls if Amazon Web Services IoT Core publishes the client’s Last Will and Testament (LWT) message upon disconnection. Set to
TRUEto prevent publishing the LWT message. Set toFALSEto ensure that LWT is published. By default, this is set toFALSE(LWT message is published).
- Returns:
None
Exceptions
IoTDataPlane.Client.exceptions.ForbiddenExceptionIoTDataPlane.Client.exceptions.ResourceNotFoundExceptionIoTDataPlane.Client.exceptions.InvalidRequestExceptionIoTDataPlane.Client.exceptions.ThrottlingExceptionIoTDataPlane.Client.exceptions.InternalFailureException