get_environment(
application_id: Name,
environment_id: Name,
*,
config_overrides: Optional[AsyncAppConfigClientConfig] = None,
) -> Environment
Retrieves information about an environment. An environment is a deployment group of AppConfig applications, such as applications in a Production environment or in an EU_Region environment. Each configuration deployment targets an environment. You can enable one or more Amazon CloudWatch alarms for an environment. If an alarm is triggered during a deployment, AppConfig roles back the configuration.
Parameters:
-
application_id
(Name)
–
The ID of the application that includes the environment you want to get.
-
environment_id
(Name)
–
The ID of the environment that you want to get.
Raises:
Examples:
To retrieve environment details
The following get-environment example returns the details and state of the specified environment.
>>> await client.get_environment(application_id='339ohji', environment_id='54j1r29')
Source code in docs_src/capo_appconfig/_services/async_app_config.py
| async def get_environment(
self,
application_id: "capo_appconfig.types.name.Name",
environment_id: "capo_appconfig.types.name.Name",
*,
config_overrides: Optional[AsyncAppConfigClientConfig] = None,
) -> "capo_appconfig.types.environment.Environment":
"""<p>Retrieves information about an environment. An environment is a deployment group of AppConfig applications, such as applications in a <code>Production</code> environment or in an <code>EU_Region</code> environment. Each configuration deployment targets an environment. You can enable one or more Amazon CloudWatch alarms for an environment. If an alarm is triggered during a deployment, AppConfig roles back the configuration.</p>
Args:
application_id: <p>The ID of the application that includes the environment you want to get.</p>
environment_id: <p>The ID of the environment that you want to get.</p>
Raises:
capo_appconfig.errors.bad_request_exception.BadRequestException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_appconfig.errors.internal_server_exception.InternalServerException: <p>There was an internal failure in the AppConfig service.</p>
capo_appconfig.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
capo_appconfig.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To retrieve environment details
The following get-environment example returns the details and state of the specified environment.
>>> await client.get_environment(application_id='339ohji', environment_id='54j1r29')
"""
async def _handler(
req: "AsyncOperationRequest[capo_appconfig.types.get_environment_request.GetEnvironmentRequest]",
) -> AsyncOperationResponse["capo_appconfig.types.environment.Environment"]:
import capo_appconfig._operations.amazon_app_config.get_environment
(
output,
http_response,
) = await capo_appconfig._operations.amazon_app_config.get_environment.async_get_environment(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetEnvironment")
)
input_: capo_appconfig.types.get_environment_request.GetEnvironmentRequest = {
"application_id": application_id,
"environment_id": environment_id,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|