Skip to content

list_rotations async

list_rotations(
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    rotation_name_prefix: Optional[RotationName] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListRotationsResult

Retrieves a list of on-call rotations.

Parameters:

  • rotation_name_prefix (Optional[RotationName], default: None ) –

    A filter to include rotations in list results based on their common prefix. For example, entering prod returns a list of all rotation names that begin with prod, such as production and prod-1.

  • next_token (Optional[PaginationToken], default: None ) –

    A token to start the list. Use this token to get the next set of results.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Raises:

Source code in docs_src/capo_ssm_contacts/_services/async_ssm_contacts.py
async def list_rotations(
    self,
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    rotation_name_prefix: Optional[
        "capo_ssm_contacts.types.rotation_name.RotationName"
    ] = None,
    next_token: Optional[
        "capo_ssm_contacts.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional["capo_ssm_contacts.types.max_results.MaxResults"] = None,
) -> "capo_ssm_contacts.types.list_rotations_result.ListRotationsResult":
    """<p>Retrieves a list of on-call rotations.</p>

    Args:
        rotation_name_prefix: <p>A filter to include rotations in list results based on their common prefix. For example, entering prod returns a list of all rotation names that begin with <code>prod</code>, such as <code>production</code> and <code>prod-1</code>.</p>
        next_token: <p>A token to start the list. Use this token to get the next set of results.</p>
        max_results: <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>

    Raises:
        capo_ssm_contacts.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation.</p>
        capo_ssm_contacts.errors.internal_server_exception.InternalServerException: <p>Unexpected error occurred while processing the request.</p>
        capo_ssm_contacts.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource that doesn't exist.</p>
        capo_ssm_contacts.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_ssm_contacts.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ssm_contacts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm_contacts.types.list_rotations_request.ListRotationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm_contacts.types.list_rotations_result.ListRotationsResult"
    ]:
        import capo_ssm_contacts._operations.ssm_contacts.list_rotations

        (
            output,
            http_response,
        ) = await capo_ssm_contacts._operations.ssm_contacts.list_rotations.async_list_rotations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRotations")
    )
    input_: capo_ssm_contacts.types.list_rotations_request.ListRotationsRequest = {}
    if rotation_name_prefix is not None:
        input_["rotation_name_prefix"] = rotation_name_prefix
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output