Document navigation

Physical Network Operations

CreateHostNetworkServiceType

API Request

URLs
POST zstack/v1/hosts/service-types
Headers
Authorization: OAuth the-session-uuid
Body

{
  "params": {
    "serviceType": "ManagementNetwork",
    "system": true
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"serviceType":"ManagementNetwork","system":true}}' \
http://localhost:8080/zstack/v1/hosts/service-types
Request Parameters
Name Type Location Description Optional Value Starting Version
serviceType String body (contained in the params structure) The network type. 5.3.0
system boolean body (contained in the params structure) Optional. 5.3.0
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 5.3.0
tagUuids List body (contained in the params structure) Optional. The tag UUID. 5.3.0
systemTags List body Optional. The system tags. 5.3.0
userTags List body Optional. The user tags. 5.3.0

API Response

Sample Response
{
  "inventory": {}
}
Name Type Description Starting Version
success boolean 5.3.0
inventory HostNetworkLabelInventory See inventory. 5.3.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 5.3.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 5.3.0
serviceType String The service type. 5.3.0
system Boolean The system status. 5.3.0
createDate Timestamp The creation date. 5.3.0
lastOpDate Timestamp The last operation date. 5.3.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.3.0
description String The brief description of the error. 5.3.0
details String The details about the error. 5.3.0
elaboration String The reserved field. Default value: null. 5.3.0
opaque LinkedHashMap The reserved field. Default value: null. 5.3.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.3.0

SDK Sample

Java SDK
CreateHostNetworkServiceTypeAction action = new CreateHostNetworkServiceTypeAction();
action.serviceType = "ManagementNetwork";
action.system = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateHostNetworkServiceTypeAction.Result res = action.call();
Python SDK
CreateHostNetworkServiceTypeAction action = CreateHostNetworkServiceTypeAction()
action.serviceType = "ManagementNetwork"
action.system = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateHostNetworkServiceTypeAction.Result res = action.call()

UpdateHostNetworkServiceType

API Request

URLs
PUT zstack/v1/hosts/service-types/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateHostNetworkServiceType": {
    "serviceType": "ManagementNetwork",
    "system": true
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateHostNetworkServiceType":{"serviceType":"ManagementNetwork","system":true}}' \
http://localhost:8080/zstack/v1/hosts/service-types/63513aaff0a13c6fa9f9661acf9cd64b/actions
Request Parameters
名字 类型 位置 描述 可选值 起始版本
uuid String url The resource UUID. 5.3.0
serviceType String body(contained in theupdateHostNetworkServiceTypestructure) The network type. 5.3.0
system boolean body(contained in theupdateHostNetworkServiceTypestructure) Optional. 5.3.0
systemTags List body Optional. The system tags. 5.3.0
userTags List body Optional. The user tags. 5.3.0

API Response

Sample Response
{
  "inventory": {}
}
Name Type Description Starting Version
success boolean 5.3.0
inventory HostNetworkLabelInventory See inventory. 5.3.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 5.3.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 5.3.0
serviceType String The service type. 5.3.0
system Boolean The system status. 5.3.0
createDate Timestamp The creation date. 5.3.0
lastOpDate Timestamp The last operation date. 5.3.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.3.0
description String The brief description of the error. 5.3.0
details String The details about the error. 5.3.0
elaboration String The reserved field. Default value: null. 5.3.0
opaque LinkedHashMap The reserved field. Default value: null. 5.3.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.3.0

SDK Sample

Java SDK
UpdateHostNetworkServiceTypeAction action = new UpdateHostNetworkServiceTypeAction();
action.uuid = "63513aaff0a13c6fa9f9661acf9cd64b";
action.serviceType = "ManagementNetwork";
action.system = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateHostNetworkServiceTypeAction.Result res = action.call();
Python SDK
UpdateHostNetworkServiceTypeAction action = UpdateHostNetworkServiceTypeAction()
action.uuid = "63513aaff0a13c6fa9f9661acf9cd64b"
action.serviceType = "ManagementNetwork"
action.system = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateHostNetworkServiceTypeAction.Result res = action.call()

DeleteHostNetworkServiceType

API Request

