Updated on 2025-03-25 GMT+08:00

Updating a Policy

Function

This API is used to update a policy.

Calling Method

For details, see Calling APIs.

URI

PUT /v2/{cloudProjectId}/rule-sets/{ruleSetId}/update

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

cloudProjectId

Yes

String

Project ID.

ruleSetId

Yes

String

Policy ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Policy name.

rules

Yes

Array of rules objects

Rule.

Table 3 rules

Parameter

Mandatory

Type

Description

id

Yes

String

Rule ID.

is_valid

Yes

Boolean

Enable or not.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

status

Boolean

Status.

rule_set_id

String

Policy ID.

Example Requests

PUT https://{endpoint}/v2/2d09f712e9504b61b034cc8f40e475a8/rule-sets/842cacd3424a470eb410300b537fa756/update

{
  "name" : "New policy-20240625194201",
  "rules" : [ {
    "id" : "df6f4de49cf14d738ce34ec63e5039ff",
    "is_valid" : true
  } ]
}

Example Responses

Status code: 200

Response body for updating a policy.

{
  "status" : true,
  "rule_set_id" : "842cacd3424a470eb410300b537fa756"
}

Status Codes

Status Code

Description

200

Response body for updating a policy.

Error Codes

See Error Codes.