获取角色列表

所属服务

sam

接口方法

GET

请求url

/sam?Action=ListRoles&Version=2018-03-22

url 参数

参数名称说明参数类型是否必填备注
ActionListRolesstring
Version2018-03-22string

返回参数

参数名称说明参数类型是否必填备注
CodeCodestring
MessageMessagestring
Roles角色列表array详细信息见下表

Roles

参数名称说明参数类型是否必填备注
RoleName角色名称string
Description角色描述string
Nrn角色资源描述符string
AssumeRolePolicyDocument角色授权语法string
CreateTime创建时间string

状态码

错误码(Code)错误提示(Message)http status code说明
ProductNotActive400null

请求示例

https://open.cn-east-1.163yun.com/sam?Action=ListRoles&Version=2018-03-22

返回示例

{
	"Message": "调用成功",
	"RequestId": "40462645-b026-45fc-a2a1-3b1ca14df45f",
	"Roles": [{
		"RoleName": "roletest",
		"Description": "test",
		"Nrn": "ncs:sam::1061934905920847872:role/roletest",
		"AssumeRolePolicyDocument": "{\"version\": 1, \"statement\": [{\"action\": \"sts:assumeRole\", \"effect\": \"allow\", \"principal\": {\"sam\": [\"ncs:sam::1061934905920847872:root\"]}}]}",
		"CreateTime": "2020-01-20T06:45:33Z"
	}, {
		"RoleName": "role1",
		"Description": "测试",
		"Nrn": "ncs:sam::1061934905920847872:role/role1",
		"AssumeRolePolicyDocument": "{\"version\": 1, \"statement\": [{\"action\": \"sts:assumeRole\", \"effect\": \"allow\", \"principal\": {\"sam\": [\"ncs:sam::1061934905920847872:root\"]}}]}",
		"CreateTime": "2020-01-20T06:30:49Z"
	}],
	"Code": "Success"
}