新建子用户

最近更新时间:2018-03-16 15:49:38

新建用户(CreateUser)

描述

新建IAM用户

返回API概览

请求参数 {#请求参数}
名称 类型 必须 长度限制(字符) 参数格式 描述
Action String 确定值 [a-zA-Z]+ 操作接口名,系统规定参数,取值:CreateUser
Path String 最短1,最长512 \/ or \/[:graph:]+\/ 可选参数,用户名的路径,如果未传入则默认值是/
UserName String 最短1,最长64 [\w+=,.@-]+ 待创建的IAM用户的用户名
RealName String 最短2,最长128 [\u4e00-\u9fff]+ 待创建的IAM用户的真实姓名
Phone String 11位 `(13\|14\|15\|17\|18)\d{9}` 手机号
Email String 最短2,最长255 `([a-z0-9A-Z]+[-\|.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?.)+[a-zA-Z]{2,}` 邮箱
Remark String 最短0,最长128 中英文可见字符 备注
返回元素(调用成功) {#返回元素(调用成功)}
错误码(调用不成功) {#错误码(调用不成功)}
错误代码 描述 HTTP 状态码 语义
MissingParameter A required parameter for the specified action is not supplied. 400 忘记输入参数,具体参数名在错误消息中说明(UserName)
InvalidParameterValue An invalid or out-of-range value was supplied for the input parameter. 400 参数格式/取值范围不对,具体参数名在错误消息中说明(UserName,Path,RealName)
EntityAlreadyExists The request was rejected because it attempted to create a resource that already exists 409 资源已经存在,具体实体名称在错误消息中说明(UserName)
LimitExceeded The request was rejected because it attempted to create resources beyond the current Ksyun account limits 409 资源数量超过限制,具体限制在错误消息中说明(User数量是100)
示例(调用成功)
请求示例
https://iam.ksyun.com/?Action=CreateUser&Path=/division_abc/subdivision_xyz/
&UserName=Bob&RealName=金山云&公共请求参数
返回示例
  • XML格式
    <CreateUserResponse xmlns="https://iam.ksyun.com/doc/2015-11-01/">
    <CreateUserResult>
    <User>
      <UserId>待确定类型和位数</UserId>
      <Path>/division_abc/subdivision_xyz/</Path>
      <UserName>Bob</UserName>
      <Krn>krn:ksc:iam::12345678901234567890:user/division_abc/subdivision_xyz/Bob</Krn>
      <RealName>金山云</RealName>
      <CreateDate>2015-11-01T12:00:00Z</CreateDate>
      <Phone>13300001111</Phone>
      <Email>asdfsaf@sdc.com<Email>
      <PhoneVerified>Yes</PhoneVerified>
      <EmailVerified>No</EmailVerified>
      <Remark>adfasdf</Remark>
    </User>
    </CreateUserResult>
    <ResponseMetadata>
    <RequestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestId>
    </ResponseMetadata>
    </CreateUserResponse>
  • JSON示例
    {
    "RequestId":"7a62c49f-347e-4fc4-9331-6e8eEXAMPLE",
    "User":{
        "UserId":"待确定类型和位数",
        "Path":"/division_abc/subdivision_xyz/",
        "UserName":"Bob",
        "Krn":"krn:ksc:iam::12345678901234567890:user/division_abc/subdivision_xyz/Bob",
        "RealName":"金山云",
        "CreateDate":"2015-11-01T12:00:00Z",
        "Phone":"13300001111",
        "Email":"asdfsaf@sdc.com",
        "PhoneVerified":"Yes",
        "EmailVerified":"No",
        "Remark":"adfasdf"
    }
    }

金山云,开启您的云计算之旅

注册有礼