Table of Contents
AppConfigData.Client¶A low-level client representing AWS AppConfig Data
AppConfig Data provides the data plane APIs your application uses to retrieve configuration data. Here's how it works:
Your application retrieves configuration data by first establishing a configuration session using the AppConfig Data StartConfigurationSession API action. Your session's client then makes periodic calls to GetLatestConfiguration to check for and retrieve the latest data available.
When calling StartConfigurationSession , your code sends the following information:
GetLatestConfiguration .In response, AppConfig provides an InitialConfigurationToken to be given to the session's client and used the first time it calls GetLatestConfiguration for that session.
When calling GetLatestConfiguration , your client code sends the most recent ConfigurationToken value it has and receives in response:
NextPollConfigurationToken : the ConfigurationToken value to use on the next call to GetLatestConfiguration .NextPollIntervalInSeconds : the duration the client should wait before making its next call to GetLatestConfiguration . This duration may vary over the course of the session, so it should be used instead of the value sent on the StartConfigurationSession call.For more information and to view example CLI commands that show how to retrieve a configuration using the AppConfig Data StartConfigurationSession and GetLatestConfiguration API actions, see Receiving the configuration in the AppConfig User Guide .
client = session.create_client('appconfigdata')
These are the available methods:
can_paginate()close()get_latest_configuration()get_paginator()get_waiter()start_configuration_session()can_paginate(operation_name)¶Check if an operation can be paginated.
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").True if the operation can be paginated,
False otherwise.close()¶Closes underlying endpoint connections.
get_latest_configuration(**kwargs)¶Retrieves the latest deployed configuration. This API may return empty configuration data if the client already has the latest version. For more information about this API action and to view example CLI commands that show how to use it with the StartConfigurationSession API action, see Receiving the configuration in the AppConfig User Guide .
Warning
Note the following important information.
GetLatestConfiguration . The GetLatestConfiguration response includes a NextPollConfigurationToken that should always replace the token used for the just-completed call in preparation for the next one.GetLatestConfiguration is a priced call. For more information, see Pricing.See also: AWS API Documentation
Request Syntax
response = client.get_latest_configuration(
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.
{
'NextPollConfigurationToken': 'string',
'NextPollIntervalInSeconds': 123,
'ContentType': 'string',
'Configuration': StreamingBody()
}
Response Structure
The latest token describing the current state of the configuration session. This MUST be provided to the next call to GetLatestConfiguration.
The amount of time the client should wait before polling for configuration updates again. Use RequiredMinimumPollIntervalInSeconds to set the desired poll interval.
A standard MIME type describing the format of the configuration content.
StreamingBody) --The data of the configuration. This may be empty if the client already has the latest version of configuration.
Exceptions
get_paginator(operation_name)¶Create a paginator for an operation.
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").client.can_paginate method to
check if an operation is pageable.get_waiter(waiter_name)¶Returns an object that can wait for some condition.
start_configuration_session(**kwargs)¶Starts a configuration session used to retrieve a deployed configuration. For more information about this API action and to view example CLI commands that show how to use it with the GetLatestConfiguration API action, see Receiving the configuration in the AppConfig User Guide .
See also: AWS API Documentation
Request Syntax
response = client.start_configuration_session(
ApplicationIdentifier='string',
EnvironmentIdentifier='string',
ConfigurationProfileIdentifier='string',
RequiredMinimumPollIntervalInSeconds=123
)
[REQUIRED]
The application ID or the application name.
[REQUIRED]
The environment ID or the environment name.
[REQUIRED]
The configuration profile ID or the configuration profile name.
dict
Response Syntax
{
'InitialConfigurationToken': 'string'
}
Response Structure
(dict) --
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 GetLatestConfiguration response (NextPollConfigurationToken ) in each subsequent call to GetLatestConfiguration .
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:
AppConfigData.Client.exceptions.BadRequestExceptionAppConfigData.Client.exceptions.InternalServerExceptionAppConfigData.Client.exceptions.ResourceNotFoundExceptionAppConfigData.Client.exceptions.ThrottlingExceptionAppConfigData.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
{
'Message': 'string',
'Reason': 'InvalidParameters',
'Details': {
'InvalidParameters': {
'string': {
'Problem': 'Corrupted'|'Expired'|'PollIntervalNotSatisfied'
}
}
},
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
The input fails to satisfy the constraints specified by the service.
Message (string) --
Reason (string) --
Code indicating the reason the request was invalid.
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) --
One or more specified parameters are not valid for the call.
(string) --
(dict) --
Information about an invalid parameter.
Problem (string) --
The reason the parameter is invalid.
Error (dict) -- Normalized access to common exception attributes.
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.
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',
'ResourceType': 'Application'|'ConfigurationProfile'|'Deployment'|'Environment'|'Configuration',
'ReferencedBy': {
'string': 'string'
},
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
The requested resource could not be found.
Message (string) --
ResourceType (string) --
The type of resource that was not found.
ReferencedBy (dict) --
A map indicating which parameters in the request reference the resource that was not found.
Error (dict) -- Normalized access to common exception attributes.
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.
The available paginators are: