查询主机物理网卡LLDP配置

GET/zstack/v1/hostNetworkInterface/lldp/all
GET/zstack/v1/hostNetworkInterface/lldp/{interfaceUuid}

Headers

Authorization: OAuth the-session-uuid

Curl示例

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/hostNetworkInterface/lldp/all
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/hostNetworkInterface/lldp/{interfaceUuid}

可查询字段

运行CLI命令行工具,输入QueryHostNetworkInterfaceLldp并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例

{
  "inventories": [
    {
      "interfaceUuid": "d90dd5538ca2343099ea96cb89857aca",
      "mode": "rx_only"
    }
  ]
}
名字类型描述起始版本
successboolean 4.1.0
inventoriesList详情参考inventories4.1.0
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error4.1.0

inventories

名字类型描述起始版本
uuidString资源的UUID,唯一标示该资源4.1.0
interfaceUuidString物理网口Uuid4.1.0
modeStringlldp工作模式4.1.0
createDateTimestamp创建时间4.1.0
lastOpDateTimestamp最后一次修改时间4.1.0
lldpHostNetworkInterfaceLldpRefInventory详情参考lldp4.1.0

lldp

名字类型描述起始版本
lldpUuidStringLLDP UUID4.1.0
chassisIdString机箱标识4.1.0
timeToLiveInteger生存时间4.1.0
managementAddressString管理地址4.1.0
systemNameString系统名称4.1.0
systemDescriptionString系统描述4.1.0
systemCapabilitiesString系统能力4.1.0
portIdString端口标识4.1.0
portDescriptionString端口描述4.1.0
vlanIdIntegerVLAN标识4.1.0
aggregationPortIdLong聚合端口标识4.1.0
mtuInteger最大传输单元4.1.0
createDateTimestamp创建时间4.1.0
lastOpDateTimestamp最后一次修改时间4.1.0

error

名字类型描述起始版本
codeString错误码号,错误的全局唯一标识,例如SYS.1000, HOST.10014.1.0
descriptionString错误的概要描述4.1.0
detailsString错误的详细信息4.1.0
elaborationString保留字段,默认为null4.1.0
opaqueLinkedHashMap保留字段,默认为null4.1.0
causeErrorCode根错误,引发当前错误的源错误,若无原错误,该字段为null4.1.0

SDK示例

Java SDK

QueryHostNetworkInterfaceLldpAction action = new QueryHostNetworkInterfaceLldpAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryHostNetworkInterfaceLldpAction.Result res = action.call();

Python SDK

QueryHostNetworkInterfaceLldpAction action = QueryHostNetworkInterfaceLldpAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryHostNetworkInterfaceLldpAction.Result res = action.call()