All Products
Search
Document Center

:CheckInstancePolicy

Last Updated:Nov 11, 2024

Checks the validity of 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/checkinstancepolicy HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request body.

InstanceNamestringYes

The name of the instance.

workshop-bj-ots1
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" ] } } } ] }

Response parameters

ParameterTypeDescriptionExample
object

The returned struct.

RequestIdstring

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

757E172A-F94B-5E78-8A23-D9068E42F2E9
Codestring

The HTTP status code.

OK
Messagestring

The response message.

Verification passed.

Examples

Sample success responses

JSONformat

{
  "RequestId": "757E172A-F94B-5E78-8A23-D9068E42F2E9",
  "Code": "OK",
  "Message": "Verification passed."
}

Error codes

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