Returns information about the overall health of the specified environment. The DescribeEnvironmentHealth operation is only available with Elastic Beanstalk Enhanced Health.
This action only returns information about environments that the calling principle has IAM permissions to access. For example, consider a case where a user only has permission to access one of three environments. When the user calls this action, the response will only include the one environment that the user has permission to access instead of all three environments. If the user doesn’t have access to any of the environments an empty result is returned.
The AWSElasticBeanstalkReadOnly managed policy allows operators to view information about resources related to Elastic Beanstalk environments. For more information, see Managing Elastic Beanstalk user policies in the Elastic Beanstalk Developer Guide. For detailed instructions to attach a policy to a user or group, see the section Controlling access with managed policies in the same topic.
Parameters:
-
environment_name
(Optional[EnvironmentName], default:
None
)
–
Specify the environment by name.
You must specify either this or an EnvironmentName, or both.
-
environment_id
(Optional[EnvironmentId], default:
None
)
–
Specify the environment by ID.
You must specify either this or an EnvironmentName, or both.
-
attribute_names
(Optional[EnvironmentHealthAttributes], default:
None
)
–
Specify the response elements to return. To retrieve all attributes, set to All. If no attribute names are specified, returns the name of the environment.
Raises:
Examples:
To view environment health
The following operation retrieves overall health information for an environment named my-env:
>>> await client.describe_environment_health(environment_name='my-env', attribute_names=['All'])
Source code in docs_src/capo_elastic_beanstalk/_services/async_elastic_beanstalk.py
| async def describe_environment_health(
self,
*,
config_overrides: Optional[AsyncElasticBeanstalkClientConfig] = None,
environment_name: Optional[
"capo_elastic_beanstalk.types.environment_name.EnvironmentName"
] = None,
environment_id: Optional[
"capo_elastic_beanstalk.types.environment_id.EnvironmentId"
] = None,
attribute_names: Optional[
"capo_elastic_beanstalk.types.environment_health_attributes.EnvironmentHealthAttributes"
] = None,
) -> "capo_elastic_beanstalk.types.describe_environment_health_result.DescribeEnvironmentHealthResult":
"""<p>Returns information about the overall health of the specified environment. The <b>DescribeEnvironmentHealth</b> operation is only available with Elastic Beanstalk Enhanced Health.</p> <p>This action only returns information about environments that the calling principle has IAM permissions to access. For example, consider a case where a user only has permission to access one of three environments. When the user calls this action, the response will only include the one environment that the user has permission to access instead of all three environments. If the user doesn’t have access to any of the environments an empty result is returned.</p> <note> <p>The <a href="https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSElasticBeanstalkReadOnly.html">AWSElasticBeanstalkReadOnly</a> managed policy allows operators to view information about resources related to Elastic Beanstalk environments. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.iam.managed-policies.html"> Managing Elastic Beanstalk user policies</a> in the <i>Elastic Beanstalk Developer Guide</i>. For detailed instructions to attach a policy to a user or group, see the section <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.iam.managed-policies.html#iam-userpolicies-managed"> Controlling access with managed policies</a> in the same topic.</p> </note>
Args:
environment_name: <p>Specify the environment by name.</p> <p>You must specify either this or an EnvironmentName, or both.</p>
environment_id: <p>Specify the environment by ID.</p> <p>You must specify either this or an EnvironmentName, or both.</p>
attribute_names: <p>Specify the response elements to return. To retrieve all attributes, set to <code>All</code>. If no attribute names are specified, returns the name of the environment.</p>
Raises:
capo_elastic_beanstalk.errors.elastic_beanstalk_service_exception.ElasticBeanstalkServiceException: <p>A generic service exception has occurred.</p>
capo_elastic_beanstalk.errors.invalid_request_exception.InvalidRequestException: <p>One or more input parameters is not valid. Please correct the input parameters and try the operation again.</p>
capo_elastic_beanstalk.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To view environment health
The following operation retrieves overall health information for an environment named my-env:
>>> await client.describe_environment_health(environment_name='my-env', attribute_names=['All'])
"""
async def _handler(
req: "AsyncOperationRequest[capo_elastic_beanstalk.types.describe_environment_health_request.DescribeEnvironmentHealthRequest]",
) -> AsyncOperationResponse[
"capo_elastic_beanstalk.types.describe_environment_health_result.DescribeEnvironmentHealthResult"
]:
import capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.describe_environment_health
(
output,
http_response,
) = await capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.describe_environment_health.async_describe_environment_health(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeEnvironmentHealth")
)
input_: capo_elastic_beanstalk.types.describe_environment_health_request.DescribeEnvironmentHealthRequest = {}
if environment_name is not None:
input_["environment_name"] = environment_name
if environment_id is not None:
input_["environment_id"] = environment_id
if attribute_names is not None:
input_["attribute_names"] = attribute_names
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|