Skip to content

describe_compute_environments

describe_compute_environments(
    *,
    config_overrides: Optional[BatchClientConfig] = None,
    compute_environments: Optional[StringList] = None,
    max_results: Optional[Integer] = None,
    next_token: Optional[String] = None,
) -> DescribeComputeEnvironmentsResponse

Describes one or more of your compute environments.

If you're using an unmanaged compute environment, you can use the DescribeComputeEnvironment operation to determine the ecsClusterArn that you launch your Amazon ECS container instances into.

Parameters:

  • compute_environments (Optional[StringList], default: None ) –

    A list of up to 100 compute environment names or full Amazon Resource Name (ARN) entries.

  • max_results (Optional[Integer], default: None ) –

    The maximum number of cluster results returned by DescribeComputeEnvironments in paginated output. When this parameter is used, DescribeComputeEnvironments only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeComputeEnvironments request with the returned nextToken value. This value can be between 1 and 100. If this parameter isn't used, then DescribeComputeEnvironments returns up to 100 results and a nextToken value if applicable.

  • next_token (Optional[String], default: None ) –

    The nextToken value returned from a previous paginated DescribeComputeEnvironments request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.

    Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.

Raises:

  • ClientException –

    These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.

  • ServerException –

    These errors are usually caused by a server issue.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To describe a compute environment This example describes the P2OnDemand compute environment.

>>> client.describe_compute_environments(compute_environments=['P2OnDemand'])
Source code in docs_src/capo_batch/_services/batch.py
def describe_compute_environments(
    self,
    *,
    config_overrides: Optional[BatchClientConfig] = None,
    compute_environments: Optional[
        "capo_batch.types.string_list.StringList"
    ] = None,
    max_results: Optional["capo_batch.types.integer.Integer"] = None,
    next_token: Optional["capo_batch.types.string.String"] = None,
) -> "capo_batch.types.describe_compute_environments_response.DescribeComputeEnvironmentsResponse":
    """<p>Describes one or more of your compute environments.</p> <p>If you're using an unmanaged compute environment, you can use the <code>DescribeComputeEnvironment</code> operation to determine the <code>ecsClusterArn</code> that you launch your Amazon ECS container instances into.</p>

    Args:
        compute_environments: <p>A list of up to 100 compute environment names or full Amazon Resource Name (ARN) entries.</p>
        max_results: <p>The maximum number of cluster results returned by <code>DescribeComputeEnvironments</code> in paginated output. When this parameter is used, <code>DescribeComputeEnvironments</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeComputeEnvironments</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeComputeEnvironments</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
        next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeComputeEnvironments</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>

    Raises:
        capo_batch.errors.client_exception.ClientException: <p>These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.</p>
        capo_batch.errors.server_exception.ServerException: <p>These errors are usually caused by a server issue.</p>
        capo_batch.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe a compute environment
        This example describes the P2OnDemand compute environment.

        >>> client.describe_compute_environments(compute_environments=['P2OnDemand'])
    """

    def _handler(
        req: "OperationRequest[capo_batch.types.describe_compute_environments_request.DescribeComputeEnvironmentsRequest]",
    ) -> OperationResponse[
        "capo_batch.types.describe_compute_environments_response.DescribeComputeEnvironmentsResponse"
    ]:
        import capo_batch._operations.aws_batch_v20160810.describe_compute_environments

        output, http_response = (
            capo_batch._operations.aws_batch_v20160810.describe_compute_environments.describe_compute_environments(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeComputeEnvironments")
    )
    input_: capo_batch.types.describe_compute_environments_request.DescribeComputeEnvironmentsRequest = {}
    if compute_environments is not None:
        input_["compute_environments"] = compute_environments
    if max_results is not None:
        input_["max_results"] = max_results
    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