全部文档
当前文档

暂无内容

如果没有找到您期望的内容,请尝试其他搜索词

文档中心

创建角色

接口说明

当前接口只支持创建授信实体为金山云账号的角色

请求参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数
参数名称
类型
必填
描述
Action String
公共参数,本接口取值:CreateRole。
Version String
公共参数,本接口取值:2015-11-01。
RoleName String

角色名称

TrustAccounts String

信任账号列表(多个账号之间使用半角逗号(,)分隔,最多可以有20个账号)

Description String

角色描述

返回参数

参数名称
类型
描述
CreateRoleResult Object
Role Object
Path String
示例值:/
Krn String
示例值:krn:ksc:iam::2000143391:role/test_role
RoleName String
示例值:test_role
Description String
TrustAccounts String
示例值:2000143391
CreateDate String
示例值:2021-11-19T09:20:45Z
RoleId String
示例值:H0SMWGpFSHi6mTfPaplUzQ
RequestId String
示例值:2f4e9467-32d0-4d60-9b6c-cbbb13ecf0f9

请求示例

curl -X GET|POST
'http://iam.api.ksyun.com/?Action=CreateRole&Version=2015-11-01'
-H 'authorization: xxx, SignedHeaders=content-type;host;x-amz-date, Signature=xxx'
-H 'cache-control: no-cache'
-H 'content-type: application/x-www-form-urlencoded'
-H 'host: iam.api.ksyun.com'
-H 'x-amz-date: 20170720T022802Z'
-d 'RoleName=xxx&TrustAccounts=xxx&Description=xxx'

返回示例

JSON格式

{
"CreateRoleResult":{
"Role":{
"Path":"/",
"Krn":"krn:ksc:iam::2000143391:role/test_role",
"RoleName":"test_role",
"Description":"",
"TrustAccounts":"2000143391",
"CreateDate":"2021-11-19T09:20:45Z",
"RoleId":"H0SMWGpFSHi6mTfPaplUzQ"
}
},
"RequestId":"2f4e9467-32d0-4d60-9b6c-cbbb13ecf0f9"
}

XML格式

a

错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码

错误码
错误信息
Http状态码
描述
MissingParameterA required parameter for the specified action is not supplied.400忘记输入参数,具体参数名在错误消息中说明(RoleName)
InvalidParameterValueAn invalid or out-of-range value was supplied for the input parameter.400参数格式/取值范围不对,具体参数名在错误消息中说明(RoleName)
LimitExceededThe request was rejected because it attempted to create resources beyond the current Ksyun account limits409资源数量超过限制,具体限制在错误消息中说明
EntityAlreadyExistsThe request was rejected because it attempted to create a resource that already exists409资源已经存在,具体实体名称在错误消息中说明
纯净模式常规模式

纯净模式

点击可全屏预览文档内容