查詢角色列表
更新時間 2025-06-11 14:55:29
最近更新時間: 2025-06-11 14:55:29
分享文章
接口介紹
獲取角色列表
接口約束
支持的線上資源池 :合肥2、西安5
URI
GET /v4/oss/list-roles
請求參數
請求 Query 參數
| 參數 | 是否必填 | 參數類型 | 說明 | 示例 |
|---|---|---|---|---|
| regionID | 是 | String | 區域 ID | 332232eb-63aa-465e-9028-52e5123866f0 |
| keyword | 否 | String | 模糊查詢角色名,不區分大小寫 | ro |
| pageSize | 否 | Integer | 單頁數量,取值范圍 1~50,默認值為10 | 6 |
| page | 否 | Integer | 頁碼,若與參數 pageNo 同時存在,以 pageNo 為準,默認值為1 | 2 |
| pageNo | 否 | Integer | 頁碼,默認值為1 | 2 |
響應參數
| 參數 | 參數類型 | 說明 | 示例 |
|---|---|---|---|
| statusCode | Integer | 返回碼 取值范圍:800 成功 |
800 |
| message | String | 狀態描述 | SUCCESS |
| returnObj | Object | 響應對象 | 見下級對象 |
| description | String | 狀態描述,一般為中文 | 成功 |
| errorCode | String | 業務細分碼(僅失敗時具有此參數),為product.module.code三段式碼 | openapi.userPermission.accessFailed |
表 returnObj
| 參數 | 參數類型 | 說明 | 示例 |
|---|---|---|---|
| totalCount | Integer | 總數 | 20 |
| currentCount | Integer | 當前頁記錄數 | 20 |
| status | Bool | 角色狀態 | ture |
| fuser_last_updated | String | 最近更新時間 | 2023-03-31T06:42:44Z |
| role_arn | String | 角色arn | arn:aws:iam:::role/role-zs1 |
| policy_name | Array of Objects | 該角色下綁定的策略列表 | 見下級對象 |
| note | String | 角色備注 | role_note1 |
| role_name | String | 角色名 | role1 |
| created_time | String | 角色創建時間 | 2023-05-08T08:46:28Z |
表 policy_name
| 參數 | 參數類型 | 說明 | 示例 |
|---|---|---|---|
| note | String | 策略備注 | policy_note1 |
| bind_date | String | 策略綁定時間 | 2023-05-09T01:29:43Z |
| policy_name | String | 策略名 | policy1 |
請求示例
{
"regionID": "332232eb-63aa-465e-9028-52e5123866f0",
"pageSize": 4,
"page":2,
"pageNo":2,
"keyword": "role"
}
響應示例
{
"message": "SUCCESS",
"description": "成功",
"statusCode": 800,
"returnObj": {
"totalCount": 4,
"currentCount": 2,
"result": [
{
"status": true,
"fuser_last_updated": "2023-05-09T01:29:43Z",
"role_arn": "arn:aws:iam:::role/role-xxx",
"policy_name": [
{
"note": "",
"bind_date": "2023-05-09T01:29:43Z",
"policy_name": "policy1"
}
],
"note": "",
"role_name": "role1",
"created_time": "2023-05-08T08:46:28Z"
},
{
"status": true,
"fuser_last_updated": "2023-05-15T09:29:46Z",
"role_arn": "arn:aws:iam:::role/role-xxx",
"policy_name": [],
"note": "",
"role_name": "role2",
"created_time": "2023-05-15T09:29:46Z"
},
{
"status": true,
"fuser_last_updated": "2023-05-10T08:22:26Z",
"role_arn": "arn:aws:iam:::role/role-xxx",
"policy_name": [],
"note": "",
"role_name": "role3",
"created_time": "2023-05-10T08:22:26Z"
},
{
"status": true,
"fuser_last_updated": "2023-05-11T09:14:53Z",
"role_arn": "arn:aws:iam:::role/role-xxx",
"policy_name": [],
"note": "",
"role_name": "role4",
"created_time": "2023-05-11T09:14:53Z"
}
]
}
}
狀態碼
| 狀態碼 | 描述 |
|---|---|
| 800 | 表示請求成功。 |
| 900 | 表示請求失敗。 |
錯誤碼
errorCode 枚舉值,見錯誤碼總表