Updated on 2024-05-16 GMT+08:00

Setting an ACL

Function

This API is used to set an ACL for your domain name.

URI

PUT /v1.0/cdn/domains/{domain_id}/ip-acl

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Specifies the ID of the domain name for which an ACL is to be set. For details, see Querying Details About a Domain Name.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Enterprise project that the domain name to be modified belongs to. This parameter is valid only when the enterprise project function is enabled. The value all indicates all projects. This parameter is mandatory when you use an IAM user to call this API.

Obtain the enterprise project ID by calling the ListEnterpriseProject API of Enterprise Project Management Service (EPS).

Request Parameters

Table 3 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 used to obtain a user token. The value of **X-Subject-Token** in the response header is the user token.
Table 4 Request body parameters

Parameter

Mandatory

Type

Description

type

Yes

Integer

Specifies the type of the IP address filtering rule. Possible values: 0 (no blacklist or whitelist), 1 (blacklist), and 2 (whitelist).

ip_list

No

Array of strings

Specifies the blacklisted or whitelisted IP addresses. If the mask is supported and available, the IP address portion of the subnet must be the first IP address on that block.

Array Length: 1 - 100

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

code

String

Specifies the response code.

Default: success

result

String

Specifies the response result.

Default: operate success!

data

Object

Specifies the response data.

Example Requests

PUT https://cdn.myhuaweicloud.com/v1.0/cdn/domains/ff8080***********************d71/ip-acl

{
  "type" : 1,
  "ip_list" : [ "10.23.3.3", "10.12.3.0/24" ]
}

Example Responses

Status code: 200

OK

{
  "code" : "success",
  "result" : "operate success!",
  "data" : { }
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.