UpdateAndAttachPolicy
Updates and attaches a policy.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
apig:UpdateAndAttachPolicy |
none |
*Policy
|
None | None |
Request syntax
PUT /v1/policies/{policyId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| policyId |
string |
Yes |
The policy ID. |
p-cq7l5s5lhtgi6qasrdc0 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| name |
string |
No |
The name of the policy. |
test |
| description |
string |
No |
The description of the policy. |
这是策略描述。 |
| config |
string |
Yes |
The policy configuration. The value must be a JSON string. |
{\"enable\":false} |
| attachResourceIds |
array |
Yes |
A list of attachment point IDs. |
|
|
string |
No |
The attachment point ID. |
api-cq2avtllhtgja4dk5djg |
|
| attachResourceType |
string |
Yes |
The type of resource to which the policy is attached. Valid values include:
|
HttpApi |
| environmentId |
string |
No |
The environment ID. |
env-cq2avtllhtgja4dk5djg |
| gatewayId |
string |
No |
The gateway ID. |
gw-cq2avtllhtgja4dk5djg |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| requestId |
string |
The ID of the request, used to trace the API call. |
585657D2-1C20-5B8A-AF17-D727C6490BE4 |
| code |
string |
The response code. |
Ok |
| message |
string |
The response message. |
success |
Examples
Success response
JSON format
{
"requestId": "585657D2-1C20-5B8A-AF17-D727C6490BE4",
"code": "Ok",
"message": "success"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.