Help Center/ Global Accelerator/ API Reference/ API/ IP Address Group/ Associating an IP Address Group with a Listener
Updated on 2023-12-06 GMT+08:00

Associating an IP Address Group with a Listener

Function

This API is used to associate an IP address group with a listener. This API is an asynchronous API. The association is not complete even after a response is returned. You can call the API for querying the IP address group details to check whether the association is complete. If the IP address group status is ACTIVE, the IP address group has been associated with the listener.

Calling Method

For details, see Calling APIs.

URI

POST /v1/ip-groups/{ip_group_id}/associate-listener

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

ip_group_id

Yes

String

Specifies the ID of the IP address group.

Minimum: 1

Maximum: 36

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

listener_id

Yes

String

Specifies the listener ID.

Minimum: 0

Maximum: 36

type

Yes

String

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

  • BLACK: blacklist

  • WHITE: whitelist

Enumeration values:

  • BLACK

  • WHITE

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the request ID.

Example Requests

Binding an IP address group to a listener whose access policy type is blacklist

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

{
  "listener_id" : "e8996cd6-28cf-4ff2-951e-fa8ac895a6cd",
  "type" : "BLACK"
}

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.