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. 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.
Parameters:
-
configuration_token
(Token)
–
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.
This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a GetLatestConfiguration call uses an expired token, the system returns BadRequestException.
Raises:
Source code in docs_src/capo_appconfigdata/_services/app_config_data.py
| def get_latest_configuration(
self,
configuration_token: "capo_appconfigdata.types.token.Token",
*,
config_overrides: Optional[AppConfigDataClientConfig] = None,
) -> "capo_appconfigdata.types.get_latest_configuration_response.GetLatestConfigurationResponse":
"""<p>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 <a>StartConfigurationSession</a> API action, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Retrieving the configuration</a> in the <i>AppConfig User Guide</i>. </p> <important> <p>Note the following important information.</p> <ul> <li> <p>Each configuration token is only valid for one call to <code>GetLatestConfiguration</code>. The <code>GetLatestConfiguration</code> response includes a <code>NextPollConfigurationToken</code> that should always replace the token used for the just-completed call in preparation for the next one. </p> </li> <li> <p> <code>GetLatestConfiguration</code> is a priced call. For more information, see <a href="https://aws.amazon.com/systems-manager/pricing/">Pricing</a>.</p> </li> </ul> </important>
Args:
configuration_token: <p>Token describing the current state of the configuration session. To obtain a token, first call the <a>StartConfigurationSession</a> API. Note that every call to <code>GetLatestConfiguration</code> will return a new <code>ConfigurationToken</code> (<code>NextPollConfigurationToken</code> in the response) and <i>must</i> be provided to subsequent <code>GetLatestConfiguration</code> API calls.</p> <important> <p>This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a <code>GetLatestConfiguration</code> call uses an expired token, the system returns <code>BadRequestException</code>.</p> </important>
Raises:
capo_appconfigdata.errors.bad_request_exception.BadRequestException: <p>The input fails to satisfy the constraints specified by the service.</p>
capo_appconfigdata.errors.internal_server_exception.InternalServerException: <p>There was an internal failure in the service.</p>
capo_appconfigdata.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
capo_appconfigdata.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_appconfigdata.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_appconfigdata.types.get_latest_configuration_request.GetLatestConfigurationRequest]",
) -> OperationResponse[
"capo_appconfigdata.types.get_latest_configuration_response.GetLatestConfigurationResponse"
]:
import capo_appconfigdata._operations.app_config_data.get_latest_configuration
output, http_response = (
capo_appconfigdata._operations.app_config_data.get_latest_configuration.get_latest_configuration(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_appconfigdata.types.get_latest_configuration_response.GetLatestConfigurationResponse",
) -> dict[str, Any]:
import capo_appconfigdata.types.get_latest_configuration_response
return capo_appconfigdata.types.get_latest_configuration_response.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("GetLatestConfiguration", redact_output=_redact_output),
)
input_: capo_appconfigdata.types.get_latest_configuration_request.GetLatestConfigurationRequest = {
"configuration_token": configuration_token
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|