URLs
DELETE zstack/v1/hosts/service-types/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/hosts/service-types/21ce80c3a7783e11b78a343a50470abf
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 5.3.0
deleteMode String body Optional. The deleting mode (Permissive/Enforcing, Permissive). 5.3.0
systemTags List body Optional. The system tags. 5.3.0
userTags List body Optional. The user tags. 5.3.0

API Response

The API returns an empty JSON structure{}upon success, and a JSON structure containing an error field in case of failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
DeleteHostNetworkServiceTypeAction action = new DeleteHostNetworkServiceTypeAction();
action.uuid = "21ce80c3a7783e11b78a343a50470abf";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteHostNetworkServiceTypeAction.Result res = action.call();
Python SDK
DeleteHostNetworkServiceTypeAction action = DeleteHostNetworkServiceTypeAction()
action.uuid = "21ce80c3a7783e11b78a343a50470abf"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteHostNetworkServiceTypeAction.Result res = action.call()

SetServiceTypeOnHostNetworkInterface

API Request

URLs
POST zstack/v1/hosts/nics/service-types
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "interfaceUuids": [
      "2894f52c7d84366c85dd115b3bc193ca"
    ]
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"interfaceUuids":["2894f52c7d84366c85dd115b3bc193ca"]}}' \
http://localhost:8080/zstack/v1/hosts/nics/service-types
Request Parameters
Name Type Location Description Optional Value Starting Version
interfaceUuids List body (contained in the params structure) The physical NIC port UUID list. 4.7.11
vlanIds List body (contained in the params structure) Optional. The VLAN interface ID list. 4.7.11
serviceTypes List body (contained in the params structure) Optional. The network type.
  • ManagementNetwork
  • TenantNetwork
  • StorageNetwork
  • BackupNetwork
  • MigrationNetwork
4.7.11
systemTags List body Optional. The system tags. 4.7.11
userTags List body Optional. The user tags. 4.7.11

API Response

Sample Response
{
  "inventory": [
    {
      "id": 0,
      "interfaceUuid": "8534263f624a3962b7603c99a3e44eb2",
      "vlanId": 10,
      "serviceType": "BackupNetwork"
    }
  ]
}
Name Type Description Starting Version
success boolean 4.7.11
inventory List See inventory. 4.7.11
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.7.11
#inventory
Name Type Description Starting Version
interfaceUuid String The physical NIC port UUID. 4.7.11
vlanId Integer The VLAN interface id. 4.7.11
createDate Timestamp The creation date. 4.7.11
lastOpDate Timestamp The last operation date. 4.7.11
serviceType HostNetworkInterfaceServiceType See serviceType. 4.7.11
#serviceType
Name Type Description Starting Version
ManagementNetwork HostNetworkInterfaceServiceType The management network. 4.7.11
TenantNetwork HostNetworkInterfaceServiceType The business network. 4.7.11
StorageNetwork HostNetworkInterfaceServiceType The storage network. 4.7.11
BackupNetwork HostNetworkInterfaceServiceType The backup network. 4.7.11
MigrationNetwork HostNetworkInterfaceServiceType The migration network. 4.7.11
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.7.11
description String The brief description of the error. 4.7.11
details String The details about the error. 4.7.11
elaboration String The reserved field. Default value: null. 4.7.11
opaque LinkedHashMap The reserved field. Default value: null. 4.7.11
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.7.11

SDK Sample

Java SDK
SetServiceTypeOnHostNetworkInterfaceAction action = new SetServiceTypeOnHostNetworkInterfaceAction();
action.interfaceUuids = asList("2894f52c7d84366c85dd115b3bc193ca");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetServiceTypeOnHostNetworkInterfaceAction.Result res = action.call();
Python SDK
SetServiceTypeOnHostNetworkInterfaceAction action = SetServiceTypeOnHostNetworkInterfaceAction()
action.interfaceUuids = [2894f52c7d84366c85dd115b3bc193ca]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetServiceTypeOnHostNetworkInterfaceAction.Result res = action.call()

SetServiceTypeOnHostNetworkBonding

API Request

