Updating an Organization Rule
Function
Updating an Organization Rule
Calling Method
For details, see Calling APIs.
URI
PUT /v1/resource-manager/organizations/{organization_id}/policy-assignments/{organization_policy_assignment_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| organization_id | Yes | String | Specifies the organization ID. Maximum: 34 |
| organization_policy_assignment_id | Yes | String | Specifies the organization rule ID. Maximum: 32 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| excluded_accounts | No | Array of strings | Specifies the accounts to be excluded from the rule. Maximum: 32 |
| organization_policy_assignment_name | Yes | String | Specifies the organization rule name. Maximum: 60 |
| managed_policy_assignment_metadata | No | Specifies the metadata of a managed rule. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| description | No | String | Specifies the rule description. Maximum: 512 |
| period | No | String | Specifies the trigger period. |
| parameters | No | Map<String,PolicyParameterValue> | Specifies the input parameter. |
| policy_filter | No | PolicyFilterDefinition object | Specifies the policy filter of a rule. |
| policy_definition_id | Yes | String | Specifies the identifier of a predefined policy. Maximum: 36 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| value | No | Object | Specifies the value of the rule parameter. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| region_id | No | String | Specifies the region ID. Maximum: 128 |
| resource_provider | No | String | Specifies the cloud service name. Maximum: 128 |
| resource_type | No | String | Specifies the resource type. Maximum: 128 |
| resource_id | No | String | Specifies the resource ID. Maximum: 512 |
| tag_key | No | String | Specifies the tag key. Maximum: 128 |
| tag_value | No | String | Specifies the tag value. Maximum: 256 |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| owner_id | String | Specifies the organization rule creator. |
| organization_id | String | Specifies the organization ID. |
| organization_policy_assignment_urn | String | Specifies the unique ID of the organization rule. |
| organization_policy_assignment_id | String | Specifies the organization rule ID. |
| organization_policy_assignment_name | String | Specifies the organization rule name. |
| description | String | Specifies the description information. |
| period | String | Specifies the trigger period. |
| policy_filter | PolicyFilterDefinition object | Specifies the policy filter of a rule. |
| parameters | Map<String,PolicyParameterValue> | Specifies the rule parameters. |
| policy_definition_id | String | Specifies the policy ID. |
| created_at | String | Specifies the creation time. |
| updated_at | String | Specifies the update time. |
| Parameter | Type | Description |
|---|---|---|
| region_id | String | Specifies the region ID. Maximum: 128 |
| resource_provider | String | Specifies the cloud service name. Maximum: 128 |
| resource_type | String | Specifies the resource type. Maximum: 128 |
| resource_id | String | Specifies the resource ID. Maximum: 512 |
| tag_key | String | Specifies the tag key. Maximum: 128 |
| tag_value | String | Specifies the tag value. Maximum: 256 |
| Parameter | Type | Description |
|---|---|---|
| value | Object | Specifies the value of the rule parameter. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Specifies the error code. |
| error_msg | String | Specifies the error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Specifies the error code. |
| error_msg | String | Specifies the error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Specifies the error code. |
| error_msg | String | Specifies the error message. |
Example Requests
Updating an Organization Rule
PUT https://{endpoint}/v1/resource-manager/organizations/{organization_id}/policy-assignments/{organization_policy_assignment_id}
{
"organization_policy_assignment_name" : "allowed-images-by-id",
"managed_policy_assignment_metadata" : {
"description" : "The ECS resource is non-compliant if the image it used is not in the allowed list.",
"parameters" : {
"listOfAllowedImages" : {
"value" : [ "ea0d6e0e-99c3-406d-a873-3bb45462b624" ]
}
},
"policy_filter" : {
"resource_provider" : "ecs",
"resource_type" : "cloudservers"
},
"policy_definition_id" : "5fa265c0aa1e6afc05a0ff07"
}
} Example Responses
Status code: 200
Operation succeeded.
{
"owner_id" : "e74e043fab784a45ad88f5ef6a4bcffc",
"organization_id" : "o-doxbpkzqsdd51ti1k27w2y8fitakrknp",
"organization_policy_assignment_urn" : "rms::e74e043fab784a45ad88f5ef6a4bcffc:organizationPolicyAssignment:o-doxbpkzqsdd51ti1k27w2y8fitakrknp/d02b7fa9d5a74e638c1402d0868f71fd",
"organization_policy_assignment_id" : "d02b7fa9d5a74e638c1402d0868f71fd",
"organization_policy_assignment_name" : "allowed-images-by-id",
"description" : "The ECS resource is non-compliant if the image it used is not in the allowed list.",
"period" : null,
"policy_filter" : {
"region_id" : null,
"resource_provider" : "evs",
"resource_type" : "volumes",
"resource_id" : null,
"tag_key" : null,
"tag_value" : null
},
"policy_definition_id" : "5fa265c0aa1e6afc05a0ff07",
"parameters" : { },
"created_at" : "2022-01-18T06:37:54.432Z",
"updated_at" : "2022-01-18T06:37:54.432Z"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Operation succeeded. |
| 400 | Invalid parameters. |
| 403 | Authentication failed or you do not have the operation permissions. |
| 500 | Server error. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank 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