Create reserved network segment
Updated at:2025-10-16
Description
This API is utilized to create a reserved network segment.
- To create an IPv6 reserved network segment, the mask must be greater than or equal to 96
Request structure
Plain Text
1POST /v{version}/subnet/ipreserve?clientToken={clientToken} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "subnetId":{subnetId},
6 "ipCidr":{ipCidr},
7 "ipVersion":{ipVersion},
8 "description":{description}
9}
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 |
| subnetId | String | Yes | RequestBody | Subnet ID to which the reserved network segment belongs |
| ipCidr | String | Yes | RequestBody | IP or CIDR of reserved network segment |
| ipVersion | int | Yes | RequestBody | IP version, supporting IPv4 and IPv6 |
| description | String | No | RequestBody | Description of reserved network segment |
| clientToken | String | No | Query | Idempotence Token, which is an ASCII string with a length not exceeding 64 bits. For details, refer to [ClientToken Idempotence Support](VPC/API Reference/General Description.md#Idempotence). |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| ipReserveId | String | ID of reserved network segment |
Request example
Plain Text
1POST /v1/subnet/ipreserve?clientToken=46f818c6-d21c-452d-b6d9-215ca6ffc843 HTTP/1.1
2Host: bcc.bj.baidubce.com
3Content-Type: application/json;charset=UTF-8
4Authorization: bce-auth-v1/69ce105be4b111edada7e5a923788a49/2023-04-27T04:10:15Z/3600/host;x-bce-accesskey;x-bce-account;x-bce-client-ip;x-bce-date;x-bce-gateway-count;x-bce-request-id;x-bce-user-agent/e061f900974bd5129e84f8eaf0b56aaeae8c22644a55588db41580fe154d8fb3
5{
6 "subnetId":"sbn-a4cikyt7756r",
7 "ipCidr":"192.168.0.100/30",
8 "ipVersion":4,
9 "description":"test"
10}
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 14f62dfa-b47d-4b4e-a2e2-e44759a196f1
3Date: Thu, 27 Apr 2023 04:10:15 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6{
7 "ipReserveId":"ipr-te2pa9cv4ikk"
8}