URLs
POST zstack/v1/hosts/bondings/service-types
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "bondingUuids": [
      "e96881d20cde3a9ab337cdf0ab4e8b08"
    ],
    "serviceTypes": [
      "TenantNetwork"
    ]
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"bondingUuids":["e96881d20cde3a9ab337cdf0ab4e8b08"],"serviceTypes":["TenantNetwork"]}}' \
http://localhost:8080/zstack/v1/hosts/bondings/service-types
Request Parameters
Name Type Location Description Optional Value Starting Version
bondingUuids List body (contained in the params structure) The bond UUID list. 4.7.11
vlanIds List body (contained in the params structure) Optional. The VLAN interface id list. 4.7.11
serviceTypes List body (contained in the params structure) Optional. The network type.
  • ManagementNetwork
  • TenantNetwork
  • StorageNetwork
  • BackupNetwork
  • MigrationNetwork
4.7.11
systemTags List body Optional. The system tags. 4.7.11
userTags List body Optional. The user tags. 4.7.11

API Response

Sample Response
{
  "inventory": [
    {
      "id": 0,
      "bondingUuid": "d1fd53a607c936859414f6222175c820",
      "vlanId": 10,
      "serviceType": "BackupNetwork"
    }
  ]
}
Name Type Description Starting Version
success boolean 4.7.11
inventory List See inventory. 4.7.11
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.7.11
#inventory
Name Type Description Starting Version
bondingUuid String The bond UUID. 4.7.11
vlanId Integer The VLAN interface ID. 4.7.11
createDate Timestamp The creation date. 4.7.11
lastOpDate Timestamp The last operation date. 4.7.11
serviceType HostNetworkInterfaceServiceType See serviceType. 4.7.11
#serviceType
Name Type Description Starting Version
ManagementNetwork HostNetworkInterfaceServiceType The management network. 4.7.11
TenantNetwork HostNetworkInterfaceServiceType The business network. 4.7.11
StorageNetwork HostNetworkInterfaceServiceType The storage network. 4.7.11
BackupNetwork HostNetworkInterfaceServiceType The backup network. 4.7.11
MigrationNetwork HostNetworkInterfaceServiceType The migration network. 4.7.11
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.7.11
description String The brief description of the error. 4.7.11
details String The details about the error. 4.7.11
elaboration String The reserved field. Default value: null. 4.7.11
opaque LinkedHashMap The reserved field. Default value: null. 4.7.11
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.7.11

SDK Sample

Java SDK
SetServiceTypeOnHostNetworkBondingAction action = new SetServiceTypeOnHostNetworkBondingAction();
action.bondingUuids = asList("e96881d20cde3a9ab337cdf0ab4e8b08");
action.serviceTypes = asList("TenantNetwork");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetServiceTypeOnHostNetworkBondingAction.Result res = action.call();
Python SDK
SetServiceTypeOnHostNetworkBondingAction action = SetServiceTypeOnHostNetworkBondingAction()
action.bondingUuids = [e96881d20cde3a9ab337cdf0ab4e8b08]
action.serviceTypes = [TenantNetwork]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetServiceTypeOnHostNetworkBondingAction.Result res = action.call()

GetCandidateInterfaceVlanIds

API Request

URLs
GET zstack/v1/host/network-interface-vlan-ids
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/host/network-interface-vlan-ids?interfaceUuids=d25e83af6ccf3d9ca8baa1702861a0c8&limit=1000&start=0
参数列表
Name Type Location Description Optional Value Starting Version
interfaceUuids List query The NIC port UUIDs 4.7.11
limit Integer query 4.7.11
start Integer query 4.7.11
systemTags List query Optional. The system tags. 4.7.11
userTags List query Optional. The user tags. 4.7.11

API Response

Sample Response
{
    "vlanIds": [
        1010,
        1011,
        10,
        11,
        2000,
        1101,
        1110,
        1108,
        1107,
        1109,
        1106,
        1103,
        1102,
        1105,
        1104,
        0
    ],
    "success": true
}
Name Type Description Starting Version
vlanIds List The Vlan interface ID list. 4.7.11
success boolean 4.7.11
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error 4.7.11
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.7.11
description String The brief description of the error. 4.7.11
details String The details about the error. 4.7.11
elaboration String The reserved field. Default value: null. 4.7.11
opaque LinkedHashMap The reserved field. Default value: null. 4.7.11
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.7.11

