Skip to content

list_channels async

list_channels(
    *,
    config_overrides: Optional[AsyncKinesisClientConfig] = None,
    stream_filter: Optional[StreamFilterList] = None,
    max_results: Optional[ListChannelsInputLimit] = None,
    next_token: Optional[NextToken] = None,
) -> ListChannelsOutput

Lists the channels in your account. You can filter the results by source stream. The results are paginated. Use the NextToken value returned in the response to retrieve additional results.

Use this operation to find channels before deleting a stream, or to audit the channels configured in an Amazon Web Services Region.

This operation has a call limit of 5 transactions per second (TPS) for each Amazon Web Services account. Exceeding 5 TPS results in a LimitExceededException.

Parameters:

  • stream_filter (Optional[StreamFilterList], default: None ) –

    Filters the results to channels associated with the specified streams.

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

    The maximum number of channels to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.

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

    The pagination token returned by a previous call. Specify this token to retrieve the next page of results.

Raises:

  • AccessDeniedException –

    Specifies that you do not have the permissions required to perform this operation.

  • ExpiredNextTokenException –

    The pagination token passed to the operation is expired.

  • InvalidArgumentException –

    A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.

  • LimitExceededException –

    The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed.

  • ValidationException –

    The request failed validation. For example, a parameter value is not valid, a combination of parameters is not supported, or the operation is not supported for the stream's capacity mode. The error message describes the specific reason.

  • UnknownServiceError –

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

Source code in docs_src/capo_kinesis/_services/async_kinesis.py
async def list_channels(
    self,
    *,
    config_overrides: Optional[AsyncKinesisClientConfig] = None,
    stream_filter: Optional[
        "capo_kinesis.types.stream_filter_list.StreamFilterList"
    ] = None,
    max_results: Optional[
        "capo_kinesis.types.list_channels_input_limit.ListChannelsInputLimit"
    ] = None,
    next_token: Optional["capo_kinesis.types.next_token.NextToken"] = None,
) -> "capo_kinesis.types.list_channels_output.ListChannelsOutput":
    """<p>Lists the channels in your account. You can filter the results by source stream. The results are paginated. Use the <code>NextToken</code> value returned in the response to retrieve additional results.</p> <p>Use this operation to find channels before deleting a stream, or to audit the channels configured in an Amazon Web Services Region.</p> <p>This operation has a call limit of 5 transactions per second (TPS) for each Amazon Web Services account. Exceeding 5 TPS results in a <code>LimitExceededException</code>.</p>

    Args:
        stream_filter: <p>Filters the results to channels associated with the specified streams.</p>
        max_results: <p>The maximum number of channels to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.</p>
        next_token: <p>The pagination token returned by a previous call. Specify this token to retrieve the next page of results.</p>

    Raises:
        capo_kinesis.errors.access_denied_exception.AccessDeniedException: <p>Specifies that you do not have the permissions required to perform this operation.</p>
        capo_kinesis.errors.expired_next_token_exception.ExpiredNextTokenException: <p>The pagination token passed to the operation is expired.</p>
        capo_kinesis.errors.invalid_argument_exception.InvalidArgumentException: <p>A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.</p>
        capo_kinesis.errors.limit_exceeded_exception.LimitExceededException: <p>The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed. </p>
        capo_kinesis.errors.validation_exception.ValidationException: <p>The request failed validation. For example, a parameter value is not valid, a combination of parameters is not supported, or the operation is not supported for the stream's capacity mode. The error message describes the specific reason.</p>
        capo_kinesis.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kinesis.types.list_channels_input.ListChannelsInput]",
    ) -> AsyncOperationResponse[
        "capo_kinesis.types.list_channels_output.ListChannelsOutput"
    ]:
        import capo_kinesis._operations.kinesis_20131202.list_channels

        (
            output,
            http_response,
        ) = await capo_kinesis._operations.kinesis_20131202.list_channels.async_list_channels(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListChannels")
    )
    input_: capo_kinesis.types.list_channels_input.ListChannelsInput = {}
    if stream_filter is not None:
        input_["stream_filter"] = stream_filter
    if max_results is not None:
        input_["max_results"] = max_results
    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