文档中心

分离用户策略(DetachUserPolicy)

描述

为指定用户分离指定策略

返回API概览

请求参数

名称 类型 必须 长度限制(字符) 参数格式 描述
Action String 确定值 [a-zA-Z]+ 操作接口名,系统规定参数,取值:DetachUserPolicy
PolicyKrn String 最短是25,最长2048 格式:krn:ksc:iam::account-id:policy/policy-name 待分离的策略标识
UserName String 最短1,最长64 [\w+=,.@-]+ 策略的分离目标用户名

返回元素(调用成功)

错误码(调用不成功)

错误代码(Code) 错误消息(Message) HTTP 状态码 中文描述(语义)
InvalidParameterValue An value must be supplied for the input parameter %s. 400 输入参数%s的值不能为空,具体参数名在%s说明
InvalidParameterValue An invalid or out-of-range value was supplied for the input parameter %s. 400 输入参数 %s的值无效、不合法或者超出范围,具体参数名在%s说明
PolicyNoSuchEntity The request was rejected because it referenced 'Policy' that does not exist. 404 请求被拒绝,因其引用的“策略”不存在
UserNoSuchEntity The request was rejected because it referenced 'User' that does not exist. 404 请求被拒绝,因其引用的“用户”不存在
UserPolicyNoSuchEntity The request was rejected because the user does not attach the policy. 404 请求被拒绝,因用户没有该策略

示例(调用成功)

请求示例
https://iam.api.ksyun.com/?Action=DetachUserPolicy
&PolicyKrn=krn:ksc:iam::12345678901234567890:policy/IAMadmin
&UserName=Bob
&公共请求参数
返回示例
  • XML格式
<DetachUserPolicyResponse>
    <ResponseMetadata>
        <RequestId>72156b58-b22f-4d07-86a6-bdb0219f5e4b</RequestId>
    </ResponseMetadata>
</DetachUserPolicyResponse>
  • JSON示例
{
    "ResponseMetadata": {
        "RequestId": "f8008e55-ad42-4c6c-bdfd-33a4e1368daf"
    }
}