ListNetworkInterfaces

您可以使用 ListNetworkInterfaces 方法列出有关节点上每个网络接口的信息。此 API 方法适用于单个节点;要访问单个节点,需要进行用户 ID 和密码身份验证。但是,如果参数 force 在此方法调用中的值为 true,则可以对集群使用此方法。如果对集群使用此参数,则会列出所有接口。

参数

此方法具有以下输入参数:

名称 说明 类型 默认值 必需
force 可能值:
  • true:返回有关集群中所有网络接口的信息。
  • false:不返回信息。
布尔型

返回值

此方法具有以下返回值:

名称 说明 类型
interfaces 存储节点(如果 force=true,则为整个存储集群)的每个网络接口的配置信息列表。 networkInterface 数组

请求示例

此方法的请求类似于以下示例:

{
"method": "ListNetworkInterfaces",
"params": {},
"id" : 1
}

响应示例

此方法返回类似于以下示例的响应:

{
	"id": 1,
	"result": {
		"nodes": [
			{
				"nodeID": 1,
				"result": {
					"interfaces": [
						{
							"address": "10.117.80.32",
							"addressV6": "::",
							"broadcast": "10.117.95.255",
							"macAddress": "90:b1:1c:42:e0:1a",
							"mtu": 9000,
							"name": "Bond10G",
							"namespace": false,
							"netmask": "255.255.240.0",
							"status": "UpAndRunning",
							"type": "BondMaster",
							"virtualNetworkTag": 0
						},
						{
							"address": "10.117.64.32",
							"addressV6": "::",
							"broadcast": "10.117.79.255",
							"macAddress": "90:b1:1c:42:e0:1e",
							"mtu": 1500,
							"name": "Bond1G",
							"namespace": false,
							"netmask": "255.255.240.0",
							"status": "UpAndRunning",
							"type": "BondMaster",
							"virtualNetworkTag": 0
						},
						{
							"address": "0.0.0.0",
							"addressV6": "::",
							"broadcast": "0.0.0.0",
							"macAddress": "90:b1:1c:42:e0:1a",
							"mtu": 9000,
							"name": "eth0",
							"namespace": false,
							"netmask": "0.0.0.0",
							"status": "UpAndRunning",
							"type": "BondSlave",
							"virtualNetworkTag": 0
						},
						{
							"address": "127.0.0.1",
							"addressV6": "::",
							"broadcast": "0.0.0.0",
							"macAddress": "00:00:00:00:00:00",
							"mtu": 0,
							"name": "lo",
							"namespace": false,
							"netmask": "0.0.0.0",
							"status": "UpAndRunning",
							"type": "Loopback",
							"virtualNetworkTag": 0
						}
					]
				}
			}
		]
	}
}

发布以下版本后新增

9.6