Skip to content

list_state_machine_versions async

list_state_machine_versions(
    state_machine_arn: Arn,
    *,
    config_overrides: Optional[AsyncSFNClientConfig] = None,
    next_token: Optional[PageToken] = None,
    max_results: Optional[PageSize] = None,
) -> ListStateMachineVersionsOutput

Lists versions for the specified state machine Amazon Resource Name (ARN).

The results are sorted in descending order of the version creation time.

If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

Related operations:

Parameters:

  • state_machine_arn (Arn) –

    The Amazon Resource Name (ARN) of the state machine.

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

    If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

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

    The maximum number of results that are returned per call. You can use nextToken to obtain further pages of results. The default is 100 and the maximum allowed page size is 1000. A value of 0 uses the default.

    This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.

Raises:

  • InvalidArn –

    The provided Amazon Resource Name (ARN) is not valid.

  • InvalidToken –

    The provided token is not valid.

  • ValidationException –

    The input does not satisfy the constraints specified by an Amazon Web Services service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sfn/_services/async_sfn.py
async def list_state_machine_versions(
    self,
    state_machine_arn: "capo_sfn.types.arn.Arn",
    *,
    config_overrides: Optional[AsyncSFNClientConfig] = None,
    next_token: Optional["capo_sfn.types.page_token.PageToken"] = None,
    max_results: Optional["capo_sfn.types.page_size.PageSize"] = None,
) -> "capo_sfn.types.list_state_machine_versions_output.ListStateMachineVersionsOutput":
    """<p>Lists <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html">versions</a> for the specified state machine Amazon Resource Name (ARN).</p> <p>The results are sorted in descending order of the version creation time.</p> <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a>PublishStateMachineVersion</a> </p> </li> <li> <p> <a>DeleteStateMachineVersion</a> </p> </li> </ul>

    Args:
        state_machine_arn: <p>The Amazon Resource Name (ARN) of the state machine.</p>
        next_token: <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</p>
        max_results: <p>The maximum number of results that are returned per call. You can use <code>nextToken</code> to obtain further pages of results. The default is 100 and the maximum allowed page size is 1000. A value of 0 uses the default.</p> <p>This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.</p>

    Raises:
        capo_sfn.errors.invalid_arn.InvalidArn: <p>The provided Amazon Resource Name (ARN) is not valid.</p>
        capo_sfn.errors.invalid_token.InvalidToken: <p>The provided token is not valid.</p>
        capo_sfn.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_sfn.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sfn.types.list_state_machine_versions_input.ListStateMachineVersionsInput]",
    ) -> AsyncOperationResponse[
        "capo_sfn.types.list_state_machine_versions_output.ListStateMachineVersionsOutput"
    ]:
        import capo_sfn._operations.aws_step_functions.list_state_machine_versions

        (
            output,
            http_response,
        ) = await capo_sfn._operations.aws_step_functions.list_state_machine_versions.async_list_state_machine_versions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListStateMachineVersions")
    )
    input_: capo_sfn.types.list_state_machine_versions_input.ListStateMachineVersionsInput = {
        "state_machine_arn": state_machine_arn
    }
    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