接口描述

列出角色

请求参数

Action
  • 类型:String
  • 必须:是
  • 描述:系统规定参数,取值:ListRoles

返回参数

Roles
  • 类型:Role Array
  • 描述:角色名称列表

需要的权限

Action
ram:ListRoles
Resource
acs:ram:*:${AccountId}:role/*

操作示例

请求示例
https://ram.aliyuncs.com/?Action=ListRoles
&<公共请求参数>
返回示例
  • XML格式
    <ListRolesResponse>
        <RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
        <Roles>
            <Role>
                <RoleId>901234567890123</RoleId>
                <RoleName>ECSAdmin</RoleName>
                <Arn>acs:ram::1234567890123456:role/ECSAdmin</Arn>
                <Description>ECS管理角色</Description>
                <CreateDate>2015-01-23T12:33:18Z</CreateDate>
                <UpdateDate>2015-01-23T12:33:18Z</UpdateDate>
            </Role>
            <Role>
                <RoleId>901234567890456</RoleId>
                <RoleName>OSSReadonlyAccess</RoleName>
                <Arn>acs:ram::1234567890123456:role/OSSReadonlyAccess</Arn>
                <Description>OSS只读访问角色</Description>
                <CreateDate>2015-01-23T12:33:18Z</CreateDate>
                <UpdateDate>2015-01-23T12:33:18Z</UpdateDate>
            </Role>
        </Roles>
    </ListRolesResponse>
  • JSON格式
    {
        "RequestId": "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
        "Roles": {
            "Role": [
                {
                    "RoleId": "901234567890123",
                    "RoleName": "ECSAdmin",
                    "Arn": "acs:ram::1234567890123456:role/ECSAdmin",
                    "Description": "ECS管理角色",
                    "CreateDate": "2015-01-23T12:33:18Z",
                    "UpdateDate": "2015-01-23T12:33:18Z"
                },
                {
                    "RoleId": "901234567890456",
                    "RoleName": "OSSReadonlyAccess",
                    "Arn": "acs:ram::1234567890123456:role/OSSReadonlyAccess",
                    "Description": "OSS只读访问角色",
                    "CreateDate": "2015-01-23T12:33:18Z",
                    "UpdateDate": "2015-01-23T12:33:18Z"
                }
            ]
        }
    }