介面描述

列出角色

請求參數

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"
                }
            ]
        }
    }