AppConfig / Client / list_environments

list_environments#

AppConfig.Client.list_environments(**kwargs)#

Lists the environments for an application.

See also: AWS API Documentation

Request Syntax

response = client.list_environments(
    ApplicationId='string',
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • ApplicationId (string) –

    [REQUIRED]

    The application ID.

  • MaxResults (integer) – The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

  • NextToken (string) – A token to start the list. Use this token to get the next set of results.

Return type:

dict

Returns:

Response Syntax

{
    'Items': [
        {
            'ApplicationId': 'string',
            'Id': 'string',
            'Name': 'string',
            'Description': 'string',
            'State': 'READY_FOR_DEPLOYMENT'|'DEPLOYING'|'ROLLING_BACK'|'ROLLED_BACK'|'REVERTED',
            'Monitors': [
                {
                    'AlarmArn': 'string',
                    'AlarmRoleArn': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Items (list) –

      The elements from this collection.

      • (dict) –

        • ApplicationId (string) –

          The application ID.

        • Id (string) –

          The environment ID.

        • Name (string) –

          The name of the environment.

        • Description (string) –

          The description of the environment.

        • State (string) –

          The state of the environment. An environment can be in one of the following states: READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK, or ROLLED_BACK

        • Monitors (list) –

          Amazon CloudWatch alarms monitored during the deployment.

          • (dict) –

            Amazon CloudWatch alarms to monitor during the deployment process.

            • AlarmArn (string) –

              Amazon Resource Name (ARN) of the Amazon CloudWatch alarm.

            • AlarmRoleArn (string) –

              ARN of an Identity and Access Management (IAM) role for AppConfig to monitor AlarmArn.

    • NextToken (string) –

      The token for the next set of items to return. Use this token to get the next set of results.

Exceptions

  • AppConfig.Client.exceptions.ResourceNotFoundException

  • AppConfig.Client.exceptions.InternalServerException

  • AppConfig.Client.exceptions.BadRequestException

Examples

The following list-environments example lists the available environments in your AWS account for the specified application.

response = client.list_environments(
    ApplicationId='339ohji',
)

print(response)

Expected Output:

{
    'Items': [
        {
            'ApplicationId': '339ohji',
            'Id': '54j1r29',
            'Name': 'Example-Environment',
            'State': 'READY_FOR_DEPLOYMENT',
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}