调用CreatePolicy创建一个权限策略。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
PolicyName | string | 是 | 权限策略名称。 长度为 1~128 个字符,可包含英文字母、数字和短划线(-)。 | OSS-Administrator |
Description | string | 否 | 权限策略描述。 长度为 1~1024 个字符。 | OSS管理员权限 |
PolicyDocument | string | 是 | 权限策略内容。 长度为 1~2048 个字符。 | { "Statement": [{ "Action": ["oss:*"], "Effect": "Allow", "Resource": ["acs:oss:*:*:*"]}], "Version": "1"} |
返回参数
示例
正常返回示例
JSON
格式
{
"Policy": {
"CreateDate": "2015-01-23T12:33:18Z",
"DefaultVersion": "v1",
"Description": "OSS管理员权限",
"PolicyName": "OSS-Administrator",
"PolicyType": "Custom"
},
"RequestId": "9B34724D-54B0-4A51-B34D-4512372FE1BE"
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParameter.PolicyName.InvalidChars | The policy name contains invalid characters. It must only contain upper or lower case letters, numbers, and dash (-). | 策略名称包含非法字符。策略名称仅可包含大小写字母、数字以及中划线(-)。 |
400 | InvalidParameter.PolicyName.Length | The length of the policy name is invalid. It must be 1 to 128 characters in length. | 策略名称长度不符合要求。策略名称长度必须在1~128个字符之间。 |
400 | InvalidParameter.PolicyDocument.Length | The maximum length of the policy document is exceeded. It must not exceed 2048 characters. | - |
400 | InvalidParameter.Description.Length | The maximum length of the description is exceeded. It must not exceed 1024 characters. | 描述长度超限。最大不得超过1024个字符。 |
409 | MalformedPolicyDocument | The policy format is invalid. | 策略格式错误。 |
409 | EntityAlreadyExists.Policy | The policy already exists. | 权限策略已存在。 |
409 | LimitExceeded.Policy | The maximum number of policies is exceeded. | 权限策略数超出限制。 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|
暂无变更历史