Applying a Policy Group
Function
Applying a policy group
URI
POST /v5/{project_id}/policy/deploy
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
Enterprise project ID. To query all enterprise projects, set this parameter to all_granted_eps. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
IAM token. It can be obtained by calling the IAM API used to obtain an IAM token. The value of X-Subject-Token in the response header is a token. |
Content-Type |
No |
String |
Default value: application/json; charset=utf-8 |
region |
Yes |
String |
Region ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
target_policy_group_id |
Yes |
String |
ID of the policy group to be deployed |
operate_all |
No |
Boolean |
Whether to deploy the policy on all hosts. If the value is true, you do not need to configure host_id_list. If the value is false, configure host_id_list. |
host_id_list |
No |
Array of strings |
IDs of servers where the policy group needs to be deployed |
Response Parameters
Status code: 200
success
None
Example Requests
Deploy a server protection policy. The target server ID is 15462c0e-32c6-4217-a869-bbd131a00ecf, and the target policy ID is f671f7-2677-4705-a320-de1a62bff306.
POST https://{endpoint}/v5/{project_id}/policy/deploy { "target_policy_group_id" : "1df671f7-2677-4705-a320-de1a62bff306", "host_id_list" : [ "15462c0e-32c6-4217-a869-bbd131a00ecf" ], "operate_all" : false }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
200 |
success |
400 |
Invalid parameter. |
401 |
Authentication failed. |
403 |
Insufficient permission. |
404 |
Resource not found. |
500 |
System error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.