Query the List of Instances That Are Not Charged When Shut Down
Last Updated:2020-10-28
Query the detailed information of all instances meeting the shutdown non-charging conditions (the shutdown non-charging conditions include: 1. No local disk, 2. Postpaid, 3. Instance in the running status).
Request structure
GET /v{version}/instance/noCharge?marker={marker}&maxKeys={maxKeys}&internalIp={internalIp}&keypairId={keypairId}&zoneName={zoneName} HTTP/1.1 
Host: bcc.bj.baidubce.com 
Authorization: authorization string Request header
There are no special headers except the common header.
Request parameter
| Parameter name | Type | Required or not | Parameter position | Description | 
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number | 
| marker | String | No | Query parameter | The starting location of query for batch acquisition of lists, and is one string generated by the system. | 
| maxKeys | int | No | Query parameter | Maximum number contained in each page, generally not exceeding 1000. The default value is 1000. | 
| internalIp | String | No | Query parameter | Intranet IP | 
| keypairId | String | No | Query parameter | Key pair id | 
| zoneName | String | No | Query parameter | Available zone name | 
Return header
There are no special headers except the common header.
Return parameter
| Parameter name | Type | Description | 
|---|---|---|
| marker | String | It marks the queried starting position. | 
| isTruncated | boolean | True means there are additional data in the following pages and false means the current page is the last page. | 
| nextMarker | String | The marker value requiring to be passed in order to acquire the next page. The domain doesn't appear when isTruncated is false. | 
| maxKeys | int | Maximum number contained in each page. | 
| instances | List<InstanceModel> | Instance information, an set composed by InstanceModel | 
Error code
No special return error code
Request example
GET /v2/instance/noCharge?marker=i-IyWRtII7&maxKeys=1 HTTP/1.1 
Host: bcc.bj.baidubce.com 
ContentType: application/json 
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de Return example
HTTP/1.1 200 OK 
x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
Date: Wed, 03 Dec 2014 06:42:19 GMT 
Content-Type: application/json;charset=UTF-8 
Server: BWS 
{ 
    "nextMarker": "i-xktdeMSf", 
    "marker": "i-IyWRtII7", 
    "maxKeys": 1, 
    "isTruncated": true, 
    "instances": [ 
        { 
            "id": "i-IyWRtII7", 
            "createTime": "2015-08-06T13:23:13Z", 
            "name": "instance-j93wzbn1", 
            "instanceType": "N1", 
            "status": "Running", 
            "desc": "console", 
            "paymentTiming":"Postpaid", 
            "expireTime": null, 
            "internalIp": "192.168.6.15", 
            "publicIp": "-", 
            "cpuCount": 1, 
            "memoryCapacityInGB": 1, 
            "localDiskSizeInGB": 0, 
            "networkCapacityInMbps": 1, 
            "imageId": "m-3zfBY1Ku", 
            "placementPolicy": "default", 
            "zoneName": "cn-bj-a", 
            "autoRenew":"true" 
        } 
    ] 
}