AWS AppConfig Data 2021-11-11
- Client: Aws\AppConfigData\AppConfigDataClient
- Service ID: appconfigdata
- Version: 2021-11-11
This page describes the parameters and results for the operations of the AWS AppConfig Data (2021-11-11), and shows how to use the Aws\AppConfigData\AppConfigDataClient object to call the described operations. This documentation is specific to the 2021-11-11 API version of the service.
Service Description
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.
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.
When calling GetLatestConfiguration, your client code sends the most recent ConfigurationToken value it has and receives in response:
-
NextPollConfigurationToken: theConfigurationTokenvalue to use on the next call toGetLatestConfiguration. -
NextPollIntervalInSeconds: the duration the client should wait before making its next call toGetLatestConfiguration. This duration may vary over the course of the session, so it should be used instead of the value sent on theStartConfigurationSessioncall. -
The configuration: the latest data intended for the session. This may be empty if the client already has the latest version of the configuration.
The InitialConfigurationToken and NextPollConfigurationToken should only be used once. To support long poll use cases, the tokens are valid for up to 24 hours. If a GetLatestConfiguration call uses an expired token, the system returns BadRequestException.
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 Retrieving the configuration in the AppConfig User Guide.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName'), where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */).
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */).
- GetLatestConfiguration ( array $params = [] )
- Retrieves the latest deployed configuration.
- StartConfigurationSession ( array $params = [] )
- Starts a configuration session used to retrieve a deployed configuration.
Operations
GetLatestConfiguration
$result = $client->getLatestConfiguration([/* ... */]); $promise = $client->getLatestConfigurationAsync([/* ... */]);
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 Retrieving the configuration in the AppConfig User Guide.
Note the following important information.
-
Each configuration token is only valid for one call to
GetLatestConfiguration. TheGetLatestConfigurationresponse includes aNextPollConfigurationTokenthat should always replace the token used for the just-completed call in preparation for the next one. -
GetLatestConfigurationis a priced call. For more information, see Pricing.
Parameter Syntax
$result = $client->getLatestConfiguration([
'ConfigurationToken' => '<string>', // REQUIRED
]);
Parameter Details
Members
- ConfigurationToken
-
- Required: Yes
- Type: string
Token describing the current state of the configuration session. To obtain a token, first call the StartConfigurationSession API. Note that every call to
GetLatestConfigurationwill return a newConfigurationToken(NextPollConfigurationTokenin the response) and must be provided to subsequentGetLatestConfigurationAPI calls.This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a
GetLatestConfigurationcall uses an expired token, the system returnsBadRequestException.
Result Syntax
[
'Configuration' => <string || resource || Psr\Http\Message\StreamInterface>,
'ContentType' => '<string>',
'NextPollConfigurationToken' => '<string>',
'NextPollIntervalInSeconds' => <integer>,
'VersionLabel' => '<string>',
]
Result Details
Members
- Configuration
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The data of the configuration. This may be empty if the client already has the latest version of configuration.
- ContentType
-
- Type: string
A standard MIME type describing the format of the configuration content.
- NextPollConfigurationToken
-
- Type: string
The latest token describing the current state of the configuration session. This must be provided to the next call to
GetLatestConfiguration.This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a
GetLatestConfigurationcall uses an expired token, the system returnsBadRequestException. - NextPollIntervalInSeconds
-
- Type: int
The amount of time the client should wait before polling for configuration updates again. Use
RequiredMinimumPollIntervalInSecondsto set the desired poll interval. - VersionLabel
-
- Type: string
The user-defined label for the AppConfig hosted configuration version. This attribute doesn't apply if the configuration is not from an AppConfig hosted configuration version. If the client already has the latest version of the configuration data, this value is empty.
Errors
- ThrottlingException:
The request was denied due to request throttling.
- ResourceNotFoundException:
The requested resource could not be found.
- BadRequestException:
The input fails to satisfy the constraints specified by the service.
- InternalServerException:
There was an internal failure in the service.
StartConfigurationSession
$result = $client->startConfigurationSession([/* ... */]); $promise = $client->startConfigurationSessionAsync([/* ... */]);
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 Retrieving the configuration in the AppConfig User Guide.
Parameter Syntax
$result = $client->startConfigurationSession([
'ApplicationIdentifier' => '<string>', // REQUIRED
'ConfigurationProfileIdentifier' => '<string>', // REQUIRED
'EnvironmentIdentifier' => '<string>', // REQUIRED
'RequiredMinimumPollIntervalInSeconds' => <integer>,
]);
Parameter Details
Members
- ApplicationIdentifier
-
- Required: Yes
- Type: string
The application ID or the application name.
- ConfigurationProfileIdentifier
-
- Required: Yes
- Type: string
The configuration profile ID or the configuration profile name.
- EnvironmentIdentifier
-
- Required: Yes
- Type: string
The environment ID or the environment name.
- RequiredMinimumPollIntervalInSeconds
-
- Type: int
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 than every 60 seconds.
Result Syntax
[
'InitialConfigurationToken' => '<string>',
]
Result Details
Members
- InitialConfigurationToken
-
- Type: string
Token encapsulating state about the configuration session. Provide this token to the
GetLatestConfigurationAPI to retrieve configuration data.This token should only be used once in your first call to
GetLatestConfiguration. You must use the new token in theGetLatestConfigurationresponse (NextPollConfigurationToken) in each subsequent call toGetLatestConfiguration.The
InitialConfigurationTokenandNextPollConfigurationTokenshould only be used once. To support long poll use cases, the tokens are valid for up to 24 hours. If aGetLatestConfigurationcall uses an expired token, the system returnsBadRequestException.
Errors
- ThrottlingException:
The request was denied due to request throttling.
- ResourceNotFoundException:
The requested resource could not be found.
- BadRequestException:
The input fails to satisfy the constraints specified by the service.
- InternalServerException:
There was an internal failure in the service.
Shapes
BadRequestDetails
Description
Detailed information about the input that failed to satisfy the constraints specified by a call.
Members
- InvalidParameters
-
- Type: Associative array of custom strings keys (String) to InvalidParameterDetail structures
One or more specified parameters are not valid for the call.
BadRequestException
Description
The input fails to satisfy the constraints specified by the service.
Members
- Details
-
- Type: BadRequestDetails structure
Details describing why the request was invalid.
- Message
-
- Type: string
- Reason
-
- Type: string
Code indicating the reason the request was invalid.
InternalServerException
Description
There was an internal failure in the service.
Members
- Message
-
- Type: string
InvalidParameterDetail
Description
Information about an invalid parameter.
Members
- Problem
-
- Type: string
The reason the parameter is invalid.
ResourceNotFoundException
Description
The requested resource could not be found.
Members
- Message
-
- Type: string
- ReferencedBy
-
- Type: Associative array of custom strings keys (String) to strings
A map indicating which parameters in the request reference the resource that was not found.
- ResourceType
-
- Type: string
The type of resource that was not found.
ThrottlingException
Description
The request was denied due to request throttling.
Members
- Message
-
- Type: string