ComputeOptimizerAutomation / Client / list_accounts

list_accounts

ComputeOptimizerAutomation.Client.list_accounts(**kwargs)

Lists the accounts in your organization that are enrolled in Compute Optimizer and whether they have enabled Automation.

Note

Only the management account or a delegated administrator can perform this action.

See also: AWS API Documentation

Request Syntax

response = client.list_accounts(
    maxResults=123,
    nextToken='string'
)
Parameters:
  • maxResults (integer) – The maximum number of results to return in a single call.

  • nextToken (string) – The token for the next page of results.

Return type:

dict

Returns:

Response Syntax

{
    'accounts': [
        {
            'accountId': 'string',
            'status': 'Active'|'Inactive'|'Pending'|'Failed',
            'organizationRuleMode': 'AnyAllowed'|'NoneAllowed',
            'statusReason': 'string',
            'lastUpdatedTimestamp': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • accounts (list) –

      The list of accounts in your organization enrolled in Compute Optimizer

      • (dict) –

        Contains information about an Amazon Web Services account’s enrollment and association status with Compute Optimizer Automation.

        • accountId (string) –

          The ID of the Amazon Web Services account.

        • status (string) –

          The enrollment status of the account: Active, Inactive, Pending, or Failed.

        • organizationRuleMode (string) –

          Specifies whether the management account can create Automation rules that implement optimization actions for this account.

        • statusReason (string) –

          The reason for the current Automation enrollment status.

        • lastUpdatedTimestamp (datetime) –

          The timestamp when the account’s Automation enrollment status was last updated.

    • nextToken (string) –

      The token to use to retrieve the next page of results.

Exceptions

  • ComputeOptimizerAutomation.Client.exceptions.InvalidParameterValueException

  • ComputeOptimizerAutomation.Client.exceptions.ForbiddenException

  • ComputeOptimizerAutomation.Client.exceptions.OptInRequiredException

  • ComputeOptimizerAutomation.Client.exceptions.ThrottlingException

  • ComputeOptimizerAutomation.Client.exceptions.AccessDeniedException

  • ComputeOptimizerAutomation.Client.exceptions.InternalServerException

  • ComputeOptimizerAutomation.Client.exceptions.NotManagementAccountException

  • ComputeOptimizerAutomation.Client.exceptions.ServiceUnavailableException