Help & DocumentationAPIsAPI GatewayService APIsQuery the list of service environments

Query the list of service environments

Last updated: 2020-02-21 16:25:20

Interface description

This API (DescribeServiceEnvironmentList) is used to query the list of environments of a service. You can query all environments and their status under this service.

Input Parameter

The following request parameter list only lists the API request parameters. For other parameters, please see Common Request Parameters .

Parameter name Required Type Description
ServiceId Yes String The only service to be queried is ID.
Limit No Int The returned quantity.
Offset No Int Offset.

Output Parameter

Parameter name Type Description
Code Int Common error code, 0 indicates success, other values indicate failure. For more information, please see the error code page Common error code .
CodeDesc String Error code on the business side. If a Success, error is returned on success, the cause of the business error is returned.
Message String Module error message description, related to the interface.
TotalCount String Total number of environments.
EnvironmentList List of Array List of environments.

EnvironmentList is a list of environments, which is an array of environmentAttribute. The environmentAttribute is composed as follows:

Parameter name Type Description
EnvironmentName String Environment name.
Url String Access path.
Status Int Publish status: 1 means publish, 0 means not publish
VerisonName String Running version.

Example

https://apigateway.api.qcloud.com/v2/index.php?
&<Common request parameters>
&Action=DescribeServiceEnvironmentList
&serviceId=service-XX

The returned results are as below:

{
    "code":"0",
    "message":"",
    "codeDesc":"Success",      
    "totalCount":2,
    "environmentList":[
        {
            "environmentName":"test",
            "url":"hahah.ap-guangzhou.1251000011.tencentyunapi.com/test",
            "status":0,
            "verisonName":""
        },
        {
            "environmentName":"pre",
            "url":"hahah.ap-guangzhou.1251000011.tencentyunapi.com/pre",
            "status":1,
            "verisonName":"version-20170904xx"
        }
    ]
}