Updated on 2025-08-19 GMT+08:00

Modifying an Endpoint Rule

Function

This API is used to modify an endpoint rule.

Calling Method

For details, see Calling APIs.

URI

PUT /v2.1/resolverrules/{resolverrule_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

resolverrule_id

Yes

String

ID of an endpoint rule

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

The user token.

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

For details about how to obtain a user token, seeObtaining a User Token.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

No

String

Rule name.

It can contain 1 to 64 characters. Only letters, digits, underscores (_), hyphens (-), and periods (.) are allowed.

ipaddresses

No

Array of IpInfo objects

Destination IP address added to a rule

Table 4 IpInfo

Parameter

Mandatory

Type

Description

ip

No

String

IP address

Response Parameters

Status code: 202

Table 5 Response body parameters

Parameter

Type

Description

resolver_rule

ResolverRuleParam object

Endpoint rule

Table 6 ResolverRuleParam

Parameter

Type

Description

id

String

ID of an endpoint rule

name

String

Rule name

domain_name

String

Domain name

endpoint_id

String

ID of the endpoint to which the current rule belongs

status

String

Resource status. The value can be PENDING_CREATE, ACTIVE, PENDING_DELETE, or ERROR.

rule_type

String

Rule type. This parameter is reserved. The default value is FORWARD.

ipaddress_count

Integer

Number of IP addresses in the endpoint rule

create_time

String

The creation time.

Format: yyyy-MM-dd'T'HH:mm:ss.SSS

update_time

String

The update time.

Format: yyyy-MM-dd'T'HH:mm:ss.SSS

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

code

String

Definition

Error code

Range

N/A

message

String

Definition

Error description

Range

N/A

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

code

String

Definition

Error code

Range

N/A

message

String

Definition

Error description

Range

N/A

Example Requests

Changing the destination IP addresses associated with the endpoint rule to 1.1.1.1 and 2.2.2.2

PUT https://{endpoint}/v2.1/resolverrules/{resolverrule_id}

{
  "name" : "rule-xxx",
  "ipaddresses" : [ {
    "ip" : "1.1.1.1"
  }, {
    "ip" : "2.2.2.2"
  } ]
}

Example Responses

Status code: 202

Request accepted

{
  "resolver_rule" : {
    "id" : "8a36f60a753badb401753bade3400002",
    "name" : "rule-xxx",
    "domain_name" : "www.example.com",
    "endpoint_id" : "8a36f60a753badb401753bade3400001",
    "status" : "ACTIVE",
    "rule_type" : "FORWARD",
    "ipaddress_count" : 0,
    "create_time" : "2020-10-18T12:27:31.448",
    "update_time" : "2020-10-18T12:27:31.448"
  }
}

Status Codes

Status Code

Description

202

Request accepted

400

Error response

500

Error response

Error Codes

See Error Codes.