Help Center/ Global Accelerator/ API Reference/ API/ IP Address Group/ Adding CIDR Blocks to an IP Address Group
Updated on 2024-11-11 GMT+08:00

Adding CIDR Blocks to an IP Address Group

Function

This API is used to add CIDR blocks to an IP address group.

This is an asynchronous API. CIDR blocks are not added even after a response is returned. You can call the API for querying the IP address group details to check whether CIDR blocks are added. If the IP address group status is ACTIVE, the CIDR blocks are added.

Calling Method

For details, see Calling APIs.

URI

POST /v1/ip-groups/{ip_group_id}/add-ips

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

ip_group_id

Yes

String

Specifies the ID of the IP address group.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. The token can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

ip_list

Yes

Array of CreateIpGroupIpOption objects

Specifies the CIDR blocks in the IP address group. A maximum of 20 CIDR blocks can be added at a time.

Table 4 CreateIpGroupIpOption

Parameter

Mandatory

Type

Description

cidr

Yes

String

Specifies the CIDR block in the IP address group.

description

No

String

Describes the CIDR block in the IP address group. The value can contain 0 to 255 characters and cannot contain <>.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the request ID.

Example Requests

Adding the CIDR block 127.0.0.0/24 to an IP address group

POST https://{ga_endpoint}/v1/ip-groups/e8996cd6-28cf-4ff2-951e-fa8ac895a6cd/add-ips

{
  "ip_list" : [ {
    "cidr" : "127.0.0.0/24",
    "description" : "cidr description"
  } ]
}

Example Responses

Status code: 200

Operation successful.

{
  "request_id" : "ac1bf54f-6a23-4074-af77-800648d25bc8"
}

Status Codes

Status Code

Description

200

Operation successful.

Error Codes

See Error Codes.