describe_environments(
*,
config_overrides: Optional[ElasticBeanstalkClientConfig] = None,
application_name: Optional[ApplicationName] = None,
version_label: Optional[VersionLabel] = None,
environment_ids: Optional[EnvironmentIdList] = None,
environment_names: Optional[EnvironmentNamesList] = None,
include_deleted: Optional[IncludeDeleted] = None,
included_deleted_back_to: Optional[IncludeDeletedBackTo] = None,
max_records: Optional[MaxRecords] = None,
next_token: Optional[Token] = None,
) -> EnvironmentDescriptionsMessage
Returns descriptions for existing environments.
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 the DescribeEnvironments 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:
-
application_name
(Optional[ApplicationName], default:
None
)
–
If specified, Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application.
-
version_label
(Optional[VersionLabel], default:
None
)
–
If specified, Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application version.
-
environment_ids
(Optional[EnvironmentIdList], default:
None
)
–
If specified, Elastic Beanstalk restricts the returned descriptions to include only those that have the specified IDs.
-
environment_names
(Optional[EnvironmentNamesList], default:
None
)
–
If specified, Elastic Beanstalk restricts the returned descriptions to include only those that have the specified names.
-
include_deleted
(Optional[IncludeDeleted], default:
None
)
–
Indicates whether to include deleted environments:
true: Environments that have been deleted after IncludedDeletedBackTo are displayed.
false: Do not include deleted environments.
-
included_deleted_back_to
(Optional[IncludeDeletedBackTo], default:
None
)
–
If specified when IncludeDeleted is set to true, then environments deleted after this date are displayed.
-
max_records
(Optional[MaxRecords], default:
None
)
–
For a paginated request. Specify a maximum number of environments to include in each response.
If no MaxRecords is specified, all available environments are retrieved in a single response.
-
next_token
(Optional[Token], default:
None
)
–
For a paginated request. Specify a token from a previous response page to retrieve the next response page. All other parameter values must be identical to the ones specified in the initial request.
If no NextToken is specified, the first page is retrieved.
Raises:
Examples:
To view information about an environment
The following operation retrieves information about an environment named my-env:
>>> client.describe_environments(environment_names=['my-env'])
Source code in docs_src/capo_elastic_beanstalk/_services/elastic_beanstalk.py
| def describe_environments(
self,
*,
config_overrides: Optional[ElasticBeanstalkClientConfig] = None,
application_name: Optional[
"capo_elastic_beanstalk.types.application_name.ApplicationName"
] = None,
version_label: Optional[
"capo_elastic_beanstalk.types.version_label.VersionLabel"
] = None,
environment_ids: Optional[
"capo_elastic_beanstalk.types.environment_id_list.EnvironmentIdList"
] = None,
environment_names: Optional[
"capo_elastic_beanstalk.types.environment_names_list.EnvironmentNamesList"
] = None,
include_deleted: Optional[
"capo_elastic_beanstalk.types.include_deleted.IncludeDeleted"
] = None,
included_deleted_back_to: Optional[
"capo_elastic_beanstalk.types.include_deleted_back_to.IncludeDeletedBackTo"
] = None,
max_records: Optional[
"capo_elastic_beanstalk.types.max_records.MaxRecords"
] = None,
next_token: Optional["capo_elastic_beanstalk.types.token.Token"] = None,
) -> "capo_elastic_beanstalk.types.environment_descriptions_message.EnvironmentDescriptionsMessage":
"""<p>Returns descriptions for existing environments.</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 the <i>DescribeEnvironments</i> 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:
application_name: <p>If specified, Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application.</p>
version_label: <p>If specified, Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application version.</p>
environment_ids: <p>If specified, Elastic Beanstalk restricts the returned descriptions to include only those that have the specified IDs.</p>
environment_names: <p>If specified, Elastic Beanstalk restricts the returned descriptions to include only those that have the specified names.</p>
include_deleted: <p>Indicates whether to include deleted environments:</p> <p> <code>true</code>: Environments that have been deleted after <code>IncludedDeletedBackTo</code> are displayed.</p> <p> <code>false</code>: Do not include deleted environments.</p>
included_deleted_back_to: <p> If specified when <code>IncludeDeleted</code> is set to <code>true</code>, then environments deleted after this date are displayed. </p>
max_records: <p>For a paginated request. Specify a maximum number of environments to include in each response.</p> <p>If no <code>MaxRecords</code> is specified, all available environments are retrieved in a single response.</p>
next_token: <p>For a paginated request. Specify a token from a previous response page to retrieve the next response page. All other parameter values must be identical to the ones specified in the initial request.</p> <p>If no <code>NextToken</code> is specified, the first page is retrieved.</p>
Raises:
capo_elastic_beanstalk.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To view information about an environment
The following operation retrieves information about an environment named my-env:
>>> client.describe_environments(environment_names=['my-env'])
"""
def _handler(
req: "OperationRequest[capo_elastic_beanstalk.types.describe_environments_message.DescribeEnvironmentsMessage]",
) -> OperationResponse[
"capo_elastic_beanstalk.types.environment_descriptions_message.EnvironmentDescriptionsMessage"
]:
import capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.describe_environments
output, http_response = (
capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.describe_environments.describe_environments(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeEnvironments")
)
input_: capo_elastic_beanstalk.types.describe_environments_message.DescribeEnvironmentsMessage = {}
if application_name is not None:
input_["application_name"] = application_name
if version_label is not None:
input_["version_label"] = version_label
if environment_ids is not None:
input_["environment_ids"] = environment_ids
if environment_names is not None:
input_["environment_names"] = environment_names
if include_deleted is not None:
input_["include_deleted"] = include_deleted
if included_deleted_back_to is not None:
input_["included_deleted_back_to"] = included_deleted_back_to
if max_records is not None:
input_["max_records"] = max_records
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|