取得節點資訊清單
取得 Service Fabric 叢集中的節點清單。
回應包括名稱、狀態、識別碼、健康情況、執行時間,以及與節點有關的其他詳細資料。
要求
方法 | 要求 URI |
---|---|
GET | /Nodes?api-version=6.3&ContinuationToken={ContinuationToken}&NodeStatusFilter={NodeStatusFilter}&MaxResults={MaxResults}&timeout={timeout} |
參數
名稱 | 類型 | 必要 | Location |
---|---|---|---|
api-version |
字串 | 是 | 查詢 |
ContinuationToken |
字串 | No | 查詢 |
NodeStatusFilter |
字串 (列舉) | No | 查詢 |
MaxResults |
整數 (int64) | No | 查詢 |
timeout |
整數 (int64) | No | 查詢 |
api-version
類型:字串
必要:是
預設:6.3
API 的版本。 這是必要參數,其值必須是 '6.3'。
Service Fabric REST API 版本是以 API 引進或變更的執行時間版本為基礎。 Service Fabric 執行時間支援多個版本的 API。 此版本是 API 的最新支援版本。 如果傳遞較低的 API 版本,傳回的回應可能會與本規格中所述的回應不同。
此外,執行時間也接受高於最新支援版本的任何版本,最高為目前版本的執行時間。 因此,如果最新的 API 版本是 6.0,而執行時間是 6.1,則執行時間將會接受該 API 的版本 6.1。 不過,API 的行為會根據記載的 6.0 版本。
ContinuationToken
類型:字串
必要:否
接續權杖參數可用來取得下一組結果。 當來自系統的結果無法放入單一回應中時,API 的回應中會包含具有非空白值的接續權杖。 當此值傳遞至下一個 API 呼叫時,API 會傳回下一組結果。 如果沒有任何進一步的結果,接續權杖就不會包含值。 此參數的值不能經過 URL 編碼。
NodeStatusFilter
類型:字串 (列舉)
必要:否
預設:default
可根據 NodeStatus 篩選節點。 只會傳回符合所指定篩選值的節點。 篩選值可以是下列其中之一。 可能的值包括:'default'、'all'、'up'、'down'、'啟用'、'disableing'、'disabled'、'unknown'、'removed'
MaxResults
類型:整數 (int64)
必要:否
預設:0
InclusiveMinimum: 0
分頁式查詢時傳回的最大結果數目。 此參數定義傳回結果數目的上限。 根據設定中所定義的訊息大小限制上限,如果所傳回的結果無法放入訊息中,則它們可以小於指定的結果上限。 如果此參數為零或未指定,則分頁式查詢會在傳回訊息中盡可能包含較多結果。
timeout
類型:整數 (int64)
必要:否
預設:60
InclusiveMaximum: 4294967295
InclusiveMinimum: 1
用來執行作業的伺服器逾時 (以秒為單位)。 此逾時指定了用戶端願意等候要求作業完成的持續時間。 這個參數的預設值是 60 秒。
回應
HTTP 狀態碼 | 描述 | 回應結構描述 |
---|---|---|
200 (確定) | 叢集中的節點清單。 |
PagedNodeInfoList |
所有其他狀態碼 | 詳細的錯誤回應。 |
FabricError |
範例
取得所有節點的相關資訊
這個範例示範如何在資訊符合單一回應訊息時,取得叢集中所有節點的相關資訊,而不需要透過 ContinuationToken 參數進行分頁。
要求
GET http://localhost:19080/Nodes?api-version=6.3
200 回應
主體
{
"ContinuationToken": "",
"Items": [
{
"Name": "_Node_1",
"IpAddressOrFQDN": "10.0.0.5",
"Type": "testnode",
"CodeVersion": "6.3.139.9494",
"ConfigVersion": "5",
"NodeStatus": "Up",
"NodeUpTimeInSeconds": "15275",
"HealthState": "Ok",
"IsSeedNode": true,
"UpgradeDomain": "1",
"FaultDomain": "fd:/1",
"Id": {
"Id": "ebd986a1134b3643a8117fb41b259bf"
},
"InstanceId": "131738274982501335",
"NodeDeactivationInfo": {
"NodeDeactivationIntent": "Invalid",
"NodeDeactivationStatus": "None",
"NodeDeactivationTask": [],
"PendingSafetyChecks": []
},
"IsStopped": false,
"NodeDownTimeInSeconds": "0",
"NodeUpAt": "2018-06-18T20:31:39.842Z",
"NodeDownAt": "2018-06-18T20:31:37.374Z"
},
{
"Name": "_Node_0",
"IpAddressOrFQDN": "10.0.0.4",
"Type": "testnode",
"CodeVersion": "6.3.139.9494",
"ConfigVersion": "5",
"NodeStatus": "Up",
"NodeUpTimeInSeconds": "18742",
"HealthState": "Ok",
"IsSeedNode": true,
"UpgradeDomain": "0",
"FaultDomain": "fd:/0",
"Id": {
"Id": "2acb9f55540659b1c95f27cc128ab326"
},
"InstanceId": "131738240209152398",
"NodeDeactivationInfo": {
"NodeDeactivationIntent": "Invalid",
"NodeDeactivationStatus": "None",
"NodeDeactivationTask": [],
"PendingSafetyChecks": []
},
"IsStopped": false,
"NodeDownTimeInSeconds": "0",
"NodeUpAt": "2018-06-18T19:33:52.944Z",
"NodeDownAt": "2018-06-18T19:33:39.514Z"
},
{
"Name": "_Node_4",
"IpAddressOrFQDN": "10.0.0.8",
"Type": "testnode",
"CodeVersion": "6.3.139.9494",
"ConfigVersion": "5",
"NodeStatus": "Up",
"NodeUpTimeInSeconds": "101168",
"HealthState": "Ok",
"IsSeedNode": true,
"UpgradeDomain": "4",
"FaultDomain": "fd:/4",
"Id": {
"Id": "ba9383d728221add7fa996bf67b757fb"
},
"InstanceId": "131737415865259763",
"NodeDeactivationInfo": {
"NodeDeactivationIntent": "Invalid",
"NodeDeactivationStatus": "None",
"NodeDeactivationTask": [],
"PendingSafetyChecks": []
},
"IsStopped": false,
"NodeDownTimeInSeconds": "0",
"NodeUpAt": "2018-06-17T20:40:07.378Z",
"NodeDownAt": "2018-06-17T20:33:11.877Z"
},
{
"Name": "_Node_3",
"IpAddressOrFQDN": "10.0.0.7",
"Type": "testnode",
"CodeVersion": "6.3.139.9494",
"ConfigVersion": "5",
"NodeStatus": "Up",
"NodeUpTimeInSeconds": "15236",
"HealthState": "Ok",
"IsSeedNode": true,
"UpgradeDomain": "3",
"FaultDomain": "fd:/3",
"Id": {
"Id": "d6a18a0935a3e39aeae2a049eb97255d"
},
"InstanceId": "131738275300526952",
"NodeDeactivationInfo": {
"NodeDeactivationIntent": "Invalid",
"NodeDeactivationStatus": "None",
"NodeDeactivationTask": [],
"PendingSafetyChecks": []
},
"IsStopped": false,
"NodeDownTimeInSeconds": "0",
"NodeUpAt": "2018-06-18T20:32:18.884Z",
"NodeDownAt": "2018-06-18T20:31:59.128Z"
},
{
"Name": "_Node_2",
"IpAddressOrFQDN": "10.0.0.6",
"Type": "testnode",
"CodeVersion": "6.3.139.9494",
"ConfigVersion": "5",
"NodeStatus": "Up",
"NodeUpTimeInSeconds": "19440",
"HealthState": "Ok",
"IsSeedNode": true,
"UpgradeDomain": "2",
"FaultDomain": "fd:/2",
"Id": {
"Id": "f2af91e5e9c8254dedb75b1424a9e3fc"
},
"InstanceId": "131738233282843485",
"NodeDeactivationInfo": {
"NodeDeactivationIntent": "Invalid",
"NodeDeactivationStatus": "None",
"NodeDeactivationTask": [],
"PendingSafetyChecks": []
},
"IsStopped": false,
"NodeDownTimeInSeconds": "0",
"NodeUpAt": "2018-06-18T19:22:15.272Z",
"NodeDownAt": "2018-06-18T19:22:02.74Z"
}
]
}
限制最大結果
此範例示範如何在傳回的結果數目受限於 MaxResults 參數時,取得叢集中節點的相關資訊。
要求
GET http://localhost:19080/Nodes?api-version=6.3&MaxResults=2
200 回應
主體
{
"ContinuationToken": "2acb9f55540659b1c95f27cc128ab326",
"Items": [
{
"Name": "_testnode_1",
"IpAddressOrFQDN": "10.0.0.5",
"Type": "testnode",
"CodeVersion": "6.3.139.9494",
"ConfigVersion": "5",
"NodeStatus": "Up",
"NodeUpTimeInSeconds": "102016",
"HealthState": "Ok",
"IsSeedNode": true,
"UpgradeDomain": "1",
"FaultDomain": "fd:/1",
"Id": {
"Id": "ebd986a1134b3643a8117fb41b259bf"
},
"InstanceId": "131738274982501335",
"NodeDeactivationInfo": {
"NodeDeactivationIntent": "Invalid",
"NodeDeactivationStatus": "None",
"NodeDeactivationTask": [],
"PendingSafetyChecks": []
},
"IsStopped": false,
"NodeDownTimeInSeconds": "0",
"NodeUpAt": "2018-06-18T20:31:39.842Z",
"NodeDownAt": "2018-06-18T20:31:37.374Z"
},
{
"Name": "_testnode_0",
"IpAddressOrFQDN": "10.0.0.4",
"Type": "testnode",
"CodeVersion": "6.3.139.9494",
"ConfigVersion": "5",
"NodeStatus": "Up",
"NodeUpTimeInSeconds": "105483",
"HealthState": "Ok",
"IsSeedNode": true,
"UpgradeDomain": "0",
"FaultDomain": "fd:/0",
"Id": {
"Id": "2acb9f55540659b1c95f27cc128ab326"
},
"InstanceId": "131738240209152398",
"NodeDeactivationInfo": {
"NodeDeactivationIntent": "Invalid",
"NodeDeactivationStatus": "None",
"NodeDeactivationTask": [],
"PendingSafetyChecks": []
},
"IsStopped": false,
"NodeDownTimeInSeconds": "0",
"NodeUpAt": "2018-06-18T19:33:52.944Z",
"NodeDownAt": "2018-06-18T19:33:39.514Z"
}
]
}
使用接續權杖的頁面
此範例示範如何使用 ContinuationToken 參數,取得叢集中出現在循序頁面上之節點的相關資訊。
要求
GET http://localhost:19080/Nodes?api-version=6.3&ContinuationToken=2acb9f55540659b1c95f27cc128ab326
200 回應
主體
{
"ContinuationToken": "",
"Items": [
{
"Name": "_Node_4",
"IpAddressOrFQDN": "10.0.0.8",
"Type": "testnode",
"CodeVersion": "6.3.139.9494",
"ConfigVersion": "5",
"NodeStatus": "Up",
"NodeUpTimeInSeconds": "101547",
"HealthState": "Ok",
"IsSeedNode": true,
"UpgradeDomain": "4",
"FaultDomain": "fd:/4",
"Id": {
"Id": "ba9383d728221add7fa996bf67b757fb"
},
"InstanceId": "131737415865259763",
"NodeDeactivationInfo": {
"NodeDeactivationIntent": "Invalid",
"NodeDeactivationStatus": "None",
"NodeDeactivationTask": [],
"PendingSafetyChecks": []
},
"IsStopped": false,
"NodeDownTimeInSeconds": "0",
"NodeUpAt": "2018-06-17T20:40:07.378Z",
"NodeDownAt": "2018-06-17T20:33:11.877Z"
},
{
"Name": "_Node_3",
"IpAddressOrFQDN": "10.0.0.7",
"Type": "testnode",
"CodeVersion": "6.3.139.9494",
"ConfigVersion": "5",
"NodeStatus": "Up",
"NodeUpTimeInSeconds": "15615",
"HealthState": "Ok",
"IsSeedNode": true,
"UpgradeDomain": "3",
"FaultDomain": "fd:/3",
"Id": {
"Id": "d6a18a0935a3e39aeae2a049eb97255d"
},
"InstanceId": "131738275300526952",
"NodeDeactivationInfo": {
"NodeDeactivationIntent": "Invalid",
"NodeDeactivationStatus": "None",
"NodeDeactivationTask": [],
"PendingSafetyChecks": []
},
"IsStopped": false,
"NodeDownTimeInSeconds": "0",
"NodeUpAt": "2018-06-18T20:32:18.884Z",
"NodeDownAt": "2018-06-18T20:31:59.128Z"
},
{
"Name": "_Node_2",
"IpAddressOrFQDN": "10.0.0.6",
"Type": "testnode",
"CodeVersion": "6.3.139.9494",
"ConfigVersion": "5",
"NodeStatus": "Up",
"NodeUpTimeInSeconds": "19819",
"HealthState": "Ok",
"IsSeedNode": true,
"UpgradeDomain": "2",
"FaultDomain": "fd:/2",
"Id": {
"Id": "f2af91e5e9c8254dedb75b1424a9e3fc"
},
"InstanceId": "131738233282843485",
"NodeDeactivationInfo": {
"NodeDeactivationIntent": "Invalid",
"NodeDeactivationStatus": "None",
"NodeDeactivationTask": [],
"PendingSafetyChecks": []
},
"IsStopped": false,
"NodeDownTimeInSeconds": "0",
"NodeUpAt": "2018-06-18T19:22:15.272Z",
"NodeDownAt": "2018-06-18T19:22:02.74Z"
}
]
}