Updated on 2024-11-11 GMT+08:00

Updating an IP Address Group

Function

This API is used to update an IP address group.

Calling Method

For details, see Calling APIs.

URI

PUT /v1/ip-groups/{ip_group_id}

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_group

Yes

UpdateIpGroupOption object

Describes the IP address group to be updated.

Table 4 UpdateIpGroupOption

Parameter

Mandatory

Type

Description

name

No

String

Specifies the name of the IP address group. The name can contain 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed.

description

No

String

Describes 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.

ip_group

IpGroupDetail object

Specifies the details of the IP address group.

Table 6 IpGroupDetail

Parameter

Type

Description

id

String

Specifies the ID of the IP address group.

name

String

Specifies the name of the IP address group.

description

String

Describes the IP address group.

status

String

Specifies the provisioning status. The value can be one of the following:

  • ACTIVE: The resource is running.

  • PENDING: The status is to be determined.

  • ERROR: Failed to create the resource.

  • DELETING: The resource is being deleted.

ip_list

Array of IpInfo objects

Specifies the CIDR blocks in the IP address group.

associated_listeners

Array of ListenerAccessControlPolicy objects

Specifies the access control policy used by the listener.

created_at

String

Specifies the time when the resource was created.

updated_at

String

Specifies the time when the resource was updated.

Table 7 IpInfo

Parameter

Type

Description

cidr

String

Specifies the CIDR block in the IP address group.

description

String

Describes the CIDR block in the IP address group.

created_at

String

Specifies the time when the resource was created.

Table 8 ListenerAccessControlPolicy

Parameter

Type

Description

listener_id

String

Specifies the listener ID.

type

String

Specifies the access control policy type. The value can be one of the following:

  • BLACK: blacklist

  • WHITE: whitelist

Example Requests

Modifying the name and description of an IP address group

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

{
  "ip_group" : {
    "name" : "ip-group-name",
    "description" : "ip-group description"
  }
}

Example Responses

Status code: 200

Operation successful.

{
  "request_id" : "ac1bf54f-6a23-4074-af77-800648d25bc8",
  "ip_group" : {
    "id" : "e8996cd6-28cf-4ff2-951e-fa8ac895a6cd",
    "name" : "ip-group-name",
    "description" : "ip-group description",
    "status" : "ACTIVE",
    "ip_list" : [ {
      "cidr" : "127.0.0.0/24",
      "description" : "cidr description",
      "created_at" : "2019-01-08T01:21:37.151Z"
    } ],
    "associated_listeners" : [ {
      "listener_id" : "1b11747a-b139-492f-9692-2df0b1c87193",
      "type" : "BLACK"
    } ],
    "created_at" : "2019-01-08T01:21:37.151Z",
    "updated_at" : "2019-01-08T01:21:37.151Z"
  }
}

Status Codes

Status Code

Description

200

Operation successful.

Error Codes

See Error Codes.