SDK Sample

Java SDK
GetCandidateInterfaceVlanIdsAction action = new GetCandidateInterfaceVlanIdsAction();
action.interfaceUuids = asList("d25e83af6ccf3d9ca8baa1702861a0c8");
action.limit = 1000;
action.start = 0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateInterfaceVlanIdsAction.Result res = action.call();
Python SDK
GetCandidateInterfaceVlanIdsAction action = GetCandidateInterfaceVlanIdsAction()
action.interfaceUuids = [d25e83af6ccf3d9ca8baa1702861a0c8]
action.limit = 1000
action.start = 0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateInterfaceVlanIdsAction.Result res = action.call()

GetInterfaceServiceTypeStatistic

API Request

URLs
GET zstack/v1/hosts/hosts-network-interfaces/service-type-statistic
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/hosts/hosts-network-interfaces/service-type-statistic? \
interfaceUuid=d8797841479d3951bcb698164b56bd9e&interfaceType=All&sortBy=CreateDate&sortDirection=asc&start=0&limit=20&replyWithCount=false
Request Parameters
Name Type Location Description Optional Value Starting Version
interfaceUuid String query Optional. The NIC port UUID. 4.7.11
vlanId Integer query Optional. The VLAN interface ID. 4.7.11
interfaceType String query Optional. The NIC port type.
  • All
  • Interface
  • Bonding
4.7.11
serviceType List query Optional. The network type.
  • All
  • ManagementNetwork
  • TenantNetwork
  • StorageNetwork
  • MigrationNetwork
  • BackupNetwork
4.7.11
zoneUuid String query Optional. The zone UUID. 4.7.11
clusterUuid String query Optional. The cluster UUID. 4.7.11
hostUuid String query Optional. The host UUID. 4.7.11
sortBy String query Optional. The sort method.
  • InterfaceName
  • VlanId
  • HostIp
  • HostName
  • ClusterName
  • CreateDate
4.7.11
sortDirection String query Optional. The sort direction.
  • asc
  • desc
4.7.11
start Integer query Optional. The location where the statistics starts. 4.7.11
limit Integer query Optional. The count of the statistics. 4.7.11
replyWithCount boolean query Optional. Whether to return both the statistics result and count. 4.7.11
systemTags List query Optional. The system tags. 4.7.11
userTags List query Optional. The user tags. 4.7.11

API Response

Sample Response
{
  "serviceTypeStatistics": [
    {
      "interfaceUuid": "474f9d7d7a1d3b46b8f17363dca7ebef",
      "serviceTypes": [
        "ManagementNetwork"
      ]
    }
  ],
  "total": 1
}}
Name Type Description Starting Version
total Long The total count of the statistics. 4.7.11
success boolean Whether the API succeeds. 4.7.11
serviceTypeStatistics List See serviceTypeStatistics. 4.7.11
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error 4.7.11
#serviceTypeStatistics
名字 类型 描述 起始版本
interfaceUuid String The network interface UUID. 4.7.11
interfaceName String The network interface name. 4.7.11
vlanId Integer The vlan interface ID. 4.7.11
serviceTypes List The network type list. 4.7.11
hostUuid String The host UUID. 4.7.11
hostName String The host name. 4.7.11
hostIp String The host IP. 4.7.11
clusterUuid String The cluster UUID. 4.7.11
clusterName String The cluster name. 4.7.11
zoneUuid String The zone UUID. 4.7.11
createDate Timestamp The date of creation. 4.7.11
#error
名字 类型 描述 起始版本
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6

SDK Sample

Java SDK
GetInterfaceServiceTypeStatisticAction action = new GetInterfaceServiceTypeStatisticAction();
action.interfaceUuid = "d8797841479d3951bcb698164b56bd9e";
action.interfaceType = "All";
action.sortBy = "CreateDate";
action.sortDirection = "asc";
action.start = 0;
action.limit = 20;
action.replyWithCount = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetInterfaceServiceTypeStatisticAction.Result res = action.call();
Python SDK
GetInterfaceServiceTypeStatisticAction action = GetInterfaceServiceTypeStatisticAction()
action.interfaceUuid = "d8797841479d3951bcb698164b56bd9e"
action.interfaceType = "All"
action.sortBy = "CreateDate"
action.sortDirection = "asc"
action.start = 0
action.limit = 20
action.replyWithCount = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetInterfaceServiceTypeStatisticAction.Result res = action.call()

