DescribeComputeEnvs

Last updated: 2020-07-31 11:59:47

1. API Description

Domain name for API request: batch.tencentcloudapi.com.

This API is used to view the list of compute environments.

A maximum of 2 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: DescribeComputeEnvs.
Version Yes String Common parameter. The value used for this API: 2017-03-12.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
EnvIds.N No Array of String Compute environment ID
Filters.N No Array of Filter Filter
  • zone - String - Required: No - (Filter) Filter by availability zone.
  • env-id - String - Required: No - (Filter) Filter by compute environment ID.
  • env-name - String - Required: No - (Filter) Filter by compute environment name.
  • Offset No Integer Offset
    Limit No Integer Number of returned results

    3. Output Parameters

    Parameter Name Type Description
    ComputeEnvSet Array of ComputeEnvView List of compute environments
    TotalCount Integer Number of compute environments
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Viewing the list of compute environments

    Input Example

    https://batch.tencentcloudapi.com/?Action=DescribeComputeEnvs
    &EnvIds.0=env-lcx7qbbr
    &EnvIds.1=env-lcpcej85
    &<common request parameters>

    Output Example

    {
      "Response": {
        "TotalCount": 2,
        "ComputeEnvSet": [
          {
            "EnvId": "env-lcpcej85",
            "ComputeNodeMetrics": {
              "CreatedCount": 0,
              "DeletingCount": 0,
              "CreationFailedCount": 0,
              "SubmittedCount": 0,
              "CreatingCount": 0,
              "AbnormalCount": 1,
              "RunningCount": 1
            },
            "ResourceType": "CVM",
            "EnvType": "MANAGED",
            "CreateTime": "2018-03-08T11:48:43Z",
            "EnvName": "test compute env",
            "Placement": {
              "Zone": "ap-guangzhou-2"
            },
            "DesiredComputeNodeCount": 2,
            "AttachedComputeNodeCount": 0
          },
          {
            "EnvId": "env-lcx7qbbr",
            "ComputeNodeMetrics": {
              "CreatedCount": 0,
              "DeletingCount": 0,
              "CreationFailedCount": 0,
              "SubmittedCount": 0,
              "CreatingCount": 0,
              "AbnormalCount": 0,
              "RunningCount": 1
            },
            "ResourceType": "CVM",
            "EnvType": "MANAGED",
            "CreateTime": "2018-03-08T11:48:42Z",
            "EnvName": "test compute env",
            "Placement": {
              "Zone": "ap-guangzhou-2"
            },
            "DesiredComputeNodeCount": 1,
            "AttachedComputeNodeCount": 0
          }
        ],
        "RequestId": "5d5bc973-d924-4c95-90b5-1ace7b5e41b9"
      }
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InternalError Internal error
    InvalidParameter.EnvIdMalformed Invalid compute environment ID format.
    InvalidParameter.InvalidParameterCombination Invalid parameter combination.
    InvalidParameterValue Invalid parameter value.
    InvalidParameterValue.ResourceType The specified ResourceType is invalid.
    InvalidZone.MismatchRegion The specified zone does not exist.
    UnknownParameter Unknown parameter mistake.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help