pyhpecw7.features.vrrp module

Manage VRRP groups on HPCOM7 devices.

class pyhpecw7.features.vrrp.VRRP(device, interface, vrid)[source]

Bases: object

This class is used to collect data or configure a VRRP group on a
given interface.
Parameters:
  • device (HPCOM7) – connected instance of a pyhpecw7.comware.HPCOM7 object.
  • interface (str) – name of the Layer 3 interface
  • vrid (str) – virtual router ID (group number)
device

connected instance of a pyhpecw7.comware.HPCOM7 object.

Type:HPCOM7
interface

name of the Layer 3 interface

Type:str
vrid

virtual router ID (group number)

Type:str
build(stage=False, **kvargs)[source]

Execute or stage XML VRRP configuration and send to staging

Parameters:
  • stage (bool) – whether to stage the command or execute immediately
  • kvargs – see Keyword Args

Note

If auth is being configured, all three auth Keyword Args are required.

Keyword Arguments:
 
  • vip (str) – REQUIRED - virtual IP address
  • auth_mode (str) – OPTIONAL - “simple” or “md5”
  • key_type (str) – OPTIONAL - “cipher” or “plain”
  • key (str) – OPTIONAL - text string if key_type is “plain” or cipher if key_type is “cipher”
  • priority (str) – OPTIONAL - VRRP priority
  • preempt (str) – OPTIONAL - “yes” or “no” (STRING)
Returns:

True if stage=True and successfully staged CLI response if immediate execution

get_auth_type()[source]

Get auth type for a given VRID on a given interface

Returns:
auth_mode (str):
 ”simple” or “md5” :key_type (str): “cipher” :key (str): it will be a cipher

It will return an empty dictionary if it VRID does not exist.

Return type:This returns a dictionary with the following k/v pairs
get_config()[source]

Get the config of a given vrid on a given interface

Returns:
auth_mode (str):
 ”simple” or “md5”
key_type (str):”cipher”
key (str):it will be a cipher
priority (str):VRRP priority
preempt (str):”true” or “false” (STRING)
vip (str):virtual IP address
Return type:This returns a dictionary with the following k/v pairs
get_vrrp_groups()[source]

Get list of VRIDs for a given Layer 3 interface

Returns:This returns a list of VRIDs configured on a given interface.
remove(stage=False)[source]

Stage or execute commands to remove VRRP group.

Parameters:stage (bool) – whether to stage the command or execute immediately
Returns:True if stage=True and successfully staged CLI response string if immediate execution
shutdown(stage=False)[source]

Stage or execute commands to shutdown VRRP group.

Parameters:stage (bool) – whether to stage the command or execute immediately
Returns:True if stage=True and successfully staged CLI response string if immediate execution
undoshutdown(stage=False)[source]

Stage or execute commands to undo shutdown of VRRP group.

Parameters:stage (bool) – whether to stage the command or execute immediately
Returns:True if stage=True and successfully staged CLI response string if immediate execution