你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

获取节点信息列表

获取 Service Fabric 群集中的节点的列表。

响应包括有关节点的名称、状态、ID、运行状况、运行时间和其他详细信息。

请求

方法 请求 URI
GET /Nodes?api-version=6.3&ContinuationToken={ContinuationToken}&NodeStatusFilter={NodeStatusFilter}&MaxResults={MaxResults}&timeout={timeout}

参数

名称 类型 必须 位置
api-version string 查询
ContinuationToken 字符串 查询
NodeStatusFilter string (枚举) 查询
MaxResults 整数 (int64) 查询
timeout 整数 (int64) 查询

api-version

类型:字符串
必需:是
默认

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

类型:字符串 (枚举)
必需:否
默认

用于根据 NodeStatus 筛选节点。 仅返回与指定的筛选器值匹配的节点。 筛选器值可以是下列项之一。 可能的值包括:“default”、“all”、“up”、“down”、“enableing”、“disableing”、“disabled”、“unknown”、“removed”


MaxResults

类型:整数 (int64)
必需:否
默认
InclusiveMinimum0

作为分页查询的一部分返回的最大结果数。 此参数定义返回结果数的上限。 如果根据配置中定义的最大消息大小限制,无法将这些结果容纳到消息中,则返回的结果数可能小于指定的最大结果数。 如果此参数为零或者未指定,则分页查询包含返回消息中最多可容纳的结果数。


timeout

类型:整数 (int64)
必需:否
默认
InclusiveMaximum4294967295
InclusiveMinimum1

执行操作的服务器超时,以秒为单位。 此超时指定客户端可以等待请求的操作完成的持续时间。 此参数的默认值为 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"
    }
  ]
}