查詢PolarDB叢集日誌資訊,如主備切換日誌。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
polardb:DescribeDBLogFiles |
list |
*DBCluster
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| DBClusterId |
string |
是 |
叢集 ID。 |
pc-************* |
| DBNodeId |
string |
否 |
PolarDB 叢集中節點的 ID。 |
pi-************* |
| PageNumber |
integer |
否 |
頁碼,取值範圍為大於 0 且不超過 Integer 的最大值的整數,預設值為 1。 |
1 |
| PageSize |
integer |
否 |
每頁記錄數,取值:5 ~ 50。預設值:10。 |
10 |
| StartTime |
string |
否 |
查詢開始時間。格式: |
2023-08-20T16:00:00Z |
| EndTime |
string |
否 |
查詢結束時間。格式: |
2023-09-20T16:00:00Z |
| LogType |
string |
是 |
日誌類型,可選值:
枚舉值:
|
HaSwitchLogList |
| DescribeSimulateSwitchMode |
string |
否 |
演練記錄的模式,可選值:
|
0 |
| SimulateListId |
string |
否 |
邏輯執行個體演練記錄 ID |
"95" |
| SimulateStatusList |
string |
否 |
演練狀態列表:
|
"0,1,2,3,4,5" |
| SimulateModeList |
string |
否 |
演練模式列表,可選值:
|
0,1,2 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| TotalRecords |
integer |
總記錄數。 |
1 |
| ItemsNumbers |
integer |
當前頁查詢日誌列表內的 Item 數量。 |
1 |
| PageNumber |
integer |
頁碼,取值為大於 0 且不超過 整數資料類型的最大值,預設值為 1。 |
1 |
| DBInstanceName |
string |
邏輯執行個體名稱。 |
pc-**************** |
| DBInstanceType |
string |
執行個體類型,取值說明:
|
polardb_mysql_rw |
| HaStatus |
integer |
主備切換記錄是否存在。取值說明
枚舉值:
|
1 |
| HaLogItems |
array<object> |
主備切換日誌列表。 |
|
|
object |
主備切換日誌。 |
||
| SwitchId |
string |
主備切換日誌 ID。 |
e571f897-9b3c-4012-9470-88333832dec4 |
| FromDBType |
string |
切換前執行個體類型,取值說明:
|
polardb_mysql_rw |
| SwitchCauseCode |
string |
切換原因錯誤碼。 |
Platform.Ha.AuroraService.ManualOperations |
| SwitchCauseDetail |
string |
切換原因詳情。 |
Platform.Ha.ManuallyTriggered |
| SwitchStartTime |
string |
切換開始時間。格式: |
2025-05-20T03:09:45Z |
| SwitchFinishTime |
string |
切換結束時間。格式: |
2025-05-20T03:09:56Z |
| TotalSessions |
integer |
切換時總會話數。 |
10000 |
| AffectedSessions |
integer |
切換時影響會話數。 |
100 |
| SwitchType |
integer |
切換類型。 |
0 |
| RequestId |
string |
請求 ID。 |
24A1990B-4F6E-482B-B8CB-75C612****** |
| PageSize |
integer |
每頁記錄數,取值:5~50。預設值:10。 |
10 |
| SwitchListItems |
array<object> |
故障演練記錄列表。 |
|
|
array<object> |
演練記錄。 |
||
| SimulateListId |
string |
邏輯執行個體演練記錄 ID。 |
23 |
| SimulateMode |
string |
演練模式。 |
0 |
| SimulateStatus |
string |
演練狀態。
|
2 |
| StartTime |
string |
切換開始時間。格式: |
2025-02-25T01:05:00Z |
| EndTime |
string |
切換結束時間。格式: |
2025-02-10T02:25:00Z |
| EventStartTime |
string |
系統事件開始時間。格式: |
2025-04-19T01:12:00Z |
| EventFinishTime |
string |
系統事件結束時間。格式: |
2025-04-19T02:12:00Z |
| SimulateTaskId |
string |
演練任務 ID |
23 |
| DBNodeCrashList |
array |
演練節點執行個體名列表。 說明
節點維度演練只支援單個節點,可用性區域維度演練可不傳該參數,或傳入所有節點。 |
|
|
string |
演練節點執行個體。 |
pi-bp19v6xsl0u2c1cqq,pi-bp1ap84xmpf4c1c1t |
|
| SwitchLogItems |
array<object> |
故障演練日誌列表。 |
|
|
array<object> |
故障演練日誌。 |
||
| SimulateListId |
string |
演練列表 ID。 |
96 |
| SimulateLogId |
string |
演練日誌 ID。 |
23 |
| DBInstanceId |
string |
叢集 ID。 說明
您可以通過 DescribeDBClusters 介面查看帳號下所有叢集的詳細資料(如叢集 ID)。 |
pc-************* |
| SrcDbType |
string |
來源資料庫類型。取值如下:
|
PolarDBMySQL |
| DstDbType |
string |
目標資料庫類型。取值如下:
|
PolarDBMySQL |
| SimulateStatus |
string |
演練狀態。
|
1 |
| EventStartTime |
string |
系統事件開始時間。格式: |
2025-04-19T01:12:00Z |
| EventFinishTime |
string |
系統事件結束時間。格式: |
2025-04-19T02:12:00Z |
| SwitchStepItems |
array<object> |
故障演練步驟列表。 |
|
|
object |
故障演練步驟。 |
||
| StepName |
string |
當前執行的步驟名。您可以通過 DescribeHistoryTasks 查詢指定任務 ID 當前的執行步驟。常見取值do_pause表示等待預設時間執行。 |
init_task_info |
| StartTime |
string |
查詢開始時間。格式: |
2025-04-19T02:12:00Z |
| SimulatePhase |
string |
演練階段。
|
PolarDB.MySQL.FaultSimulate.Phase.FAULT_INJECTION |
| EndTime |
string |
查詢結束時間。格式: |
2025-08-14T02:07:00Z |
| TimeCost |
string |
請求處理的耗時,單位毫秒(ms)。 |
1000 |
| IsSuccess |
string |
是否調用 API 成功,取值:
|
true |
| SwitchStepItems |
array<object> |
切換步驟列表。 |
|
|
object |
|||
| SimulatePhase |
string |
演練階段。
|
PolarDB.MySQL.FaultSimulate.Phase.FAULT_INJECTION |
| StepName |
string |
當前執行的步驟名。您可以通過 DescribeHistoryTasks 查詢指定任務 ID 當前的執行步驟。常見取值do_pause表示等待預設時間執行。 |
init_task_info |
| StartTime |
string |
步驟開始時間。格式為 |
2025-07-16T02:12:00Z |
| EndTime |
string |
步驟結束時間。格式為 |
2025-07-23T02:30:00Z |
| TimeCost |
string |
請求處理的耗時,單位毫秒(ms)。 |
1000 |
| IsSuccess |
string |
更新連絡人是否成功,取值:
|
true |
| DBNodeId |
string |
資料庫叢集節點 ID。 說明
當請求參數中 |
pi-************* |
| FaultInjectionType |
string |
故障注入方式。取值範圍如下:
|
CrashSQLInjection |
| SwitchLogItems |
array<object> |
故障演練日誌列表。 |
|
|
array<object> |
故障演練日誌。 |
||
| SimulateListId |
string |
演練列表 ID。 |
231 |
| Simulatecode |
string |
演練狀態。 |
0 |
| DBInstanceId |
string |
叢集 ID。 說明
您可以通過 DescribeDBClusters 介面查看帳號下所有叢集的詳細資料(如叢集 ID)。 |
pc-************* |
| SrcDbType |
string |
來源資料庫類型。取值如下:
|
PolarDBMySQL |
| DstDbType |
string |
目標資料庫類型。取值如下:
|
PolarDBMySQL |
| SimulateStatus |
string |
演練狀態。
|
1 |
| EventStartTime |
string |
系統事件開始時間。格式: |
2025-04-19T01:12:00Z |
| EventFinishTime |
string |
系統事件結束時間。格式: |
2025-04-19T02:12:00Z |
| SwitchStepItems |
array<object> |
切換步驟列表。 |
|
|
object |
|||
| StepName |
string |
步驟名稱。 |
init_task_info |
| StepMsg |
string |
步驟資訊。 |
This step exec success |
| StartTime |
string |
步驟開始時間。格式: |
2024-10-21T02:12:00Z |
| EndTime |
string |
步驟結束時間。格式: |
2025-03-27T02:27:00Z |
| TimeCost |
string |
請求處理的耗時,單位毫秒(ms)。 |
1000 |
| IsSuccess |
string |
調用是否成功,取值:
|
true |
| SimulatePhase |
string |
演練階段。
|
PolarDB.MySQL.FaultSimulate.Phase.FAULT_INJECTION |
| DBNodeId |
string |
節點 ID。 說明
|
pi-************* |
樣本
正常返回樣本
JSON格式
{
"TotalRecords": 1,
"ItemsNumbers": 1,
"PageNumber": 1,
"DBInstanceName": "pc-****************",
"DBInstanceType": "polardb_mysql_rw",
"HaStatus": 1,
"HaLogItems": [
{
"SwitchId": "e571f897-9b3c-4012-9470-88333832dec4",
"FromDBType": "polardb_mysql_rw",
"SwitchCauseCode": "Platform.Ha.AuroraService.ManualOperations",
"SwitchCauseDetail": "Platform.Ha.ManuallyTriggered",
"SwitchStartTime": "2025-05-20T03:09:45Z",
"SwitchFinishTime": "2025-05-20T03:09:56Z",
"TotalSessions": 10000,
"AffectedSessions": 100,
"SwitchType": 0
}
],
"RequestId": "24A1990B-4F6E-482B-B8CB-75C612******",
"PageSize": 10,
"SwitchListItems": [
{
"SimulateListId": "23",
"SimulateMode": "0",
"SimulateStatus": "2",
"StartTime": "2025-02-25T01:05:00Z",
"EndTime": "2025-02-10T02:25:00Z",
"EventStartTime": "2025-04-19T01:12:00Z",
"EventFinishTime": "2025-04-19T02:12:00Z",
"SimulateTaskId": "23",
"DBNodeCrashList": [
"pi-bp19v6xsl0u2c1cqq,pi-bp1ap84xmpf4c1c1t"
],
"SwitchLogItems": [
{
"SimulateListId": "96",
"SimulateLogId": "23",
"DBInstanceId": "pc-*************",
"SrcDbType": "PolarDBMySQL",
"DstDbType": "PolarDBMySQL",
"SimulateStatus": "1",
"EventStartTime": "2025-04-19T01:12:00Z",
"EventFinishTime": "2025-04-19T02:12:00Z\n",
"SwitchStepItems": [
{
"StepName": "init_task_info",
"StartTime": "2025-04-19T02:12:00Z",
"SimulatePhase": "PolarDB.MySQL.FaultSimulate.Phase.FAULT_INJECTION",
"EndTime": "2025-08-14T02:07:00Z",
"TimeCost": "1000",
"IsSuccess": "true"
}
]
}
],
"SwitchStepItems": [
{
"SimulatePhase": "PolarDB.MySQL.FaultSimulate.Phase.FAULT_INJECTION",
"StepName": "init_task_info",
"StartTime": "2025-07-16T02:12:00Z",
"EndTime": "2025-07-23T02:30:00Z",
"TimeCost": "1000",
"IsSuccess": "true",
"DBNodeId": "pi-*************"
}
],
"FaultInjectionType": "CrashSQLInjection"
}
],
"SwitchLogItems": [
{
"SimulateListId": "231",
"Simulatecode": "0",
"DBInstanceId": "pc-*************",
"SrcDbType": "PolarDBMySQL",
"DstDbType": "PolarDBMySQL",
"SimulateStatus": "1",
"EventStartTime": "2025-04-19T01:12:00Z",
"EventFinishTime": "2025-04-19T02:12:00Z",
"SwitchStepItems": [
{
"StepName": "init_task_info",
"StepMsg": "This step exec success ",
"StartTime": "2024-10-21T02:12:00Z",
"EndTime": "2025-03-27T02:27:00Z",
"TimeCost": "1000",
"IsSuccess": "true",
"SimulatePhase": "PolarDB.MySQL.FaultSimulate.Phase.FAULT_INJECTION",
"DBNodeId": "pi-*************"
}
]
}
]
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidDBClusterId.Malformed | The specified parameter DBClusterId is not valid. | |
| 400 | InvalidPageSize.Malformed | The specified parameter PageSize is not valid. | 指定的參數PageSize無效 |
| 400 | InvalidPageNumber.Malformed | The specified parameter PageNumber is not valid. | 指定的參數PageNumber無效 |
| 404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | 當前的記錄中不存在提供的DBClusterId。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。