Creating a Policy
Function
This API is used to create a policy.
Calling Method
For details, see Calling APIs.
URI
POST /v2/{cloudProjectId}/rule-sets/create
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
cloudProjectId |
Yes |
String |
Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Policy name. |
cloud_project_id |
Yes |
String |
Project ID. |
rules |
Yes |
Array of rules objects |
Rule. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
status |
Boolean |
Status. |
rule_set_id |
String |
Policy ID. |
Example Requests
POST https://{endpoint}/v2/2d09f712e9504b61b034cc8f40e475a8/rule-sets/create { "name" : "New policy-20240625200400", "cloud_project_id" : "2d09f712e9504b61b034cc8f40e475a8", "rules" : [ { "id" : "597c7f2f775740a1bb522b03a16e6864", "is_valid" : true } ] }
Example Responses
Status code: 200
Response body for creating a policy.
{ "status" : true, "rule_set_id" : "e42be82e7d514437a322dce4d42bdec8" }
Status Codes
Status Code |
Description |
---|---|
200 |
Response body for creating a policy. |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot