全部產品
Search
文件中心

ActionTrail:GetTrailStatus

更新時間:Jan 16, 2025

調用GetTrailStatus介面查詢跟蹤的狀態。

本文將提供一個樣本,查詢名為trail-test的跟蹤的狀態。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

請求參數

名稱 類型 是否必選 樣本值 描述
Action String GetTrailStatus

要執行的操作,取值:GetTrailStatus。

Name String trail-test

跟蹤名稱。

長度為6~36個字元,必須以小寫英文字母開頭,可包含小寫英文字母、數字、短劃線(-)和底線(_)。

說明 同一帳號內跟蹤名稱不可重複。
IsOrganizationTrail Boolean false

是否查詢多帳號跟蹤的狀態。取值:

  • true:查詢多帳號跟蹤的狀態。
  • false(預設值):不查詢多帳號跟蹤的狀態,即查詢單帳號跟蹤的狀態。

關於公用請求參數的詳情,請參見公用參數

返回資料

名稱 類型 樣本值 描述
RequestId String 8FFD2DE7-74F0-4582-A4CB-BF6523FEF06C

請求ID。

StartLoggingTime String 2021-03-31T04:06:41Z

使用者上一次開啟該跟蹤的時間。

LatestDeliveryError String write sls failed, exception: the parent of sub user must be project owner, itemscount: 1

最後一次行為追蹤異常的日誌資訊。

StopLoggingTime String 2021-04-02T02:36:56Z

使用者上一次停止該跟蹤的時間。

IsLogging Boolean false

是否開啟日誌記錄。

LatestDeliveryTime String 1547792223000

最後一次成功記錄行為的時間。

樣本

請求樣本

http(s)://[Endpoint]/?Action=GetTrailStatus
&Name=trail-test
&公用請求參數

正常返回樣本

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<GetTrailStatusResponse>
    <RequestId>8FFD2DE7-74F0-4582-A4CB-BF6523FEF06C</RequestId>
    <StartLoggingTime>2021-03-31T04:06:41Z</StartLoggingTime>
    <LatestDeliveryError>write sls failed, exception: the parent of sub user must be project owner, itemscount: 1</LatestDeliveryError>
    <StopLoggingTime>2021-04-02T02:36:56Z</StopLoggingTime>
    <IsLogging>false</IsLogging>
</GetTrailStatusResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "8FFD2DE7-74F0-4582-A4CB-BF6523FEF06C",
  "StartLoggingTime" : "2021-03-31T04:06:41Z",
  "LatestDeliveryError" : "write sls failed, exception: the parent of sub user must be project owner, itemscount: 1",
  "StopLoggingTime" : "2021-04-02T02:36:56Z",
  "IsLogging" : false
}

錯誤碼

HttpCode 錯誤碼 錯誤資訊 描述
404 TrailNotFoundException The specified Trail does not exist. 指定的跟蹤不存在。

訪問錯誤中心查看更多錯誤碼。