CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see CloudTrail Lake availability change.
Lists the channels in the current account, and their source names.
Parameters:
-
max_results
(Optional[ListChannelsMaxResultsCount], default:
None
)
–
The maximum number of CloudTrail channels to display on a single page.
-
next_token
(Optional[PaginationToken], default:
None
)
–
The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.
Raises:
Source code in docs_src/capo_cloudtrail/_services/cloud_trail.py
| def list_channels(
self,
*,
config_overrides: Optional[CloudTrailClientConfig] = None,
max_results: Optional[
"capo_cloudtrail.types.list_channels_max_results_count.ListChannelsMaxResultsCount"
] = None,
next_token: Optional[
"capo_cloudtrail.types.pagination_token.PaginationToken"
] = None,
) -> "capo_cloudtrail.types.list_channels_response.ListChannelsResponse":
"""<important> <p>CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-service-availability-change.html">CloudTrail Lake availability change</a>.</p> </important> <p> Lists the channels in the current account, and their source names. </p>
Args:
max_results: <p> The maximum number of CloudTrail channels to display on a single page. </p>
next_token: <p>The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.</p>
Raises:
capo_cloudtrail.errors.invalid_next_token_exception.InvalidNextTokenException: <p>A token that is not valid, or a token that was previously used in a request with different parameters. This exception is thrown if the token is not valid.</p>
capo_cloudtrail.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>This exception is thrown when the requested operation is not permitted.</p>
capo_cloudtrail.errors.unsupported_operation_exception.UnsupportedOperationException: <p>This exception is thrown when the requested operation is not supported.</p>
capo_cloudtrail.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudtrail.types.list_channels_request.ListChannelsRequest]",
) -> OperationResponse[
"capo_cloudtrail.types.list_channels_response.ListChannelsResponse"
]:
import capo_cloudtrail._operations.cloud_trail_20131101.list_channels
output, http_response = (
capo_cloudtrail._operations.cloud_trail_20131101.list_channels.list_channels(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListChannels")
)
input_: capo_cloudtrail.types.list_channels_request.ListChannelsRequest = {}
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|