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:
Identifiers (ID or name) of an AppConfig application, environment, and configuration profile that the session tracks.
(Optional) The minimum amount of time the session’s client must wait between calls to 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.
The configuration: the latest data intended for the session. This may be empty if the client already has the latest version of the configuration.
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:
Check if an operation can be paginated.
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")
.
True
if the operation can be paginated,
False
otherwise.
Closes underlying endpoint connections.
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.
Each configuration token is only valid for one call to 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'
)
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.
dict
Response Syntax
{
'NextPollConfigurationToken': 'string',
'NextPollIntervalInSeconds': 123,
'ContentType': 'string',
'Configuration': StreamingBody()
}
Response Structure
(dict) –
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. Use RequiredMinimumPollIntervalInSeconds
to set the desired poll interval.
ContentType (string) –
A standard MIME type describing the format of the configuration content.
Configuration (StreamingBody
) –
The data of the configuration. This may be empty if the client already has the latest version of configuration.
Exceptions
Create a paginator for an operation.
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")
.
OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate
method to
check if an operation is pageable.
L{botocore.paginate.Paginator}
A paginator object.
Returns an object that can wait for some condition.
waiter_name (str) – The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
The specified waiter object.
botocore.waiter.Waiter
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
)
ApplicationIdentifier (string) –
[REQUIRED]
The application ID or the application name.
EnvironmentIdentifier (string) –
[REQUIRED]
The environment ID or the environment name.
ConfigurationProfileIdentifier (string) –
[REQUIRED]
The configuration profile ID or the configuration profile name.
RequiredMinimumPollIntervalInSeconds (integer) – Sets a constraint on a session. If you specify a value of, for example, 60 seconds, then the client that established the session can’t call GetLatestConfiguration more frequently then every 60 seconds.
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:
The input fails to satisfy the constraints specified by the service.
Example
try:
...
except client.exceptions.BadRequestException as e:
print(e.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.
Code (string) – An identifier specifying the exception type.
Message (string) – A descriptive message explaining why the exception occured.
There was an internal failure in the service.
Example
try:
...
except client.exceptions.InternalServerException as e:
print(e.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.
The requested resource could not be found.
Example
try:
...
except client.exceptions.ResourceNotFoundException as e:
print(e.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.
(string) –
(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.
The request was denied due to request throttling.
Example
try:
...
except client.exceptions.ThrottlingException as e:
print(e.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.
The available paginators are: