pyhpecw7.features.vlan module¶
Manage VLANS on HPCOM7 devices.
-
class
pyhpecw7.features.vlan.
Vlan
(device, vlanid=None)[source]¶ Bases:
object
This class is used to get data and configure a specific VLAN.
Parameters: - device (HPCOM7) – connected instance of a
pyhpecw7.comware.HPCOM7
object. - vlanid (str) – VLAN ID
-
vlanid
¶ VLAN ID
Type: str
-
build
(stage=False, **vlan)[source]¶ Stage or execute XML object for VLAN configuration and send to staging
Parameters: - stage (bool) – whether to stage the command or execute immediately
- vlan – see Keyword Args
Keyword Arguments: - name (str) – OPTIONAL - VLAN name
- descr (str) – OPTOINAL - VLAN description
Returns: True if stage=True and successfully staged etree.Element XML response if immediate execution
-
get_config
()[source]¶ Gets current configuration for a given VLAN ID
Parameters: vlanid (str) – REQUIRED - VLAN ID Returns: - This returns a dictionary with the following
- k/v pairs:
vlanid (str): VLAN ID of the vlan requested name (str): configured name of the vlan descr (str): configured descr of the vlan
It returns an empty dictionary if the vlan does not exist
-
get_vlan_list
()[source]¶ Get a list of VLAN IDs that exist on the switch.
Returns: It returns a list of VLAN IDs as strings.
- device (HPCOM7) – connected instance of a