Skip to content

list_archives async

list_archives(
    *,
    config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = None,
    name_prefix: Optional[ArchiveName] = None,
    event_source_arn: Optional[Arn] = None,
    state: Optional[ArchiveState] = None,
    next_token: Optional[NextToken] = None,
    limit: Optional[LimitMax100] = None,
) -> ListArchivesResponse

Lists your archives. You can either list all the archives or you can provide a prefix to match to the archive names. Filter parameters are exclusive.

Parameters:

  • name_prefix (Optional[ArchiveName], default: None ) –

    A name prefix to filter the archives returned. Only archives with name that match the prefix are returned.

  • event_source_arn (Optional[Arn], default: None ) –

    The ARN of the event source associated with the archive.

  • state (Optional[ArchiveState], default: None ) –

    The state of the archive.

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

    The token returned by a previous call to retrieve the next set of results.

  • limit (Optional[LimitMax100], default: None ) –

    The maximum number of results to return.

Raises:

Source code in docs_src/capo_cloudwatch_events/_services/async_cloud_watch_events.py
async def list_archives(
    self,
    *,
    config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = None,
    name_prefix: Optional[
        "capo_cloudwatch_events.types.archive_name.ArchiveName"
    ] = None,
    event_source_arn: Optional["capo_cloudwatch_events.types.arn.Arn"] = None,
    state: Optional[
        "capo_cloudwatch_events.types.archive_state.ArchiveState"
    ] = None,
    next_token: Optional[
        "capo_cloudwatch_events.types.next_token.NextToken"
    ] = None,
    limit: Optional["capo_cloudwatch_events.types.limit_max100.LimitMax100"] = None,
) -> "capo_cloudwatch_events.types.list_archives_response.ListArchivesResponse":
    """<p>Lists your archives. You can either list all the archives or you can provide a prefix to match to the archive names. Filter parameters are exclusive.</p>

    Args:
        name_prefix: <p>A name prefix to filter the archives returned. Only archives with name that match the prefix are returned.</p>
        event_source_arn: <p>The ARN of the event source associated with the archive.</p>
        state: <p>The state of the archive.</p>
        next_token: <p>The token returned by a previous call to retrieve the next set of results.</p>
        limit: <p>The maximum number of results to return.</p>

    Raises:
        capo_cloudwatch_events.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_cloudwatch_events.errors.resource_not_found_exception.ResourceNotFoundException: <p>An entity that you specified does not exist.</p>
        capo_cloudwatch_events.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_events.types.list_archives_request.ListArchivesRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_events.types.list_archives_response.ListArchivesResponse"
    ]:
        import capo_cloudwatch_events._operations.aws_events.list_archives

        (
            output,
            http_response,
        ) = await capo_cloudwatch_events._operations.aws_events.list_archives.async_list_archives(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListArchives")
    )
    input_: capo_cloudwatch_events.types.list_archives_request.ListArchivesRequest = {}
    if name_prefix is not None:
        input_["name_prefix"] = name_prefix
    if event_source_arn is not None:
        input_["event_source_arn"] = event_source_arn
    if state is not None:
        input_["state"] = state
    if next_token is not None:
        input_["next_token"] = next_token
    if limit is not None:
        input_["limit"] = limit

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