Returns a list of all subscriptions for MQTT clients with active sessions, including offline clients with persistent sessions.
Requires permission to access the ListSubscriptions action.
Parameters:
-
client_id
(ClientId)
–
The unique identifier of the MQTT client to list subscriptions for. 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.
-
next_token
(Optional[NextToken], default:
None
)
–
To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of subscriptions to return in a single request. By default, this is set to 20.
Raises:
Source code in docs_src/capo_iot_data_plane/_services/io_t_data_plane.py
| def list_subscriptions(
self,
client_id: "capo_iot_data_plane.types.client_id.ClientId",
*,
config_overrides: Optional[IoTDataPlaneClientConfig] = None,
next_token: Optional["capo_iot_data_plane.types.next_token.NextToken"] = None,
max_results: Optional[
"capo_iot_data_plane.types.max_results.MaxResults"
] = None,
) -> "capo_iot_data_plane.types.list_subscriptions_response.ListSubscriptionsResponse":
"""<p>Returns a list of all subscriptions for MQTT clients with active sessions, including offline clients with persistent sessions.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">ListSubscriptions</a> action.</p>
Args:
client_id: <p>The unique identifier of the MQTT client to list subscriptions for. The client ID can't start with a dollar sign ($).</p> <p>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.</p>
next_token: <p>To retrieve the next set of results, the <code>nextToken</code> value from a previous response; otherwise <b>null</b> to receive the first set of results.</p>
max_results: <p>The maximum number of subscriptions to return in a single request. By default, this is set to 20.</p>
Raises:
capo_iot_data_plane.errors.forbidden_exception.ForbiddenException: <p>The caller isn't authorized to make the request.</p>
capo_iot_data_plane.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
capo_iot_data_plane.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
capo_iot_data_plane.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_iot_data_plane.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
capo_iot_data_plane.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_iot_data_plane.types.list_subscriptions_request.ListSubscriptionsRequest]",
) -> OperationResponse[
"capo_iot_data_plane.types.list_subscriptions_response.ListSubscriptionsResponse"
]:
import capo_iot_data_plane._operations.iot_moonraker_service.list_subscriptions
output, http_response = (
capo_iot_data_plane._operations.iot_moonraker_service.list_subscriptions.list_subscriptions(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListSubscriptions")
)
input_: capo_iot_data_plane.types.list_subscriptions_request.ListSubscriptionsRequest = {
"client_id": client_id
}
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|