Updated on 2023-12-25 GMT+08:00

Assigning EIPs in Batches

Function

This API is used to assign EIPs in batches.

URI

POST /v2/{project_id}/batchpublicips

Table 1 Path parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Request Parameters

Table 2 Request body 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

Table 3 BatchBandwidth

Parameter

Mandatory

Type

Description

charge_mode

No

String

  • Whether the billing is based on traffic or bandwidth For IPv6 addresses, the default value is bandwidth outside China and is traffic in China. If the value is traffic, the billing is based on traffic.

Enumerated values:

  • bandwidth
  • traffic

name

No

String

  • Bandwidth name
  • The value can contain 1 to 64 characters, including letters, digits, underscores (_), hyphens (-), and periods (.).
  • This parameter is mandatory if share_type is set to PER. This parameter will be ignored if share_type is set to WHOLE with an ID specified.

Minimum length: 1 character

Maximum length: 64 characters

share_type

No

String

  • Bandwidth type.
  • The value can be PER or WHOLE. IPv6 addresses do not support bandwidth whose type is WHOLE.

Enumerated values:

  • PER
  • WHOLE

size

Yes

Integer

  • Bandwidth size (Mbit/s).
  • The value ranges from 1 Mbit/s to 2000 Mbit/s by default. (The specific range may vary depending on the configuration in each region. You can see the available bandwidth range on the management console.)
  • This parameter is mandatory if share_type is set to PER. This parameter will be ignored if share_type is set to WHOLE with an ID specified.
  • The minimum increment for bandwidth adjustment varies depending on the bandwidth range. The details are as follows:
    • The minimum increment is 1 Mbit/s if the allowed bandwidth ranges from 0 Mbit/s to 300 Mbit/s (with 300 Mbit/s included).
    • The minimum increment is 50 Mbit/s if the allowed bandwidth ranges from 300 Mbit/s to 1000 Mbit/s (with 1000 Mbit/s included).
    • The minimum increment is 500 Mbit/s if the allowed bandwidth is greater than 1000 Mbit/s.

id

No

String

  • Bandwidth ID. You can specify an existing shared bandwidth ID when assigning an EIP that uses the bandwidth whose type is WHOLE.
  • Value: ID of the bandwidth of type WHOLE
Table 4 BatchPublicIp

Parameter

Mandatory

Type

Description

id

No

String

Assigning an EIP by specifying an ID

type

Yes

String

EIP type

Enumerated values:

  • 5_bgp
  • 5_union
  • 5_sbgp

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 strings

EIP tag

profile

No

BatchProfile object

Order information

Table 5 BatchProfile

Parameter

Mandatory

Type

Description

user_id

No

String

User ID

product_id

No

String

Product ID

region_id

No

String

Region ID

order_id

No

String

Order ID

Response Parameters

Status code: 200

Table 6 Response body parameters

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

POST /v2/{project_id}/batchpublicips

{
  "bandwidth" : {
    "name" : "",
    "size" : 5,
    "charge_mode" : "bandwidth",
    "share_type" : "PER"
  },
  "publicip" : {
    "type" : "5_bgp",
    "tags" : [ ]
  },
  "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.