All Products
Search
Document Center

:UpdateInstancePolicy

Last Updated:Nov 11, 2024

Modifies a Resource Access Management (RAM) policy for an instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /v2/openapi/updateinstancepolicy HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request body.

InstanceNamestringYes

The name of the instance.

my-test-12345
PolicystringYes

The instance policy in the JSON format.

{ "Version": "1", "Statement": [ { "Action": [ "ots:*" ], "Resource": [ "acs:ots:*:13791xxxxxxxxxxx:instance/myinstance*" ], "Principal": [ "*" ], "Effect": "Allow", "Condition": { "StringEquals": { "ots:TLSVersion": [ "1.2" ] }, "IpAddress": { "acs:SourceIp": [ "192.168.0.1", "172.16.0.1" ] } } } ] }
PolicyVersionlongYes

The version of the instance policy.

2

Response parameters

ParameterTypeDescriptionExample
object

The returned struct.

requestIdstring

The request ID, which can be used to troubleshoot issues.

31D8120C-AC52-5CA9-BE4A-E4C6316E19AD
Codestring

The HTTP status code.

200
Messagestring

The response message.

success

Examples

Sample success responses

JSONformat

{
  "requestId": "31D8120C-AC52-5CA9-BE4A-E4C6316E19AD",
  "Code": "200",
  "Message": "success"
}

Error codes

For a list of error codes, visit the Service error codes.