Creates a version for a policy.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreatePolicyVersion |
The operation that you want to perform. Set the value to CreatePolicyVersion. |
PolicyName | String | Yes | OSS-Administrator |
The name of the policy. |
PolicyDocument | String | Yes | {"Statement":[{"Action":["oss:*"],"Effect":"Allow","Resource":["acs:oss:*:*:*"]}],"Version":"1"} |
The document of the policy. The document can be up to 6,144 bytes in length. |
SetAsDefault | Boolean | No | false |
Specifies whether to set this policy as the default policy. Default value: |
RotateStrategy | String | No | None |
The rotation strategy of the policy. The rotation strategy can be used to delete an early policy version. Valid values:
Default value: |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
PolicyVersion | Object |
The information about the policy version. |
|
IsDefaultVersion | Boolean | false |
Indicates whether the policy version is the default version. |
PolicyDocument | String | { "Statement": [{ "Action": ["oss:*"], "Effect": "Allow", "Resource": ["acs:oss:*:*:*"]}], "Version": "1"} |
The document of the policy. |
VersionId | String | v3 |
The ID of the policy version. |
CreateDate | String | 2015-01-23T12:33:18Z |
The time when the policy version was created. |
RequestId | String | 9B34724D-54B0-4A51-B34D-4512372FE1BE |
The ID of the request. |
Examples
Sample requests
https://ram.aliyuncs.com/?Action=CreatePolicyVersion
&PolicyName=OSS-Administrator
&PolicyDocument={"Statement":[{"Action":["oss:*"],"Effect":"Allow","Resource":["acs:oss:*:*:*"]}],"Version":"1"}
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreatePolicyVersionResponse>
<RequestId>9B34724D-54B0-4A51-B34D-4512372FE1BE</RequestId>
<PolicyVersion>
<VersionId>v3</VersionId>
<IsDefaultVersion>false</IsDefaultVersion>
<CreateDate>2015-01-23T12:33:18Z</CreateDate>
<PolicyDocument>{ "Statement": [{ "Action": ["oss:*"], "Effect": "Allow", "Resource": ["acs:oss:*:*:*"]}], "Version": "1"}</PolicyDocument>
</PolicyVersion>
</CreatePolicyVersionResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "9B34724D-54B0-4A51-B34D-4512372FE1BE",
"PolicyVersion" : {
"VersionId" : "v3",
"IsDefaultVersion" : false,
"CreateDate" : "2015-01-23T12:33:18Z",
"PolicyDocument" : "{ \"Statement\": [{ \"Action\": [\"oss:*\"], \"Effect\": \"Allow\", \"Resource\": [\"acs:oss:*:*:*\"]}], \"Version\": \"1\"}"
}
}
Error codes
For a list of error codes, visit the API Error Center.