閱讀899 返回首頁    go 小米 go 小米路由器


AttachPolicyToRole__授權策略管理接口_RAM API文檔_訪問控製-阿裏雲

接口描述

 為指定角色附加授權

請求參數

Action

  • 類型:String
  • 必須:是
  • 描述:係統規定參數,取值:AttachPolicyToRole

PolicyType

  • 類型:String
  • 必須:是
  • 描述:指定Policy的類型, 取值System或Custom

PolicyName

  • 類型:String
  • 必須:是
  • 描述:指定授權策略名稱

RoleName

  • 類型:String
  • 必須:是
  • 描述:指定角色名。例:dev

返回參數

  隻有公共返回參數,詳見公共返回參數

需要的權限

Action

ram:AttachPolicyToRole

Resource

acs:ram:*:${AccountId}:role/${RoleName}

acs:ram:*:${AccountId} or system:policy/${PolicyName}

錯誤信息

InvalidParameter.RoleName.InvalidChars
  • HTTP Status:400
  • Error Message:The parameter - "RoleName" contains invalid chars.
InvalidParameter.RoleName.Length
  • HTTP Status:400
  • Error Message:The parameter - "RoleName" beyond the length limit.
InvalidParameter.PolicyType
  • HTTP Status:400
  • Error Message:The parameter - "PolicyType" is incorrect.
InvalidParameter.PolicyName.InvalidChars
  • HTTP Status:400
  • Error Message:The parameter - "PolicyNam" contains invalid chars.
InvalidParameter.PolicyName.Length
  • HTTP Status:400
  • Error Message:The parameter - "PolicyName" beyond the length limit.
EntityNotExist.Role
  • HTTP Status:404
  • Error Message:The role does not exist.
EntityNotExist.Policy
  • HTTP Status:404
  • Error Message:The policy does not exist.
EntityAlreadyExists.Role.Policy
  • HTTP Status:409
  • Error Message:The role has already been attached this policy.
LimitExceeded.Role.Policy
  • HTTP Status:409
  • Error Message:The policy count of the role beyond the current limits.

操作示例

請求示例

https://ram.aliyuncs.com/?Action=AttachPolicyToRole
&PolicyType=Custom
&PolicyName=OSS-Administrator
&RoleName=OSSAdminRole
&<公共請求參數>

返回示例

XML格式

<AttachPolicyToRoleResponse>
    <RequestId>697852FB-50D7-44D9-9774-530C31EAC572</RequestId>
</AttachPolicyToRoleResponse>

JSON格式

{
    "RequestId": "697852FB-50D7-44D9-9774-530C31EAC572"
}

最後更新:2016-11-23 17:16:05

  上一篇:go DetachPolicyFromGroup__授權策略管理接口_RAM API文檔_訪問控製-阿裏雲
  下一篇:go DetachPolicyFromRole__授權策略管理接口_RAM API文檔_訪問控製-阿裏雲