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


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


Configuration Guide - Device Management

S7700 and S9700 V200R013C00

This document describes the configurations of Device Management, including device status query, hardware management, CSS, SVF, PoE, OPS, OIDS, energy-saving management, information center, fault management, NTP, synchronous ethernet, PTP.
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).
Card Status Change Event Subscription

Card Status Change Event Subscription

Interface Name

Card status change event subscription

Application Phase

Subscription phase

API Prototype

result1_value, result2_description = ops.device.subscribe(tag, slot, event)






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.


Indicates the slot ID.

The value is a character string, such as slot 2 (for a standalone switch) or slot 1/2 (in a CSS).


Indicates the card status change event.

The value is of the enumerated type:

  • PLUGIN: A card is installed.

  • PLUGOUT: A card is removed.

  • REGISTERED: A card is registered.

  • RESET: A card is reset or the device is restarted.

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.device.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 card status change event subscription, you can monitor events related to the card in a specified slot, including card registration, removal, installation, and reset. The monitored card can be in a specified slot of the local chassis or in a specified slot of a specified chassis in the CSS. After a CSS splits, if the CSS configuration is not deleted from a CSS member, the value of slot is still in the format of CSS chassis ID/slot ID during the monitoring of a card in the specified slot on a standalone switch.


When the card in slot 2 is removed, you can trigger the corresponding action.

value, descri_str = ops.device.subscribe("card", "slot 2", "PLUGOUT")
Updated: 2019-04-20

Document ID: EDOC1100065738

Views: 44876

Downloads: 37

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