Create Bandwidth Packet
Last Updated:2022-01-14
Description
- The bandwidth packet only supports binding prepaid resources, and supports binding elastic public network Eip and shared bandwidth currently.
- Name field is an optional parameter, representing the name of bandwidth packet, and it is generated automatically if not filled in. If the filling is required to start with a letter, only number, letter and special characters of
-
_
.
/
can be included with a length no more than 65 characters. - eip and eipGroup fields respectively represent the IP address of Eip of resource to be bound or id of shared bandwidth, and only one field is effective, and if both are filled in, only "eip" field is effective.
- Eip can only be an IP address of separate elastic public network instance, and cannot be the IP address of a shared bandwidth resource.
- bandwidthInMbps field represents the public network bandwidth of bandwidth packet, which is required to be an integer greater than 0, and the sum of that value and the bandwidth of bound resource cannot be greater than 200Mbps.
- autoReleaseTime is an optional parameter, representing the automatic release time of bandwidth packet. If the setting requires that the time format should conform to UTC format (such as"2019-08-03T20:38:43Z"), the time should be between the current time and expiration time of prepaid instance bound, and if it is not filled, it is released together with expiration of bound resources.
Request Structure
POST /v{version}/eipbp?clientToken={clientToken} HTTP/1.1
Host: eip.bj.baidubce.com
Authorization: authorization string
{
"name": name,
"eip": eip,
"eipGroupId": eipGroupId,
"bandwidthInMbps": bandwidthInMbps��
"autoReleaseTime":autoReleaseTime
}
Request Header
There are no other special headers except the public headers.
Request Parameter
Parameter name | Type | Required or not | Parameter position | Description |
---|---|---|---|---|
version | String | Yes | URL parameter | API version number (the current value is 1) |
clientToken | String | No | Query parameter | Idempotent Token |
name | String | No | RequestBody parameter | Bandwidth packet name, which is generated automatically if it is not filled in. |
eip | String | Yes | RequestBody parameter | Ip address of elastic public network EIP bound to bandwidth packet |
eipGroupId | String | Yes | RequestBody parameter | Shared bandwidth id bound to bandwidth packet |
bandwidthInMbps | int | Yes | RequestBody parameter | Public network bandwidth of bandwidth packet |
autoReleaseTime | String | No | RequestBody parameter | Automatic release time of bandwidth packet, with time format required to conform to UTC format (such as"2019-08-03T20:38:43Z") |
Return Status Code
200 is returned successfully, for the failed return, please see Error code.
Return Header
There are no other special headers except the public headers.
Return Parameter
Parameter Name | Type | Description |
---|---|---|
id | String | Bandwidth packet id |
Request Example
POST /v1/eipbp?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
HOST: eip.bj.baidubce.com
Authorization: bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
{
"name":"bp-for-test",
"eip": "10.23.42.12",
"bandwidthInMbps": 5
}
Response Example
HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS
{
"id":"bw-2ede9df3"
}