AppConfigData

Client

class AppConfigData.Client

A low-level client representing AWS AppConfig Data

Use the AppConfigData API, a capability of AWS AppConfig, to retrieve deployed configuration.

client = session.create_client('appconfigdata')

These are the available methods:

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
get_latest_configuration(**kwargs)

Retrieves the latest deployed configuration. This API may return empty Configuration data if the client already has the latest version. See StartConfigurationSession to obtain an InitialConfigurationToken to call this API.

Warning

Each call to GetLatestConfiguration returns a new ConfigurationToken (NextPollConfigurationToken in the response). This new token MUST be provided to the next call to GetLatestConfiguration when polling for configuration updates.

To avoid excess charges, we recommend that you include the ClientConfigurationVersion value with every call to GetConfiguration . This value must be saved on your client. Subsequent calls to GetConfiguration must pass this value by using the ClientConfigurationVersion parameter.

See also: AWS API Documentation

Request Syntax

response = client.get_latest_configuration(
    ConfigurationToken='string'
)
Parameters
ConfigurationToken (string) --

[REQUIRED]

Token describing the current state of the configuration session. To obtain a token, first call the StartConfigurationSession API. Note that every call to GetLatestConfiguration will return a new ConfigurationToken (NextPollConfigurationToken in the response) and MUST be provided to subsequent GetLatestConfiguration API calls.

Return type
dict
Returns
Response Syntax
{
    'Configuration': StreamingBody(),
    'ContentType': 'string',
    'NextPollConfigurationToken': 'string',
    'NextPollIntervalInSeconds': 123
}

Response Structure

  • (dict) --

    Response parameters for the GetLatestConfiguration API

    • Configuration (StreamingBody) --

      The data of the configuration. Note that this may be empty if the client already has the latest version of configuration.

    • ContentType (string) --

      A standard MIME type describing the format of the configuration content.

    • NextPollConfigurationToken (string) --

      The latest token describing the current state of the configuration session. This MUST be provided to the next call to GetLatestConfiguration.

    • NextPollIntervalInSeconds (integer) --

      The amount of time the client should wait before polling for configuration updates again. See RequiredMinimumPollIntervalInSeconds to set the desired poll interval.

Exceptions

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
start_configuration_session(**kwargs)

Starts a configuration session used to retrieve a deployed configuration. See the GetLatestConfiguration API for more details.

See also: AWS API Documentation

Request Syntax

response = client.start_configuration_session(
    ApplicationIdentifier='string',
    ConfigurationProfileIdentifier='string',
    EnvironmentIdentifier='string',
    RequiredMinimumPollIntervalInSeconds=123
)
Parameters
  • ApplicationIdentifier (string) --

    [REQUIRED]

    The application ID or the application name.

  • ConfigurationProfileIdentifier (string) --

    [REQUIRED]

    The configuration profile ID or the configuration profile name.

  • EnvironmentIdentifier (string) --

    [REQUIRED]

    The environment ID or the environment name.

  • RequiredMinimumPollIntervalInSeconds (integer) -- The interval at which your client will poll for configuration. If provided, the service will throw a BadRequestException if the client polls before the specified poll interval. By default, client poll intervals are not enforced.
Return type

dict

Returns

Response Syntax

{
    'InitialConfigurationToken': 'string'
}

Response Structure

  • (dict) --

    Response parameters for the StartConfigurationSession API.

    • InitialConfigurationToken (string) --

      Token encapsulating state about the configuration session. Provide this token to the GetLatestConfiguration API to retrieve configuration data.

      Warning

      This token should only be used once in your first call to GetLatestConfiguration. You MUST use the new token in the GetConfiguration response (NextPollConfigurationToken) in each subsequent call to GetLatestConfiguration.

Exceptions

Client Exceptions

Client exceptions are available on a client instance via the exceptions property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.

The available client exceptions are:

class AppConfigData.Client.exceptions.BadRequestException

The input fails to satisfy the constraints specified by the service.

Example

try:
  ...
except client.exceptions.BadRequestException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Details': {
        'InvalidParameters': {
            'string': {
                'Problem': 'Corrupted'|'Expired'|'PollIntervalNotSatisfied'
            }
        }
    },
    'Message': 'string',
    'Reason': 'InvalidParameters',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The input fails to satisfy the constraints specified by the service.

    • Details (dict) --

      Details describing why the request was invalid

      Note

      This is a Tagged Union structure. Only one of the following top level keys will be set: InvalidParameters. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

      'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
      
      • InvalidParameters (dict) --

        Present if the Reason for the bad request was 'InvalidParameters'

        • (string) --

          • (dict) --

            Contains details about an invalid parameter.

            • Problem (string) --

              Detail describing why an individual parameter did not satisfy the constraints specified by the service

    • Message (string) --

    • Reason (string) --

      Code indicating the reason the request was invalid.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class AppConfigData.Client.exceptions.InternalServerException

There was an internal failure in the service.

Example

try:
  ...
except client.exceptions.InternalServerException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    There was an internal failure in the service.

    • Message (string) --
    • Error (dict) -- Normalized access to common exception attributes.
      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class AppConfigData.Client.exceptions.ResourceNotFoundException

The requested resource could not be found.

Example

try:
  ...
except client.exceptions.ResourceNotFoundException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Message': 'string',
    'ReferencedBy': {
        'string': 'string'
    },
    'ResourceType': 'Application'|'ConfigurationProfile'|'Deployment'|'Environment'|'Configuration',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The requested resource could not be found.

    • Message (string) --

    • ReferencedBy (dict) --

      A map indicating which parameters in the request reference the resource that was not found.

      • (string) --
        • (string) --
    • ResourceType (string) --

      The type of resource that was not found.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class AppConfigData.Client.exceptions.ThrottlingException

The request was denied due to request throttling.

Example

try:
  ...
except client.exceptions.ThrottlingException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The request was denied due to request throttling.

    • Message (string) --
    • Error (dict) -- Normalized access to common exception attributes.
      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.

Paginators

The available paginators are: