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

Switching the Status of a Policy

Function

This API is used to switch the status of a policy.

Calling Method

For details, see Calling APIs.

URI

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

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

is_valid

Yes

Boolean

Whether it is valid, true: valid; false: not valid.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

Boolean

Status.

rule_set_id

String

Policy ID.

Example Requests

PUT https://{endpoint}/v2/2d09f712e9504b61b034cc8f40e475a8/rule-sets/2f4a244eff3442f0befd6df80a1eabec/switch

{
  "is_valid" : true
}

Example Responses

Status code: 200

Response body for switching the policy status.

{
  "status" : true,
  "rule_set_id" : "2f4a244eff3442f0befd6df80a1eabec"
}

Status Codes

Status Code

Description

200

Response body for switching the policy status.

Error Codes

See Error Codes.