查詢策略列表
更新時間 2025-06-11 14:55:30
最(zui)近(jin)更新時間: 2025-06-11 14:55:30
分享文章
接口介紹
獲取策略列表
接口約束
支持(chi)的線上資源池 :合肥2、西安5
URI
GET /v4/oss/list-policies
請求參數
請(qing)求 Query 參數
| 參數 | 是否必填 | 參數類型 | 說明 | 示例 |
|---|---|---|---|---|
| regionID | 是 | String | 區域 ID | 332232eb-63aa-465e-9028-52e5123866f0 |
| keyword | 否 | String | 模糊查詢策略名,不區分大小寫 | po |
| pageSize | 否 | Integer | 單頁數量,取值范圍 1~50,默認值為10 | 6 |
| page | 否 | Integer | 頁碼, 若與參數 pageNo 同時存在,以 pageNo 為準,默認值為1 | 1 |
| pageNo | 否 | Integer | 頁碼,默認值為1 | 1 |
響應參數
| 參數 | 參數類型 | 說明 | 示例 |
|---|---|---|---|
| statusCode | Integer | 返回碼 取值范圍:800 成功 |
800 |
| message | String | 狀態描述 | SUCCESS |
| returnObj | Object | 響應對象 | 見下級對象 |
| description | String | 狀態描述,一般為中文 | 成功 |
| errorCode | String | 業務細分碼(僅失敗時具有此參數),為product.module.code三段式碼 | openapi.userPermission.accessFailed |
表returnObj
| 參數 | 參數類型 | 說明 | 示例 |
|---|---|---|---|
| totalCount | Integer | 總數 | 3 |
| currentCount | Integer | 當前頁記錄數 | 20 |
| fuser_last_updated | String | 最近更新時間 | 2023-03-31T06:42:44Z |
| policy_document | String | 策略 | 見響應示例 |
| note | String | 策略備注 | policy_note1 |
| created_time | String | 策略創建時間 | 2023-03-31T06:28:24Z |
| policy_name | String | 策略名 | policy1 |
請求示例
{
"regionID": "332232eb-63aa-465e-9028-52e5123866f0",
"pageSize": 3,
"page":1,
"pageNo":1,
"keyword": "plicy"
}
響應示例
{
"message": "SUCCESS",
"description": "成功",
"statusCode": 800,
"returnObj": {
"totalCount": 3,
"currentCount": 10,
"result": [
{
"fuser_last_updated": "2023-03-31T06:28:24Z",
"policy_document": "{\"Version\":\"2012-10-17\",\"Statement\":{\"Action\":[\"s3:ListAllMyBuckets\",\"s3:PutObject\",\"s3:GetObject\"],\"Resource\":[\"arn:aws:s3:::bucket-zs-1/*\"],\"Effect\":\"Allow\"}}",
"note": "",
"created_time": "2023-03-31T06:28:24Z",
"policy_name": "policy1"
},
{
"fuser_last_updated": "2023-04-23T11:18:16Z",
"policy_document": "{\"Version\":\"2012-10-17\",\"Id\":\"policy1\",\"Statement\":{\"Effect\":\"Allow\",\"Sid\":\"policy1\",\"Action\":[\"s3:*\"],\"Principal\":{\"AWS\":[\"arn:aws:iam:::*\"]},\"Resource\":\"arn:aws:s3:::*\"}}",
"note": "",
"created_time": "2023-04-23T11:18:15Z",
"policy_name": "policy2"
},
{
"fuser_last_updated": "2023-04-03T14:44:06Z",
"policy_document": "{\"Version\":\"2012-10-17\",\"Id\":\"DrqfDo\",\"Statement\":{\"Effect\":\"Allow\",\"Sid\":\"DrqfDo\",\"Action\":[\"s3:*\"],\"Principal\":{\"AWS\":[\"arn:aws:iam:::6b670413-5ebf-593a-a985-76d598374df7\"]},\"Condition\":{\"NotIpAddress\":{\"aws:SourceIp\":\"54.240.143.0/24\"}},\"Resource\":\"arn:aws:s3:::bucket-20230322-3/*\"}}",
"note": "",
"created_time": "2023-04-03T14:44:05Z",
"policy_name": "policy3"
}
]
}
}
狀態碼
| 狀態碼 | 描述 |
|---|---|
| 800 | 表示請求成功。 |
| 900 | 表示請求失敗。 |
錯誤碼
errorCode 枚舉值,見錯誤碼總表