Assigning EIPs in Batches
Function
This API is used to assign EIPs in batches.
URI
POST /v2/{project_id}/batchpublicips
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| bandwidth | Yes | BatchBandwidth object | Bandwidth information |
| publicip | Yes | BatchPublicIp object | EIP information |
| publicip_number | Yes | Integer | Number of EIPs to be created in batches |
| enterprise_project_id | Yes | String | Enterprise project ID |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| charge_mode | No | String |
Enumerated values:
|
| name | No | String |
Minimum length: 1 Maximum length: 64 |
| share_type | No | String |
Enumerated values:
|
| size | Yes | Integer |
|
| id | No | String |
|
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | No | String | Assigning an EIP by specifying an ID |
| ip_version | No | String | EIP version, for example, IPv4 and IPv6. The default value is ipv4. |
| enterprise_project_id | No | String | Enterprise project ID |
| tags | No | Array of ResourceTagOption objects |
|
| profile | No | BatchProfile object | Order information |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key | Yes | String |
Maximum length: 128 |
| value | Yes | String |
Maximum length: 255 |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| job_id | String | Job ID. The netAPI needs to be called to view the job execution status. netAPI: /v1/{project_id}/jobs/{job_id} |
Example Request
Assign two EIPs and add tags to them. The EIPs use 5 Mbit/s dedicated bandwidth and are billed by bandwidth.
POST /v2/{project_id}/batchpublicips
{
"bandwidth" : {
"name" : "",
"size" : 5,
"charge_mode" : "bandwidth",
"share_type" : "PER"
},
"publicip" : {
"type" : "5_bgp",
"tags" : ["name*tom", "type*kkkk"]
},
"publicip_number" : 2,
"enterprise_project_id" : 0
} Example Response
Status code: 200
OK
{
"job_id" : "ff8080828436722c0184cdb88e9200a5"
} Status Code
See Status Codes.
Error Code
See Error Codes.