No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S600-E V200R013C00 Configuration Guide - Device Management

This document describes the configurations of Device Management, including device status query, hardware management, Stack, SVF, cloud-based management, PoE, OPS, energy-saving management, information center, fault management, NTP.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
LLDP Neighbor Change Event Subscription

LLDP Neighbor Change Event Subscription

Interface Name

LLDP neighbor change event subscription

Application Phase

Subscription phase

API Prototype

result1_value, result2_description = ops.lldp.subscribe(tag, event, interfaceName, neighborType)

Description

Parameter

Description

Value

tag

Indicates conditions.

The value is a string of 1 to 12 case-insensitive characters, consists of letters, digits, and underscores (_), and starts with a letter. The value cannot be one of the following: "", None, and, or, andnot. The value cannot contain \0.

event

Indicates an LLDP neighbor change event.

The value is of the enumerated type:

  • ops.lldp.LLDP_NEIGHBOR_EVENT_ADD: An LLDP neighbor is added.

  • ops.lldp.LLDP_NEIGHBOR_EVENT_DEL: An LLDP neighbor is deleted.

interfaceName

Indicates the interface name consisting of the interface type and number.

The value is a string of characters.

  • A complete interface name (GigabitEthernet0/0/1, for example), or an abbreviation of an interface name (Gi0/0/1, for example).

  • INTERFACE_ALL: all interfaces.

neighborType

Indicates the LLDP neighbor device type.

The value is of the enumerated type:

  • ops.lldp.LLDP_NEIGHBOR_TYPE_PHONE: IP phone

  • ops.lldp.LLDP_NEIGHBOR_TYPE_SWITCH: switch

  • ops.lldp.LLDP_NEIGHBOR_TYPE_ROUTER: router

  • ops.lldp.LLDP_NEIGHBOR_TYPE_AP: AP

  • ops.lldp.LLDP_NEIGHBOR_TYPE_OTHER: other devices

Return Value

The result1_value and result2_description in the API prototype indicate return values.

The result1_value is the first return value, 0 indicates success, and 1 indicates failure.

The result2_description is the second return value, indicating the failure cause. It is returned only when the first return value is 1.

Usage Description

If multiple simple events are defined using the ops.lldp.subscribe API in the subscription phase, but the simple events are not combined through the Multi-Condition Combination API, the Python script assistant cannot be configured.

Using the LLDP neighbor change event subscription, you can subscribe to LLDP neighbor changes on an interface.

Example

When a new LLDP neighbor on GE0/0/1 is a switch, the corresponding action is triggered.

value, descri_str = ops.lldp.subscribe("neighbor", ops.lldp.LLDP_NEIGHBOR_EVENT_ADD, "GigabitEthernet0/0/1", ops.lldp.LLDP_NEIGHBOR_TYPE_SWITCH)
Translation
Download
Updated: 2019-04-20

Document ID: EDOC1100066159

Views: 26069

Downloads: 3

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next