Skip to content

list_application_revisions async

list_application_revisions(
    application_name: ApplicationName,
    *,
    config_overrides: Optional[AsyncCodeDeployClientConfig] = None,
    sort_by: Optional[ApplicationRevisionSortBy] = None,
    sort_order: Optional[SortOrder] = None,
    s3_bucket: Optional[S3Bucket] = None,
    s3_key_prefix: Optional[S3Key] = None,
    deployed: Optional[ListStateFilterAction] = None,
    next_token: Optional[NextToken] = None,
) -> ListApplicationRevisionsOutput

Lists information about revisions for an application.

Parameters:

  • application_name (ApplicationName) –

    The name of an CodeDeploy application associated with the user or Amazon Web Services account.

  • sort_by (Optional[ApplicationRevisionSortBy], default: None ) –

    The column name to use to sort the list results:

    • registerTime: Sort by the time the revisions were registered with CodeDeploy.

    • firstUsedTime: Sort by the time the revisions were first used in a deployment.

    • lastUsedTime: Sort by the time the revisions were last used in a deployment.

    If not specified or set to null, the results are returned in an arbitrary order.

  • sort_order (Optional[SortOrder], default: None ) –

    The order in which to sort the list results:

    • ascending: ascending order.

    • descending: descending order.

    If not specified, the results are sorted in ascending order.

    If set to null, the results are sorted in an arbitrary order.

  • s3_bucket (Optional[S3Bucket], default: None ) –

    An Amazon S3 bucket name to limit the search for revisions.

    If set to null, all of the user's buckets are searched.

  • s3_key_prefix (Optional[S3Key], default: None ) –

    A key prefix for the set of Amazon S3 objects to limit the search for revisions.

  • deployed (Optional[ListStateFilterAction], default: None ) –

    Whether to list revisions based on whether the revision is the target revision of a deployment group:

    • include: List revisions that are target revisions of a deployment group.

    • exclude: Do not list revisions that are target revisions of a deployment group.

    • ignore: List all revisions.

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

    An identifier returned from the previous ListApplicationRevisions call. It can be used to return the next set of applications in the list.

Raises:

Source code in docs_src/capo_codedeploy/_services/async_code_deploy.py
async def list_application_revisions(
    self,
    application_name: "capo_codedeploy.types.application_name.ApplicationName",
    *,
    config_overrides: Optional[AsyncCodeDeployClientConfig] = None,
    sort_by: Optional[
        "capo_codedeploy.types.application_revision_sort_by.ApplicationRevisionSortBy"
    ] = None,
    sort_order: Optional["capo_codedeploy.types.sort_order.SortOrder"] = None,
    s3_bucket: Optional["capo_codedeploy.types.s3_bucket.S3Bucket"] = None,
    s3_key_prefix: Optional["capo_codedeploy.types.s3_key.S3Key"] = None,
    deployed: Optional[
        "capo_codedeploy.types.list_state_filter_action.ListStateFilterAction"
    ] = None,
    next_token: Optional["capo_codedeploy.types.next_token.NextToken"] = None,
) -> "capo_codedeploy.types.list_application_revisions_output.ListApplicationRevisionsOutput":
    """<p>Lists information about revisions for an application.</p>

    Args:
        application_name: <p> The name of an CodeDeploy application associated with the user or Amazon Web Services account. </p>
        sort_by: <p>The column name to use to sort the list results:</p> <ul> <li> <p> <code>registerTime</code>: Sort by the time the revisions were registered with CodeDeploy.</p> </li> <li> <p> <code>firstUsedTime</code>: Sort by the time the revisions were first used in a deployment.</p> </li> <li> <p> <code>lastUsedTime</code>: Sort by the time the revisions were last used in a deployment.</p> </li> </ul> <p> If not specified or set to null, the results are returned in an arbitrary order. </p>
        sort_order: <p> The order in which to sort the list results: </p> <ul> <li> <p> <code>ascending</code>: ascending order.</p> </li> <li> <p> <code>descending</code>: descending order.</p> </li> </ul> <p>If not specified, the results are sorted in ascending order.</p> <p>If set to null, the results are sorted in an arbitrary order.</p>
        s3_bucket: <p> An Amazon S3 bucket name to limit the search for revisions. </p> <p> If set to null, all of the user's buckets are searched. </p>
        s3_key_prefix: <p> A key prefix for the set of Amazon S3 objects to limit the search for revisions. </p>
        deployed: <p> Whether to list revisions based on whether the revision is the target revision of a deployment group: </p> <ul> <li> <p> <code>include</code>: List revisions that are target revisions of a deployment group.</p> </li> <li> <p> <code>exclude</code>: Do not list revisions that are target revisions of a deployment group.</p> </li> <li> <p> <code>ignore</code>: List all revisions.</p> </li> </ul>
        next_token: <p>An identifier returned from the previous <code>ListApplicationRevisions</code> call. It can be used to return the next set of applications in the list.</p>

    Raises:
        capo_codedeploy.errors.application_does_not_exist_exception.ApplicationDoesNotExistException: <p>The application does not exist with the user or Amazon Web Services account.</p>
        capo_codedeploy.errors.application_name_required_exception.ApplicationNameRequiredException: <p>The minimum number of required application names was not specified.</p>
        capo_codedeploy.errors.bucket_name_filter_required_exception.BucketNameFilterRequiredException: <p>A bucket name is required, but was not provided.</p>
        capo_codedeploy.errors.invalid_application_name_exception.InvalidApplicationNameException: <p>The application name was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_bucket_name_filter_exception.InvalidBucketNameFilterException: <p>The bucket name either doesn't exist or was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_deployed_state_filter_exception.InvalidDeployedStateFilterException: <p>The deployed state filter was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_key_prefix_filter_exception.InvalidKeyPrefixFilterException: <p>The specified key prefix filter was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The next token was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_sort_by_exception.InvalidSortByException: <p>The column name to sort by is either not present or was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_sort_order_exception.InvalidSortOrderException: <p>The sort order was specified in an invalid format.</p>
        capo_codedeploy.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codedeploy.types.list_application_revisions_input.ListApplicationRevisionsInput]",
    ) -> AsyncOperationResponse[
        "capo_codedeploy.types.list_application_revisions_output.ListApplicationRevisionsOutput"
    ]:
        import capo_codedeploy._operations.code_deploy_20141006.list_application_revisions

        (
            output,
            http_response,
        ) = await capo_codedeploy._operations.code_deploy_20141006.list_application_revisions.async_list_application_revisions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListApplicationRevisions")
    )
    input_: capo_codedeploy.types.list_application_revisions_input.ListApplicationRevisionsInput = {
        "application_name": application_name
    }
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if s3_bucket is not None:
        input_["s3_bucket"] = s3_bucket
    if s3_key_prefix is not None:
        input_["s3_key_prefix"] = s3_key_prefix
    if deployed is not None:
        input_["deployed"] = deployed
    if next_token is not None:
        input_["next_token"] = next_token

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