共用方式為


取得服務事件清單

取得所有與服務相關的事件。

回應為 ServiceEvent 物件的清單。

要求

方法 要求 URI
GET /EventsStore/Services/Events?api-version=6.4&timeout={timeout}&StartTimeUtc={StartTimeUtc}&EndTimeUtc={EndTimeUtc}&EventsTypesFilter={EventsTypesFilter}&ExcludeAnalysisEvents={ExcludeAnalysisEvents}&SkipCorrelationLookup={SkipCorrelationLookup}

參數

名稱 類型 必要 Location
api-version 字串 查詢
timeout 整數 (int64) No 查詢
StartTimeUtc string 查詢
EndTimeUtc string 查詢
EventsTypesFilter 字串 No 查詢
ExcludeAnalysisEvents boolean No 查詢
SkipCorrelationLookup boolean No 查詢

api-version

類型:字串
必要:是
預設6.4

API 的版本。 這是必要參數,其值必須是 '6.4'。

Service Fabric REST API 版本是以 API 引進或變更的執行時間版本為基礎。 Service Fabric 執行時間支援多個版本的 API。 此版本是 API 的最新支援版本。 如果傳遞較低的 API 版本,傳回的回應可能會與本規格中所述的回應不同。

此外,執行時間也接受高於最新支援版本的任何版本,最高為目前版本的執行時間。 因此,如果最新的 API 版本是 6.0,而執行時間是 6.1,則執行時間將會接受該 API 的版本 6.1。 不過,API 的行為會根據記載的 6.0 版本。


timeout

類型:整數 (int64)
必要:否
預設60
InclusiveMaximum4294967295
InclusiveMinimum1

用來執行作業的伺服器逾時 (以秒為單位)。 此逾時指定了用戶端願意等候要求作業完成的持續時間。 這個參數的預設值是 60 秒。


StartTimeUtc

類型:字串
必要:是

查閱查詢的開始時間,格式為 ISO UTC yyyy-MM-ddTHH:mm:ssZ。


EndTimeUtc

類型:字串
必要:是

查閱查詢的結束時間,格式為 ISO UTC yyyy-MM-ddTHH:mm:ssZ。


EventsTypesFilter

類型:字串
必要:否

這是以逗號分隔的字串,指定回應中只應包含的 FabricEvents 類型。


ExcludeAnalysisEvents

類型:布林值
必要:否

如果傳遞 true,此參數會停用 AnalysisEvents 的擷取。


SkipCorrelationLookup

類型:布林值
必要:否

如果傳遞 true,此參數會停用 CorrelatedEvents 資訊的搜尋。 若非上述情況,則會處理 CorrelationEvents,並填入每個 FabricEvent 的 HasCorrelatedEvents 欄位。

回應

HTTP 狀態碼 描述 回應結構描述
200 (確定) 基底類型 ServiceEvent 的事件物件清單。
ServiceEvent的陣列
所有其他狀態碼 詳細的錯誤回應。
FabricError

範例

此範例示範如何在特定時間範圍中取得所有服務相關事件。

要求

GET http://localhost:19080/EventsStore/Services/Events?api-version=6.4&StartTimeUtc=2018-04-03T18:00:00Z&EndTimeUtc=2018-04-04T18:00:00Z

200 回應

主體
[
  {
    "Kind": "ServiceCreated",
    "ServiceTypeName": "Svc1Type",
    "ApplicationName": "fabric:/app1",
    "ApplicationTypeName": "App1Type",
    "ServiceInstance": "131672605579916060",
    "IsStateful": true,
    "PartitionCount": "2",
    "TargetReplicaSetSize": "3",
    "MinReplicaSetSize": "2",
    "ServicePackageVersion": "1.0:1.0",
    "PartitionId": "bd936249-183d-4e29-94ab-2e198e4e2e87",
    "ServiceId": "app1/svc1",
    "EventInstanceId": "8ba26506-4a93-4b8c-ae14-29a2841b3003",
    "TimeStamp": "2018-04-03T20:22:38.0560496Z",
    "HasCorrelatedEvents": false
  },
  {
    "Kind": "ServiceCreated",
    "ServiceTypeName": "Svc2Type",
    "ApplicationName": "fabric:/app1",
    "ApplicationTypeName": "App1Type",
    "ServiceInstance": "131672605579916060",
    "IsStateful": true,
    "PartitionCount": "2",
    "TargetReplicaSetSize": "3",
    "MinReplicaSetSize": "2",
    "ServicePackageVersion": "1.0:1.0",
    "PartitionId": "87413d64-0134-4b23-a439-c2692c4e3ec3",
    "ServiceId": "app1/svc2",
    "EventInstanceId": "03246d3b-77f5-4ca2-b065-7b8671711318",
    "TimeStamp": "2018-04-03T20:22:38.056197Z",
    "HasCorrelatedEvents": false
  }
]