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

Inheriting a Policy

Function

This API is used to inherit a policy.

Calling Method

For details, see Calling APIs.

URI

POST /v2/{cloudProjectId}/rule-sets/inherit

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

cloudProjectId

Yes

String

Project ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Policy name.

parent_id

Yes

String

Parent policy ID.

cloud_project_id

Yes

String

Project ID.

rules

No

Array of strings

Rule.

is_valid

Yes

Boolean

Enable or not.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

Boolean

Status.

rule_set_id

String

Policy ID.

Example Requests

POST https://{endpoint}/v2/2d09f712e9504b61b034cc8f40e475a8/rule-sets/inherit

{
  "name" : "New policy -20240625194116-copy-98528",
  "parent_id" : "62e21804566e4e18bc8106f6c961aefd",
  "cloud_project_id" : "2d09f712e9504b61b034cc8f40e475a8",
  "rules" : [ ],
  "is_valid" : true
}

Example Responses

Status code: 200

Response body for inheriting a policy.

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

Status Codes

Status Code

Description

200

Response body for inheriting a policy.

Error Codes

See Error Codes.