Apply for EIP
Last Updated:2020-10-21
- Apply for an EIP, which can be bound to any BLB instance or BCC instance.
- Identity Verification is needed for creation of EIP, and if you fail to pass identity verification, you can go to identity verification under security authentication in Baidu AI Cloud Console for authentication.
Request structure
POST /v{version}/eip?clientToken={clientToken} HTTP/1.1
Host: eip.bj.baidubce.com
Authorization: authorization string
{
"name": name,
"bandwidthInMbps": bandwidthInMbps,
"billing":{
"paymentTiming": paymentTiming,
"billingMethod": billingMethod,
"reservation":{
"reservationLength": reservationLength,
"reservationTimeUnit": reservationTimeUnit
}
},
"tags":[
{
"tagKey": tagKey,
"tagValue": tagValue
}
}
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 | Yes | Query parameter | Idempotence, for details, please see Idempotence |
bandwidthInMbps | int | Yes | RequestBody parameter | Public network bandwidth, in Mbps. For prepaid EIP and postpaid EIP billed by bandwidth, it is an integer limited to between 1 and 200 (representing the upper limit of bandwidth); for the postpaid EIP billed by traffic, it is limited to an integer between 1 and 200 (representing the traffic peak of allowable bandwidth) |
billing | Billing | Yes | RequestBody parameter | Order information. |
name | String | No | RequestBody parameter | It is 1-65 bytes in length beginning with a letter. It can contain letters, numbers and characters of - \_ / . . If this parameter is not transmitted, the service generates a name automatically. |
tags | List<TagModel> | No | RequestBody parameter | List of tag key value pair to be created. |
autoRenewTimeUnit | String | No | RequestBody parameter | Support to create EIP and enable automatic renewal at the same time, the value is month or year (default month). |
autoRenewTime | int | No | RequestBody parameter | Support to create an EIP and activate automatic renewal at the same time. There are different ranges according to the value of autoRenewTimeUnit, 1~9 for month, 1~3 for year. |
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 |
---|---|---|
eip | string | Assigned EIP address |
Request example, postpaid is billed by traffic
POST /v1/eip?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":"eip-for-test",
"bandwidthInMbps": 1,
"billing":{
"paymentTiming":"Postpaid",
"billingMethod":"ByTraffic"
}
}
Request example, prepaid
POST /v1/eip?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":"eip-for-test",
"bandwidthInMbps": 1,
"billing":{
"paymentTiming":"Prepaid",
"reservation":{
"reservationLength":1,
"reservationTimeUnit":"Month"
}
}
}
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
{
"eip":"180.181.3.133"
}