ChangeHostNetworkInterfaceLldpMode

API Request

URLs
PUT zstack/v1/hostNetworkInterface/lldp/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeHostNetworkInterfaceLldpMode": {
    "interfaceUuids": [
      "f37102496ac2357aaa214622322adb65"
    ],
    "mode": "rx_only"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeHostNetworkInterfaceLldpMode":{"interfaceUuids":["f37102496ac2357aaa214622322adb65"],"mode":"rx_only"}}'  \
http://localhost:8080/zstack/v1/hostNetworkInterface/lldp/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
interfaceUuid List body (contained in the changeHostNetworkInterfaceLldpMode structure) The physical NIC port UUID. 5.0.0
mode String body (contained in the changeHostNetworkInterfaceLldpMode structure) Optional. The lldp mode.
  • rx_only
  • tx_only
  • rx_and_tx
  • disable
5.0.0
systemTags List body Optional. The system tags. 5.0.0
userTags List body Optional. The user tags. 5.0.0

API Response

Sample Response
{
  "inventories": [
    {
      "interfaceUuid": "1cae08c11e8530a8bf892df7ef709249",
      "mode": "rx_only"
    }
  ]
}
Name Type Description Starting Version
success boolean 5.0.0
inventory List See inventrois. 5.0.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 5.0.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 5.0.0
interfaceUuid String The physical NIC port UUID. 5.0.0
mode String The LLDP mode. 5.0.0
createDate Timestamp The creation time. 5.0.0
lastOpDate Timestamp The last operation time. 5.0.0
lldp HostNetworkInterfaceLldpRefInventory See lldp 5,0,0
#lldp
Name Type Description Starting Version
lldpUuid String The LLDP UUID. 5.0.0
chassisId String The chassis ID. 5.0.0
timeToLive Integer The time to live. 5.0.0
managementAddress String Manage address. 5.0.0
systemName String The systerm name. 5.0.0
systemDescription String The system description。 5.0.0
systemCapabilities String The system capabilities. 5.0.0
portId String The port ID. 5.0.0
portDescription String The port description. 5.0.0
vlanId Integer The VLAN ID. 5.0.0
aggregationPortId Long The aggregation port ID 5.0.0
mtu Integer The maximum transmission unit. 5.0.0
createDate Timestamp The creation date. 5.0.0
lastOpDate Timestamp The last operation date. 5.0.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.0.0
description String The brief description of the error. 5.0.0
details String The details about the error. 5.0.0
elaboration String The reserved field. Default value: null. 5.0.0
opaque LinkedHashMap The reserved field. Default value: null. 5.0.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.0.0

SDK Sample

Java SDK
ChangeHostNetworkInterfaceLldpModeAction action = new ChangeHostNetworkInterfaceLldpModeAction();
action.interfaceUuids = asList("f37102496ac2357aaa214622322adb65");
action.mode = "rx_only";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeHostNetworkInterfaceLldpModeAction.Result res = action.call();
Python SDK
ChangeHostNetworkInterfaceLldpModeAction action = ChangeHostNetworkInterfaceLldpModeAction()
action.interfaceUuids = [f37102496ac2357aaa214622322adb65]
action.mode = "rx_only"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeHostNetworkInterfaceLldpModeAction.Result res = action.call()

GetHostNetworkInterfaceLldp

API Request

URLs
GET zstack/v1/hostNetworkInterface/lldp/{interfaceUuid}/info
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/hostNetworkInterface/lldp/e1b5f128aa183da6a6b719f136fdc5d2/info
Request Parameters
Name Type Location Description Optional Value Starting Version
interfaceUuid String url The physical NIC port UUID. 5.0.0
systemTags List query Optional. The system tags. 5.0.0
userTags List query Optional. The user tags. 5.0.0

API Response

