Query Private Subnet Instance Count

Last updated: 2017-12-14 10:30:10

1. API Description

This API (GetCdbInstanceNumByVpcSubnetId) is used to query the number of instances under the subnet of a VPC.
Domain for API request: cdb.api.qcloud.com

2. Input Parameters

The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is GetCdbInstanceNumByVpcSubnetId.

Parameter Name Required Type Description
vpcId Yes Int VPC ID. It can be obtained via Query VPC List
subnetIds.n No String One or more subnet IDs (n represents array subscript starting with 0). Subnet ID under a VPC. It can be obtained via Query Subnet List

3. Output Parameters

Parameter Name Type Description
code Int Common error code; 0: Succeeded; other values: Failed. For more information, please refer to Common Error Codes on the Error Code page.
message String Module error message description depending on API.
codeDesc String Error code description
info Array Returned data

Parameter info is composed as follows:

Parameter Name Type Description
total int Number of instances under the subnet of a VPC
vpcId int VPC ID
subnetIds Array ID of subnet in VPC

4. Error Codes

The following error codes only include the business logic error codes for this API.

Error Code Error Message Error Description
9003 InvalidParameter Incorrect parameter
9006 InternalError Database internal error

5. Example

Input

https://cdb.api.qcloud.com/v2/index.php?Action=GetCdbInstanceNumByVpcSubnetId
&<Common request parameters>
&vpcId=13
&subnetIds.1=1115
&subnetIds.2=220

Output

{
    "code":"0",
    "message":"",
    "codeDesc":"Success",
    "data":{
        "total":"2",
        "vpcId":"13",
        "subnetIds":{
            "220":"1",
            "1115":"1"
        }
    }
}