Go to main content

Oracle® ZFS Storage Appliance RESTful API 指南,发行版 OS8.8.0

退出打印视图

更新时间: 2018 年 11 月
 
 

网络设备

这些命令列出系统上的物理网络设备。物理网络设备上没有可修改的属性。

表 37  网络设备命令
请求
附加到路径 /network/v1
说明
GET
/devices/device
获取指定的网络设备属性
GET
/devices
列出所有网络设备对象
表 38  网络设备属性
属性
说明
active
布尔标志,指示设备是否处于活动状态
duplex
设备的双工状态
factory_mac
出厂 MAC 地址
media
设备介质
speed
设备速度,单位为兆位/秒
up
布尔标志,指示设备是否正常运行

列出网络设备

此命令列出所有网络设备。

请求示例:

GET /api/network/v1/devices HTTP/1.1
Authorization: Basic ab6rt4psMWE=
Host: zfs-storage.example.com:215
Accept: application/json

结果示例:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 412
X-Zfssa-Gns-Api: 1.0

{
    "devices": [{
        "href": "/api/network/v1/devices/ixgbe0",
        ....
    }, {
        "href": "/api/network/v1/devices/ixgbe1",
        ...
    }, {
        "href": "/api/network/v1/devices/ixgbe2",
        ...
    }, {
        "href": "/api/network/v1/devices/ixgbe3",
        ...
    }]
}

获取网络设备

此命令获取单个网络设备中的属性。

请求示例:

GET /api/network/v1/devices/ixgbe0 HTTP/1.1
Authorization: Basic ab6rt4psMWE=
Host: zfs-storage.example.com:215
Accept: application/json

结果示例:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 178
X-Zfssa-Gns-Api: 1.0

{
    "devices": {
        "active": false,
        "device": "ixgbe0",
        "duplex": "full-duplex",
        "factory_mac": "0:21:28:a1:d9:68",
        "href": "/api/network/v1/devices/ixgbe0",
        "media": "Ethernet",
        "speed": "1000 Mbit/s",
        "up": true
    }
}