Sample Response
{
  "lldp": {
    "lldpUuid": "6b7c1267888a38779eac7694315855f0",
    "chassisId": "mac 00:1e:08:1d:05:ba",
    "timeToLive": 120,
    "managementAddress": "172.25.2.4",
    "systemName": "BM-MN-3",
    "systemDescription": " CentecOS software, E530, Version 7.4.7 Copyright (C) 2004-2021 Centec Networks Inc.  All Rights Reserved.",
    "systemCapabilities": "Bridge, on  Router, on",
    "portId": "ifname eth-0-5",
    "portDescription": "eth-0-4",
    "vlanId": 3999,
    "aggregationPortId": 4294965248,
    "mtu": 9600
  }
}
Name Type Description Starting Version
success boolean 5.0.0
lldp HostNetworkInterfaceLldpRefInventory See lldp. 5.0.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 5.0.0
#lldp
Name Type Description Starting Version
lldpUuid String The LLDP UUID. 5.0.0
chassisId String The chassis ID. 5.0.0
timeToLive Integer The retention time of LLDP messages on the endpoint. 5.0.0
managementAddress String The management address. 5.0.0
systemName String The systerm name. 5.0.0
systemDescription String The system description. 5.0.0
systemCapabilities String The system capabilities. 5.0.0
portId String The port ID. 5.0.0
portDescription String The port description. 5.0.0
vlanId Integer The VLAN ID. 5.0.0
aggregationPortId Long The aggregation port ID. 5.0.0
mtu Integer The maximun transmission unit. 5.0.0
createDate Timestamp The creation date. 5.0.0
lastOpDate Timestamp The last operation date. 5.0.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.0.0
description String The brief description of the error. 5.0.0
details String The details about the error. 5.0.0
elaboration String The reserved field. Default value: null. 5.0.0
opaque LinkedHashMap The reserved field. Default value: null. 5.0.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.0.0

SDK Sample

Java SDK
GetHostNetworkInterfaceLldpAction action = new GetHostNetworkInterfaceLldpAction();
action.interfaceUuid = "e1b5f128aa183da6a6b719f136fdc5d2";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetHostNetworkInterfaceLldpAction.Result res = action.call();
Python SDK
GetHostNetworkInterfaceLldpAction action = GetHostNetworkInterfaceLldpAction()
action.interfaceUuid = "e1b5f128aa183da6a6b719f136fdc5d2"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetHostNetworkInterfaceLldpAction.Result res = action.call()

QueryHostNetworkInterfaceLldp

API Request

URLs
GET zstack/v1/hostNetworkInterface/lldp/all
GET zstack/v1/hostNetworkInterface/lldp/{interfaceUuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
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}

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryHostNetworkInterfaceLldp, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "interfaceUuid": "d90dd5538ca2343099ea96cb89857aca",
      "mode": "rx_only"
    }
  ]
}
Name Type Description Starting Version
success boolean 5.0.0
inventory List See inventroies. 5.0.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 5.0.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 5.0.0
interfaceUuid String The physical NIC port UUID. 5.0.0
mode String The lldp mode. 5.0.0
createDate Timestamp The creation time. 5.0.0
lastOpDate Timestamp The last operation time. 5.0.0
lldp HostNetworkInterfaceLldpRefInventory See lldp 5,0,0
#lldp
Name Type Description Starting Version
lldpUuid String The LLDP UUID. 5.0.0
chassisId String The chassis ID. 5.0.0
timeToLive Integer The time to live. 5.0.0
managementAddress String Manage address. 5.0.0
systemName String The systerm name. 5.0.0
systemDescription String The system description。 5.0.0
systemCapabilities String The systerm capabilities. 5.0.0
portId String The port ID. 5.0.0
portDescription String The port description. 5.0.0
vlanId Integer The VLAN ID. 5.0.0
aggregationPortId Long The aggregation port ID. 5.0.0
mtu Integer The maximun transmission unit. 5.0.0
createDate Timestamp The create date. 5.0.0
lastOpDate Timestamp The last operation date. 5.0.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.0.0
description String The brief description of the error. 5.0.0
details String The details about the error. 5.0.0
elaboration String The reserved field. Default value: null. 5.0.0
opaque LinkedHashMap The reserved field. Default value: null. 5.0.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.0.0

SDK Sample

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()
API Reference | 5.4.12 | ZStack Cloud · ZCF | ZStack Resource Center