Query subnet list
Updated at:2025-10-16
Description
Query information about all subnet lists.
Request structure
Plain Text
1GET /v{version}/subnet?marker={marker}&maxKeys={maxKeys}&vpcId={vpcId}&zoneName={zoneName}&subnetType={subnetType} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | For API version No., the current value is 1 |
| marker | String | No | Query | The starting position of the batch list query is a system-generated string |
| maxKeys | Integer | No | Query | Maximum number of items included per page, maximum: 1,000, default: 1,000 |
| vpcId | String | No | Query | ID of the VPC to which it belongs |
| zoneName | String | No | Query | Name of the availability zone it belongs to |
| subnetType | String | No | Query | Subnet type, "BCC", "BBC" |
| subnetIds | String | No | Query | Specify subnets to be queried, with multiple subnet IDs separated by commas |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| marker | String | Mark the starting position of the query. |
| isTruncated | Boolean | true indicates there is more data later, false indicates it is the last page |
| nextMarker | String | Obtain the marker value required for retrieving the next page; this field will not appear when isTruncated is false |
| maxKeys | Integer | Maximum number of items included per page |
| subnets | List<[Subnet](VPC/API Reference/Appendix.md#Subnet)> | Instance information, which is a collection composed of subnets |
Request example
Plain Text
1GET /v1/subnet?marker=sbn-IyWRnII7&maxKeys=1&subnetIds=sbn-IyWRnII7,sbn-IyWRnTTd HTTP/1.1
2Host: bcc.bj.baidubce.com
3Content-Type: application/json;charset=UTF-8
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Thu, 16 Mar 2017 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6{
7 "nextMarker": "sbn-IyarenI7",
8 "marker": "sbn-IyWRnII7",
9 "maxKeys": 1,
10 "isTruncated": true,
11 "subnets": [
12 {
13 "name": "System predefined subnet",
14 "subnetId": "sbn-IyWRnII7",
15 "zoneName": "cn-bj-a",
16 "cidr": "192.168.0.0/20",
17 "ipv6Cidr": "",
18 "vpcId": "vpc-IyrqYIQ7",
19 "subnetType": "BCC",
20 "description": "",
21 "availableIp": 246,
22 "availableUnreservedIp": 246,
23 "createdTime": "2020-11-19T12:46:01Z",
24 "tags": [
25 {
26 "tagKey": "tagKey",
27 "tagValue": "tagValue"
28 }
29 ]
30 },
31 {
32 "name": "System predefined subnet",
33 "subnetId": "sbn-IyWRnTTd",
34 "zoneName": "cn-bj-a",
35 "cidr": "192.168.1.0/20",
36 "ipv6Cidr": "",
37 "vpcId": "vpc-IyrqYIQ7",
38 "subnetType": "BCC",
39 "description": "",
40 "availableIp": 246,
41 "availableUnreservedIp": 246,
42 "createdTime": "2020-11-19T12:46:01Z",
43 "tags": [
44 {
45 "tagKey": "tagKey",
46 "tagValue": "tagValue"
47 }
48 ]
49 }
50 ]
51}
