CloudTrail / Client / list_trails

list_trails#

CloudTrail.Client.list_trails(**kwargs)#

Lists trails that are in the current account.

See also: AWS API Documentation

Request Syntax

response = client.list_trails(
    NextToken='string'
)
Parameters:

NextToken (string) – 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.

Return type:

dict

Returns:

Response Syntax

{
    'Trails': [
        {
            'TrailARN': 'string',
            'Name': 'string',
            'HomeRegion': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Trails (list) –

      Returns the name, ARN, and home Region of trails in the current account.

      • (dict) –

        Information about a CloudTrail trail, including the trail’s name, home Region, and Amazon Resource Name (ARN).

        • TrailARN (string) –

          The ARN of a trail.

        • Name (string) –

          The name of a trail.

        • HomeRegion (string) –

          The Amazon Web Services Region in which a trail was created.

    • NextToken (string) –

      The token to use to get the next page of results after a previous API call. If the token does not appear, there are no more results to return. The token must be passed in with the same parameters as the previous 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.

Exceptions