AttachPolicyToUser__授权策略管理接口_RAM API文档_访问控制-阿里云
接口描述
为指定用户附加授权
请求参数
Action
- 类型:String
- 必须:是
- 描述:系统规定参数,取值:AttachPolicyToUser
PolicyType
- 类型:String
- 必须:是
- 描述:指定Policy的类型, 取值System或Custom
PolicyName
- 类型:String
- 必须:是
- 描述:指定授权策略名称
UserName
- 类型:String
- 必须:是
- 描述:指定用户名。例:zhangqiang
返回参数
只有公共返回参数,详见公共返回参数
需要的权限
Action
ram:AttachPolicyToUser
Resource
acs:ram:*:${AccountId}:user/${UserName}
acs:ram:*:${AccountId} or system:policy/${PolicyName}
错误信息
InvalidParameter.UserName.InvalidChars
- HTTP Status:400
- Error Message:The parameter - "UserName" contains invalid chars.
InvalidParameter.UserName.Length
- HTTP Status:400
- Error Message:The parameter - "UserName" beyond the length limit.
EntityNotExist.User
- HTTP Status:404
- Error Message:The user does not exist.
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.Policy
- HTTP Status:404
- Error Message:The policy does not exist.
EntityAlreadyExists.User.Policy
- HTTP Status:409
- Error Message:The user has already been attached this policy.
LimitExceeded.User.Policy
- HTTP Status:409
- Error Message:The policy count of the user attached policies beyond the current limits.
操作示例
请求示例
https://ram.aliyuncs.com/?Action=AttachPolicyToUser
&PolicyType=Custom
&PolicyName=OSS-Administrator
&UserName=zhangqiang
&<公共请求参数>
返回示例
XML
格式
<AttachPolicyToUserResponse>
<RequestId>697852FB-50D7-44D9-9774-530C31EAC572</RequestId>
</AttachPolicyToUserResponse>
JSON
格式
{
"RequestId": "697852FB-50D7-44D9-9774-530C31EAC572"
}
最后更新:2016-11-23 17:16:05
上一篇:
SetDefaultPolicyVersion__授权策略管理接口_RAM API文档_访问控制-阿里云
下一篇:
DetachPolicyFromUser__授权策略管理接口_RAM API文档_访问控制-阿里云
添加加速域名__域名操作接口_API 手册_CDN-阿里云
阿里云异构计算产品家族亮相,覆盖AI全场景和高性能计算需求
FileZilla使用手册__网站上传/下载_使用指南_云虚机主机-阿里云
Hive 作业配置__作业_用户指南_E-MapReduce-阿里云
模板验证失败__常见问题_资源编排-阿里云
创建 NAS 数据卷__数据卷指南_用户指南_容器服务-阿里云
给RAM用户授权__快速入门_访问控制-阿里云
Endpoint签名认证__调用方式_API使用手册_消息服务-阿里云
ALIYUN::ECS::Route__资源列表_资源编排-阿里云
查看监控数据__站点监控_用户指南_云监控-阿里云
相关内容
常见错误说明__附录_大数据计算服务-阿里云
发送短信接口__API使用手册_短信服务-阿里云
接口文档__Android_安全组件教程_移动安全-阿里云
运营商错误码(联通)__常见问题_短信服务-阿里云
设置短信模板__使用手册_短信服务-阿里云
OSS 权限问题及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
消息通知__操作指南_批量计算-阿里云
设备端快速接入(MQTT)__快速开始_阿里云物联网套件-阿里云
查询API调用流量数据__API管理相关接口_API_API 网关-阿里云
使用STS访问__JavaScript-SDK_SDK 参考_对象存储 OSS-阿里云