honeycomb package

HcAPIKwACL module

This module implements keywords to manipulate ACL data structures using Honeycomb REST API.

class resources.libraries.python.honeycomb.HcAPIKwACL.ACLKeywords

Bases: object

Implementation of keywords which make it possible to: - add classify table(s), - remove classify table(s), - get operational data about classify table(s), - add classify session(s), - remove classify session(s), - get operational data about classify sessions(s).

static add_classify_session(node, table_name, session)

Add a classify session to the classify table.

Parameters:
  • node (dict) – Honeycomb node.
  • table_name (str) – Name of the classify table.
  • session (dict) – Classify session to be added to the classify table.
Returns:

Content of response.

Return type:

bytearray

static add_classify_table(node, table)

Add a classify table to the list of classify tables. The keyword does not validate given data.

Parameters:
  • node (dict) – Honeycomb node.
  • table (dict) – Classify table to be added.
Returns:

Content of response.

Return type:

bytearray

static create_ietf_classify_chain(node, list_name, layer, data)

Create classify chain using the ietf-acl node.

Parameters:
  • node (dict) – Honeycomb node.
  • list_name (str) – Name for the classify list.
  • layer (string) – Network layer to classify on.
  • data (dict) – Dictionary of settings to send to Honeycomb.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If the operation fails.

static delete_ietf_classify_chains(node)

Remove all classify chains from the ietf-acl node.

Parameters:node (dict) – Honeycomb node.
static delete_ietf_interface_acls(node, interface)

Remove all ietf-acl assignments from an interface.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str or int) – Name of an interface on the node.
static get_all_classify_sessions_oper_data(node, table_name)

Get operational data about all classify sessions in the classify table.

Parameters:
  • node (dict) – Honeycomb node.
  • table_name (str) – Name of the classify table.
Returns:

List of classify sessions present in the classify table.

Return type:

list

static get_all_classify_tables_cfg_data(node)

Get configuration data about all classify tables present on the node.

Parameters:node (dict) – Honeycomb node.
Returns:List of classify tables.
Return type:list
static get_all_classify_tables_oper_data(node)

Get operational data about all classify tables present on the node.

Parameters:node (dict) – Honeycomb node.
Returns:List of classify tables.
Return type:list
static get_classify_session_oper_data(node, table_name, session_match)

Get operational data about the given classify session in the classify table.

Parameters:
  • node (dict) – Honeycomb node.
  • table_name (str) – Name of the classify table.
  • session_match (str) – Classify session match.
Returns:

Classify session operational data.

Return type:

dict

static get_classify_table_oper_data(node, table_name)

Get operational data about the given classify table.

Parameters:
  • node (dict) – Honeycomb node.
  • table_name (str) – Name of the classify table.
Returns:

Operational data about the given classify table.

Return type:

dict

static remove_all_classify_tables(node)

Remove all classify tables defined on the node.

Parameters:node (dict) – Honeycomb node.
Returns:Content of response.
Return type:bytearray
static remove_classify_session(node, table_name, session_match)

Remove the given classify session from the classify table.

Parameters:
  • node (dict) – Honeycomb node.
  • table_name (str) – Name of the classify table.
  • session_match (str) – Classify session match.
Returns:

Content of response.

Return type:

bytearray

static remove_classify_table(node, table_name)

Remove the given classify table.

Parameters:
  • node (dict) – Honeycomb node.
  • table_name (str) – Name of the classify table to be removed.
Returns:

Content of response.

Return type:

bytearray

static set_ietf_interface_acl(node, interface, layer, direction, list_name, default_action, mode=None)

Assign an interface to an ietf-acl classify chain.

Parameters:
  • node – Honeycomb node.
  • interface – Name of an interface on the node.
  • layer – Network layer to classify packets on.

Valid options are: L2, L3, L4. Mixed ACL not supported yet. :param direction: Classify incoming or outgiong packets. Valid options are: ingress, egress :param list_name: Name of an ietf-acl classify chain. :param default_action: Default classifier action: permit or deny. :param mode: When using mixed layers, this specifies operational mode of the interface - L2 or L3. If layer is not “mixed”, this argument will be ignored. :type node: dict :type interface: str or int :type layer: str :type direction: str :type list_name: str :type default_action: str :type mode: str

Returns:Content of response.
Return type:bytearray
Raises:HoneycombError – If the operation fails.

HcAPIKwBridgeDomain module

Keywords to manipulate bridge domain configuration using Honeycomb REST API.

The keywords make possible to put and get configuration data and to get operational data.

class resources.libraries.python.honeycomb.HcAPIKwBridgeDomain.BridgeDomainKeywords

Bases: object

Keywords to manipulate bridge domain configuration.

Implements keywords which get configuration and operational data about bridge domains and put the bridge domains’ parameters using Honeycomb REST API.

PARAMS = ('flood', 'forward', 'learn', 'unknown-unicast-flood', 'arp-termination')
static add_bd(node, bd_name, **kwargs)

Add a bridge domain.

Parameters:
  • node – Honeycomb node.
  • bd_name – Bridge domain name.
  • kwargs – Parameters and their values. The accepted parameters are

defined in BridgeDomainKeywords.PARAMS :type node: dict :type bd_name: str :type kwargs: dict :return: Bridge domain data structure. :rtype: dict

static add_first_bd(node, bd_name, **kwargs)

Add the first bridge domain.

If there are any other bridge domains configured, they will be removed.

Parameters:
  • node – Honeycomb node.
  • bd_name – Bridge domain name.
  • kwargs – Parameters and their values. The accepted parameters are

defined in BridgeDomainKeywords.PARAMS :type node: dict :type bd_name: str :type kwargs: dict :return: Bridge domain data structure. :rtype: dict

static add_l2_fib_entry(node, bd_name, l2_fib_entry)

Add an L2 FIB entry to the bridge domain’s list of L2 FIB entries.

Parameters:
  • node (dict) – Honeycomb node.
  • bd_name (str) – Bridge domain’s name.
  • l2_fib_entry (dict) – L2 FIB entry to be added to the L2 FIB table.
Returns:

Content of response.

Return type:

bytearray

static configure_bridge_domain(node, bd_name, param, value)

Configure a bridge domain.

Parameters:
  • node – Honeycomb node.
  • bd_name – Bridge domain name.
  • param – Parameter to set, change or remove. The accepted

parameters are defined in BridgeDomainKeywords.PARAMS :param value: The new value to be set, change or remove. If None, the item will be removed. :type node: dict :type bd_name: str :type param: str :type value: str :return: Content of response. :rtype: bytearray

static get_all_bds_cfg_data(node)

Get configuration data about all bridge domains from Honeycomb.

Parameters:node (dict) – Honeycomb node.
Returns:Configuration data about all bridge domains from Honeycomb.
Return type:list
Raises:HoneycombError – If it is not possible to get configuration data.
static get_all_bds_oper_data(node)

Get operational data about all bridge domains from Honeycomb.

Parameters:node (dict) – Honeycomb node.
Returns:Operational data about all bridge domains from Honeycomb.
Return type:list
Raises:HoneycombError – If it is not possible to get operational data.
static get_all_l2_fib_entries(node, bd_name)

Retrieves all entries from the bridge domain’s L2 FIB table.

Parameters:
  • node (dict) – Honeycomb node.
  • bd_name (str) – Bridge domain’s name.
Returns:

Bridge domain’s L2 FIB table or empty list if the table does

not exist or it is empty. :rtype: list

static get_bd_cfg_data(node, bd_name)

Get configuration data about the given bridge domain from Honeycomb.

Parameters:
  • node (dict) – Honeycomb node.
  • bd_name (str) – The name of bridge domain.
Returns:

Configuration data about the given bridge domain from

Honeycomb. :rtype: dict

static get_bd_oper_data(node, bd_name)

Get operational data about the given bridge domain from Honeycomb.

Parameters:
  • node (dict) – Honeycomb node.
  • bd_name (str) – The name of bridge domain.
Returns:

Operational data about the given bridge domain from Honeycomb.

Return type:

dict

static get_l2_fib_entry(node, bd_name, mac)

Retrieves an entry from bridge domain’s L2 FIB table. The entry is specified by MAC address.

Parameters:
  • node (dict) – Honeycomb node.
  • bd_name (str) – Bridge domain’s name.
  • mac (str) – MAC address used as the key in L2 FIB data structure.
Returns:

The requested entry from bridge domain’s L2 FIB table or empty

dictionary if it does not exist in the L2 FIB table. :rtype: dict

static modify_l2_fib_entry(node, bd_name, mac, param, value)

Modify an existing L2 FIB entry in the bridge domain’s L2 FIB table. The L2 FIB entry is specified by MAC address.

Parameters:
  • node (dict) – Honeycomb node.
  • bd_name (str) – Bridge domain’s name.
  • mac (str) – MAC address used as the key in L2 FIB data structure.
  • param (str) – The parameter to be modified.
  • value (str or int) – The new value of the parameter.
Returns:

Content of response.

Return type:

bytearray

static remove_all_bridge_domains(node)

Remove all bridge domains.

Parameters:node (dict) – Honeycomb node.
Returns:Content of response.
Return type:bytearray
Raises:HoneycombError – If it is not possible to remove all bridge

domains.

static remove_all_l2_fib_entries(node, bd_name)

Remove all entries from the bridge domain’s L2 FIB table.

Parameters:
  • node (dict) – Honeycomb node.
  • bd_name (str) – Bridge domain’s name.
Returns:

Content of response.

Return type:

bytearray

static remove_bridge_domain(node, bd_name)

Remove a bridge domain.

Parameters:
  • node (dict) – Honeycomb node.
  • bd_name (str) – The name of bridge domain to be removed.
Returns:

Content of response.

Return type:

bytearray

:raises HoneycombError:If it is not possible to remove the bridge domain.

static remove_l2_fib_entry(node, bd_name, mac)

Remove an L2 FIB entry from bridge domain’s L2 FIB table. The entry is specified by MAC address.

Parameters:
  • node (dict) – Honeycomb node.
  • bd_name (str) – Bridge domain’s name.
  • mac (str) – MAC address used as the key in L2 FIB data structure.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If it is not possible to remove the specified

entry.

HcAPIKwInterfaces module

Keywords to manipulate interface configuration using Honeycomb REST API.

The keywords make possible to put and get configuration data and to get operational data.

class resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords

Bases: object

Keywords for Interface manipulation.

Implements keywords which get configuration and operational data about vpp interfaces and set the interface’s parameters using Honeycomb REST API.

BD_PARAMS = ('bridge-domain', 'split-horizon-group', 'bridged-virtual-interface')
ETH_PARAMS = ('mtu',)
INTF_PARAMS = ('name', 'description', 'type', 'enabled', 'link-up-down-trap-enable', 'v3po:l2', 'v3po:vxlan-gpe', 'vpp-vlan:sub-interfaces')
IPV4_PARAMS = ('enabled', 'forwarding', 'mtu')
IPV6_AUTOCONF_PARAMS = ('create-global-addresses', 'create-temporary-addresses', 'temporary-valid-lifetime', 'temporary-preferred-lifetime')
IPV6_PARAMS = ('enabled', 'forwarding', 'mtu', 'dup-addr-detect-transmits')
L2_PARAMS = ('bridge-domain', 'split-horizon-group', 'bridged-virtual-interface')
ROUTING_PARAMS = ('vrf-id',)
SUB_IF_MATCH = ('default', 'untagged', 'vlan-tagged', 'vlan-tagged-exact-match')
SUB_IF_PARAMS = ('identifier', 'vlan-type', 'enabled')
TAP_PARAMS = ('tap-name', 'mac', 'device-instance')
VHOST_USER_PARAMS = ('socket', 'role')
VXLAN_GPE_PARAMS = ('local', 'remote', 'vni', 'next-protocol', 'encap-vrf-id', 'decap-vrf-id')
VXLAN_PARAMS = ('src', 'dst', 'vni', 'encap-vrf-id')
static add_bridge_domain_to_interface(node, interface, bd_name, split_horizon_group=None, bvi=None)

Add a new bridge domain to an interface and set its parameters.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – Interface name, key, link name or sw_if_index.
  • bd_name (str) – Bridge domain name.
  • split_horizon_group (str) – Split-horizon group name.
  • bvi (str) – The bridged virtual interface.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If the interface is not present on the node.

static add_bridge_domain_to_sub_interface(node, super_interface, identifier, config)

Add a sub-interface to a bridge domain and set its parameters.

Parameters:
  • node (dict) – Honeycomb node.
  • super_interface (str) – Super interface.
  • identifier (int) – The ID of sub-interface.
  • config (dict) – Bridge domain configuration.
Returns:

Content of response.

Return type:

bytearray

static add_first_ipv4_address(node, interface, ip_addr, network)

Add the first IPv4 address.

If there are any other addresses configured, they will be removed.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
  • ip_addr (str) – IPv4 address to be set.
  • network (str or int) – Netmask or length of network prefix.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If the provided netmask or prefix is not valid.

static add_first_ipv6_address(node, interface, ip_addr, prefix_len)

Add the first IPv6 address.

If there are any other addresses configured, they will be removed.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
  • ip_addr (str) – IPv6 address to be set.
  • prefix_len (str) – Prefix length.
Returns:

Content of response.

Return type:

bytearray

static add_interface_local0_to_topology(node)

Use Topology methods to add interface “local0” to working topology, if not already present.

Parameters:node (dict) – DUT node.
static add_ipv4_address(node, interface, ip_addr, network)

Add IPv4 address.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
  • ip_addr (str) – IPv4 address to be set.
  • network (str or int) – Netmask or length of network prefix.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If the provided netmask or prefix is not valid.

static add_ipv4_address_to_sub_interface(node, super_interface, identifier, ip_addr, network)

Add an ipv4 address to the specified sub-interface, with the provided netmask or network prefix length. Any existing ipv4 addresses on the sub-interface will be replaced.

Parameters:
  • node (dict) – Honeycomb node.
  • super_interface (str) – Super interface.
  • identifier (int) – The ID of sub-interface.
  • ip_addr (str) – IPv4 address to be set.
  • network (str or int) – Network mask or network prefix length.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If the provided netmask or prefix is not valid.

static add_ipv4_neighbor(node, interface, ip_addr, link_layer_address)

Add the IPv4 neighbour.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
  • ip_addr (str) – IPv4 address of neighbour to be set.
  • link_layer_address (str) – Link layer address.
Returns:

Content of response.

Return type:

bytearray

static add_ipv6_address(node, interface, ip_addr, prefix_len)

Add IPv6 address.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
  • ip_addr (str) – IPv6 address to be set.
  • prefix_len (str) – Prefix length.
Returns:

Content of response.

Return type:

bytearray

static add_ipv6_neighbor(node, interface, ip_addr, link_layer_address)

Add the IPv6 neighbour.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
  • ip_addr (str) – IPv6 address of neighbour to be set.
  • link_layer_address (str) – Link layer address.
Returns:

Content of response.

Return type:

bytearray

static check_disabled_interface(node, interface)

Retrieves list of disabled interface indices from Honeycomb, and matches with the provided interface by index.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (int) – Index number of an interface on the node.
Returns:

True if the interface exists in disabled interfaces.

Return type:

bool

Raises:

HoneycombError – If the interface is not present in retrieved list of disabled interfaces.

static compare_data_structures(data, ref, _path='')

Checks if data obtained from UUT is as expected. If it is not, proceeds down the list/dictionary tree and finds the point of mismatch.

Parameters:
  • data – Data to be checked.
  • ref – Referential data used for comparison.
  • _path – Used in recursive calls, stores the path taken down

the JSON tree. :type data: dict :type ref: dict :type _path: str

Raises:HoneycombError – If the data structures do not match in some way,

or if they are not in deserialized JSON format.

static compare_interface_lists(list1, list2)

Compare provided lists of interfaces by name.

Parameters:
  • list1 (list) – List of interfaces.
  • list2 (list) – List of interfaces.
Raises:

HoneycombError – If an interface exists in only one of the lists.

static configure_interface_base(node, interface, param, value)

Configure the base parameters of interface.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • param – Parameter to configure (set, change, remove)
  • value – The value of parameter. If None, the parameter will be

removed. :type node: dict :type interface: str :type param: str :type value: str :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static configure_interface_ethernet(node, interface, param, value)

Configure the ethernet parameters of interface.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • param – Parameter to configure (set, change, remove)
  • value – The value of parameter. If None, the parameter will be

removed. :type node: dict :type interface: str :type param: str :type value: str :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static configure_interface_ipv4(node, interface, param, value)

Configure IPv4 parameters of interface.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • param – Parameter to configure (set, change, remove)
  • value – The value of parameter. If None, the parameter will be

removed. :type node: dict :type interface: str :type param: str :type value: str :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static configure_interface_ipv6(node, interface, param, value)

Configure IPv6 parameters of interface

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • param – Parameter to configure (set, change, remove)
  • value – The value of parameter. If None, the parameter will be

removed. :type node: dict :type interface: str :type param: str :type value: str :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static configure_interface_l2(node, interface, param, value)

Configure the L2 parameters of interface.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • param – Parameter to configure (set, change, remove)
  • value – The value of parameter. If None, the parameter will be

removed. :type node: dict :type interface: str :type param: str :type value: str :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static configure_interface_routing(node, interface, param, value)

Configure the routing parameters of interface.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • param – Parameter to configure (set, change, remove)
  • value – The value of parameter. If None, the parameter will be

removed. :type node: dict :type interface: str :type param: str :type value: str :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static configure_interface_span(node, dst_interface, *src_interfaces)
Configure SPAN port mirroring on the specified interfaces. If no
source interface is provided, SPAN will be disabled.
Parameters:
  • node (dict) – Honeycomb node.
  • dst_interface (str) – Interface to mirror packets to.
  • src_interfaces (list of str) – List of interfaces to mirror packets from.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If SPAN could not be configured.

static configure_interface_tap(node, interface, **kwargs)

Configure TAP on the interface.

The keyword configures TAP parameters on the given interface. The type of interface must be set to “v3po:tap”. The new TAP parameters overwrite the current configuration. If a parameter in new configuration is missing, it is removed from TAP configuration. If the dictionary kwargs is empty, TAP configuration is removed.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • kwargs – Parameters and their values. The accepted parameters are

defined in InterfaceKeywords.TAP_PARAMS. :type node: dict :type interface: str :type kwargs: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static configure_interface_vhost_user(node, interface, **kwargs)

Configure vhost-user on the interface.

The keyword configures vhost-user parameters on the given interface. The type of interface must be set to “v3po:vhost-user”. The new vhost-user parameters overwrite the current configuration. If a parameter in new configuration is missing, it is removed from vhost-user configuration. If the dictionary kwargs is empty, vhost-user configuration is removed.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • kwargs – Parameters and their values. The accepted parameters are

defined in InterfaceKeywords.VHOST_USER_PARAMS. :type node: dict :type interface: str :type kwargs: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static configure_interface_vxlan(node, interface, **kwargs)

Configure VxLAN on the interface.

The keyword configures VxLAN parameters on the given interface. The type of interface must be set to “v3po:vxlan-tunnel”. The new VxLAN parameters overwrite the current configuration. If a parameter in new configuration is missing, it is removed from VxLAN configuration. If the dictionary kwargs is empty, VxLAN configuration is removed.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • kwargs – Parameters and their values. The accepted parameters are

defined in InterfaceKeywords.VXLAN_PARAMS. :type node: dict :type interface: str :type kwargs: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static configure_tag_rewrite(node, super_interface, identifier, config)

Add / change / disable vlan tag rewrite on a sub-interface.

Parameters:
  • node (dict) – Honeycomb node.
  • super_interface (str) – Super interface.
  • identifier (int) – The ID of sub-interface.
  • config (dict) – Rewrite tag configuration.
Returns:

Content of response.

Return type:

bytearray

static create_pbb_sub_interface(node, intf, params)

Creates a PBB sub-interface on the given interface and sets its parameters.

Parameters:
  • node – Honeycomb node.
  • intf – The interface where PBB sub-interface will be configured.
  • params – Configuration parameters of the sub-interface to be

created. :type node: dict :type intf: str :type params: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the configuration of sub-interface is not successful.

static create_sub_interface(node, super_interface, match, tags=None, **kwargs)

Create a new sub-interface.

Parameters:
  • node – Honeycomb node.
  • super_interface – Super interface.
  • match – Match type. The valid values are defined in

InterfaceKeywords.SUB_IF_MATCH. :param tags: List of tags. :param kwargs: Parameters and their values. The accepted parameters are defined in InterfaceKeywords.SUB_IF_PARAMS. :type node: dict :type super_interface: str :type match: str :type tags: list :type kwargs: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid. :raises KeyError: If the parameter ‘match’ is invalid.

static create_tap_interface(node, interface, **kwargs)

Create a new TAP interface.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • kwargs – Parameters and their values. The accepted parameters are

defined in InterfaceKeywords.TAP_PARAMS. :type node: dict :type interface: str :type kwargs: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static create_vhost_user_interface(node, interface, **kwargs)

Create a new vhost-user interface.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • kwargs – Parameters and their values. The accepted parameters are

defined in InterfaceKeywords.VHOST_USER_PARAMS. :type node: dict :type interface: str :type kwargs: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static create_vxlan_gpe_interface(node, interface, **kwargs)

Create a new VxLAN GPE interface.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface to be created.
  • kwargs – Parameters and their values. The accepted parameters are

defined in InterfaceKeywords.VXLAN_GPE_PARAMS. :type node: dict :type interface: str :type kwargs: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If a parameter in kwargs is not valid.

static create_vxlan_interface(node, interface, **kwargs)

Create a new VxLAN interface.

Parameters:
  • node – Honeycomb node.
  • interface – The name of interface.
  • kwargs – Parameters and their values. The accepted parameters are

defined in InterfaceKeywords.VXLAN_PARAMS. :type node: dict :type interface: str :type kwargs: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the parameter is not valid.

static delete_interface(node, interface)

Delete an interface.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If it is not possible to get information about

interfaces or it is not possible to delete the interface.

static delete_pbb_sub_interface(node, intf)

Deletes the given PBB sub-interface.

Parameters:
  • node (dict) – Honeycomb node.
  • intf (str) – The interface where PBB sub-interface will be deleted.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If the removal of sub-interface is not

successful.

static disable_acl_on_interface(node, interface)

Disable ACL on the given interface.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The interface where the ACL will be disabled.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If the configuration of interface is not

successful.

static enable_acl_on_interface(node, interface, table_name)

Enable ACL on the given interface.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The interface where the ACL will be enabled.
  • table_name (str) – Name of the classify table.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If the configuration of interface is not

successful.

static get_all_interfaces_cfg_data(node)

Get configuration data about all interfaces from Honeycomb.

Parameters:node (dict) – Honeycomb node.
Returns:Configuration data about all interfaces from Honeycomb.
Return type:list
Raises:HoneycombError – If it is not possible to get configuration data.
static get_all_interfaces_oper_data(node)

Get operational data about all interfaces from Honeycomb.

Parameters:node (dict) – Honeycomb node.
Returns:Operational data about all interfaces from Honeycomb.
Return type:list
Raises:HoneycombError – If it is not possible to get operational data.
static get_bd_data_from_sub_interface(node, super_interface, identifier)

Get the operational data about the bridge domain from sub-interface.

Parameters:
  • node (dict) – Honeycomb node.
  • super_interface (str) – Super interface.
  • identifier (int) – The ID of sub-interface.
Returns:

Operational data about the bridge domain.

Return type:

dict

Raises:

HoneycombError – If there is no sub-interface with the given ID.

static get_bd_oper_data_from_interface(node, interface)

Returns operational data about bridge domain settings in the interface.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
Returns:

Operational data about bridge domain settings in the

interface. :rtype: dict

static get_disabled_interfaces_oper_data(node)

Get operational data about all disabled interfaces from Honeycomb.

Parameters:node (dict) – Honeycomb node.
Returns:Operational data about disabled interfaces.
Return type:list
Raises:HoneycombError – If it is not possible to get operational data.
static get_interface_cfg_data(node, interface)

Get configuration data about the given interface from Honeycomb.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
Returns:

Configuration data about the given interface from Honeycomb.

Return type:

dict

static get_interface_oper_data(node, interface)

Get operational data about the given interface from Honeycomb.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
Returns:

Operational data about the given interface from Honeycomb.

Return type:

dict

static get_pbb_sub_interface_oper_data(node, intf, sub_if_id)

Retrieves PBB sub-interface operational data from Honeycomb.

Parameters:
  • node (dict) – Honeycomb node.
  • intf (str) – The interface where PBB sub-interface is located.
  • sub_if_id (str or int) – ID of the PBB sub-interface.
Returns:

PBB sub-interface operational data.

Return type:

dict

Raises:

HoneycombError – If the removal of sub-interface is not

successful.

static get_sub_interface_oper_data(node, super_interface, identifier)

Retrieves sub-interface operational data using Honeycomb API.

Parameters:
  • node (dict) – Honeycomb node.
  • super_interface (str) – Super interface.
  • identifier (int) – The ID of sub-interface.
Returns:

Sub-interface operational data.

Return type:

dict

Raises:

HoneycombError – If there is no sub-interface with the given ID.

static get_tag_rewrite_oper_data(node, super_interface, identifier)

Get the operational data about tag rewrite.

Parameters:
  • node (dict) – Honeycomb node.
  • super_interface (str) – Super interface.
  • identifier (int) – The ID of sub-interface.
Returns:

Operational data about tag rewrite.

Return type:

dict

Raises:

HoneycombError – If there is no sub-interface with the given ID.

static remove_all_ipv4_addresses(node, interface)

Remove all IPv4 addresses from interface.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
Returns:

Content of response.

Return type:

bytearray

static remove_all_ipv4_addresses_from_sub_interface(node, super_interface, identifier)

Remove all ipv4 addresses from the specified sub-interface.

Parameters:
  • node (dict) – Honeycomb node.
  • super_interface (str) – Super interface.
  • identifier (int) – The ID of sub-interface.
Returns:

Content of response.

Return type:

bytearray

static remove_all_ipv4_neighbors(node, interface)

Remove all IPv4 neighbours.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
Returns:

Content of response.

Return type:

bytearray

static remove_all_ipv6_addresses(node, interface)

Remove all IPv6 addresses from interface.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
Returns:

Content of response.

Return type:

bytearray

static remove_all_ipv6_neighbors(node, interface)

Remove all IPv6 neighbours.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
Returns:

Content of response.

Return type:

bytearray

static remove_all_sub_interfaces(node, super_interface)

Remove all sub-interfaces from the given interface.

Parameters:
  • node (dict) – Honeycomb node.
  • super_interface (str) – Super interface.
Returns:

Content of response.

Return type:

bytearray

static remove_bridge_domain_from_interface(node, interface)

Remove bridge domain assignment from interface.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str or int) – Interface name, key, link name or sw_if_index.
Raises:

HoneycombError – If the operation fails.

static set_interface_down(node, interface)

Set the administration state of VPP interface to down.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
Returns:

Content of response.

Return type:

bytearray

static set_interface_state(node, interface, state='up')

Set VPP interface state.

The keyword changes the administration state of interface to up or down depending on the parameter “state”.

Parameters:
  • node – Honeycomb node.
  • interface – Interface name, key, link name or sw_if_index.
  • state – The requested state, only “up” and “down” are valid

values. :type node: dict :type interface: str :type state: str :returns: Content of response. :rtype: bytearray :raises KeyError: If the argument “state” is nor “up” or “down”. :raises HoneycombError: If the interface is not present on the node.

static set_interface_up(node, interface)

Set the administration state of VPP interface to up.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – The name of interface.
Returns:

Content of response

Return type:

bytearray

static set_sub_interface_state(node, super_interface, identifier, state)

Set the administrative state of sub-interface.

Parameters:
  • node (dict) – Honeycomb node.
  • super_interface (str) – Super interface.
  • identifier (int) – The ID of sub-interface.
  • state (str) – Required sub-interface state - up or down.
Returns:

Content of response.

Return type:

bytearray

HcAPIKwNSH module

This module implements keywords to manipulate NSH-SFC data structures using Honeycomb REST API.

class resources.libraries.python.honeycomb.HcAPIKwNSH.NSHKeywords

Bases: object

Implementation of keywords which make it possible to: - add and remove NSH entries, - get operational data about NSH entries, - add and remove NSH maps, - get operational data about NSH maps.

static add_nsh_entry(node, name, data)

Add an NSH entry to the list of entries. The keyword does not validate given data.

Parameters:
  • node (dict) – Honeycomb node.
  • name (str) – Name for the NSH entry.
  • data (dict) – Settings for the new entry.
Returns:

Content of response.

Return type:

bytearray

static add_nsh_map(node, name, data)

Add an NSH map to the list of maps. The keyword does not validate given data.

Parameters:
  • node (dict) – Honeycomb node.
  • name (str) – Name for the NSH map.
  • data (dict) – Settings for the new map.
Returns:

Content of response.

Return type:

bytearray

static clear_nsh_settings(node)

Remove the entire NSH container with all of its entries and maps.

Parameters:node (dict) – Honeycomb node.
Returns:Content of response.
Return type:bytearray
static get_nsh_oper_data(node, entry_name=None, map_name=None)

Get all NSH operational data present on the node. Optionally filter out data for a specific entry or map.

Parameters:
  • node – Honeycomb node.
  • entry_name – Name of a specific NSH entry. Optional.
  • map_name – Name of a specific NSH map. Optional. Do not use

together with entry_name. :type node: dict :type entry_name: str :type map_name: str :return: List of classify tables. :rtype: list

static remove_nsh_entry(node, name)

Remove an NSH entry from the list of entries. :param node: Honeycomb node. :param name: Name of the NSH entry. :type node: dict :type name: str :return: Content of response. :rtype: bytearray

static remove_nsh_map(node, name)

Remove an NSH map from the list of maps. :param node: Honeycomb node. :param name: Name of the NSH map. :type node: dict :type name: str :return: Content of response. :rtype: bytearray

HcPersistence module

Implementation of keywords for managing Honeycomb persistence files.

class resources.libraries.python.honeycomb.HcPersistence.HcPersistence

Bases: object

Implements keywords for managing Honeycomb persistence files.

The keywords implemented in this class make possible to: - find and replace strings in config.json persistence file

static clear_persisted_honeycomb_config(*nodes)

Remove configuration data persisted from last Honeycomb session. Default configuration will be used instead.

Parameters:nodes (list) – List of DUTs to execute on.
Raises:HoneycombError – If persisted configuration could not be removed.
static log_persisted_configuration(node)

Read contents of Honeycomb persistence files and print them to log.

Parameters:node (dict) – Honeycomb node.
static modify_persistence_files(node, find, replace)
Searches contents of persistence file data.json for the provided
string, and replaces all occurrences with another string.
Parameters:
  • node (dict) – Honeycomb node.
  • find (string) – Text to find in file.
  • replace (string) – String to replace anything found with.
Raises:

HoneycombError – If persistent configuration couldn’t be

modified.

HoneycombSetup module

Implementation of keywords for Honeycomb setup.

class resources.libraries.python.honeycomb.HoneycombSetup.HoneycombSetup

Bases: object

Implements keywords for Honeycomb setup.

The keywords implemented in this class make possible to: - start Honeycomb, - stop Honeycomb, - check the Honeycomb start-up state, - check the Honeycomb shutdown state, - add VPP to the topology.

static check_honeycomb_shutdown_state(*nodes)

Check state of Honeycomb service during shutdown on specified nodes.

Honeycomb nodes reply with connection refused or the following status codes depending on shutdown progress: codes 200, 404.

Parameters:nodes (list) – List of DUT nodes stopping Honeycomb.
Returns:True if all GETs fail to connect.

:rtype bool

static check_honeycomb_startup_state(*nodes)

Check state of Honeycomb service during startup on specified nodes.

Reads html path from template file oper_vpp_version.url.

Honeycomb nodes reply with connection refused or the following status codes depending on startup progress: codes 200, 401, 403, 404, 500, 503

Parameters:nodes (list) – List of DUT nodes starting Honeycomb.
Returns:True if all GETs returned code 200(OK).

:rtype bool

static configure_log_level(node, level)

Set Honeycomb logging to the specified level.

Parameters:
  • node (dict) – Honeycomb node.
  • level (str) – Log level (INFO, DEBUG, TRACE).
static configure_unsecured_access(*nodes)

Configure Honeycomb to allow restconf requests through insecure HTTP used by tests. By default this is only allowed for localhost.

param nodes:All nodes in test topology.
type nodes:dict
raises HoneycombError:
 If the configuration could not be changed.
static enable_module_features(node)

Configure Honeycomb to use VPP modules that are disabled by default.

Note: If the module is not enabled in VPP, Honeycomb will be unable to establish VPP connection.

Parameters:node (dict) – Honeycomb node.
Raises:HoneycombError – If the configuration could not be changed.
static print_environment(nodes)

Print information about the nodes to log. The information is defined by commands in cmds tuple at the beginning of this method.

Parameters:nodes (list) – List of DUT nodes to get information about.
static print_ports(node)

Uses “sudo netstat -anp | grep java” to print port where a java application listens.

Parameters:node (dict) – Honeycomb node where we want to print the ports.
static start_honeycomb_on_duts(*nodes)

Start Honeycomb on specified DUT nodes.

This keyword starts the Honeycomb service on specified DUTs. The keyword just starts the Honeycomb and does not check its startup state. Use the keyword “Check Honeycomb Startup State” to check if the Honeycomb is up and running. Honeycomb must be installed in “/opt” directory, otherwise the start will fail. :param nodes: List of nodes to start Honeycomb on. :type nodes: list :raises HoneycombError: If Honeycomb fails to start.

static stop_honeycomb_on_duts(*nodes)

Stop the Honeycomb service on specified DUT nodes.

This keyword stops the Honeycomb service on specified nodes. It just stops the Honeycomb and does not check its shutdown state. Use the keyword “Check Honeycomb Shutdown State” to check if Honeycomb has stopped. :param nodes: List of nodes to stop Honeycomb on. :type nodes: list :raises HoneycombError: If Honeycomb failed to stop.

HoneycombUtil module

Implementation of low level functionality used in communication with Honeycomb.

Exception HoneycombError is used in all methods and in all modules with Honeycomb keywords.

Class HoneycombUtil implements methods used by Honeycomb keywords. They must not be used directly in tests. Use keywords implemented in the module HoneycombAPIKeywords instead.

class resources.libraries.python.honeycomb.HoneycombUtil.DataRepresentation

Bases: enum.Enum

Representation of data sent by PUT and POST requests.

JSON = <DataRepresentation.JSON: 1>
NO_DATA = <DataRepresentation.NO_DATA: 0>
TXT = <DataRepresentation.TXT: 3>
XML = <DataRepresentation.XML: 2>
exception resources.libraries.python.honeycomb.HoneycombUtil.HoneycombError(msg, details='', enable_logging=True)

Bases: exceptions.Exception

Exception(s) raised by methods working with Honeycomb.

When raising this exception, put this information to the message in this order:

  • short description of the encountered problem (parameter msg),
  • relevant messages if there are any collected, e.g., from caught exception (optional parameter details),
  • relevant data if there are any collected (optional parameter details).

The logging is performed on two levels: 1. error - short description of the problem; 2. debug - detailed information.

class resources.libraries.python.honeycomb.HoneycombUtil.HoneycombUtil

Bases: object

Implements low level functionality used in communication with Honeycomb.

There are implemented methods to get, put and delete data to/from Honeycomb. They are based on functionality implemented in the module HTTPRequests which uses HTTP requests GET, PUT, POST and DELETE to communicate with Honeycomb.

It is possible to PUT the data represented as XML or JSON structures or as plain text. Data received in the response of GET are always represented as a JSON structure.

There are also two supportive methods implemented: - read_path_from_url_file which reads URL file and returns a path (see

docs/honeycomb_url_files.rst).
  • parse_json_response which parses data from response in JSON representation according to given path.
static archive_honeycomb_log(node)

Copy honeycomb log file from DUT node to VIRL for archiving.

Parameters:node (dict) – Honeycomb node.
static delete_honeycomb_data(node, url_file, path='')

Delete data from Honeycomb according to given URL.

Parameters:
  • node – Honeycomb node.
  • url_file – URL file. The argument contains only the name of file

without extension, not the full path. :param path: Path which is added to the base path to identify the data. :type node: dict :type url_file: str :type path: str :returns: Status code and content of response. :rtype tuple

static find_item(data, path)

Find a data item (single leaf or sub-tree) in data received from Honeycomb REST API.

Path format: The path is a tuple with items navigating to requested data. The items can be strings or tuples: - string item represents a dictionary key in data, - tuple item represents list item in data.

Example: data = {

“interfaces”: {
“interface”: [
{
“name”: “GigabitEthernet0/8/0”, “enabled”: “true”, “type”: “iana-if-type:ethernetCsmacd”,

}, {

“name”: “local0”, “enabled”: “false”, “type”: “iana-if-type:ethernetCsmacd”,

}

]

}

}

path = (“interfaces”, (“interface”, “name”, “local0”), “enabled”) This path points to “false”.

The tuple (“interface”, “name”, “local0”) consists of: index 0 - dictionary key pointing to a list, index 1 - key which identifies an item in the list, it is also marked as

the key in corresponding yang file.

index 2 - key value.

Parameters:
  • data (dict) – Data received from Honeycomb REST API.
  • path (tuple) – Path to data we want to find.
Returns:

Data represented by path.

Return type:

str, dict, or list

Raises:

HoneycombError – If the data has not been found.

static get_honeycomb_data(node, url_file, path='')

Retrieve data from Honeycomb according to given URL.

Parameters:
  • node – Honeycomb node.
  • url_file – URL file. The argument contains only the name of file

without extension, not the full path. :param path: Path which is added to the base path to identify the data. :type node: dict :type url_file: str :type path: str :returns: Status code and content of response. :rtype tuple

static post_honeycomb_data(node, url_file, data=None, data_representation=<DataRepresentation.JSON: 1>, timeout=10)

Send a POST request and return the status code and response content.

Parameters:
  • node – Honeycomb node.
  • url_file – URL file. The argument contains only the name of file

without extension, not the full path. :param data: Configuration data to be sent to Honeycomb. :param data_representation: How the data is represented. :param timeout: How long to wait for the server to send data before giving up. :type node: dict :type url_file: str :type data: dict, str :type data_representation: DataRepresentation :type timeout: int :returns: Status code and content of response. :rtype: tuple :raises HoneycombError: If the given data representation is not defined in HEADERS.

static put_honeycomb_data(node, url_file, data, path='', data_representation=<DataRepresentation.JSON: 1>)

Send configuration data using PUT request and return the status code and response content.

Parameters:
  • node – Honeycomb node.
  • url_file – URL file. The argument contains only the name of file

without extension, not the full path. :param data: Configuration data to be sent to Honeycomb. :param path: Path which is added to the base path to identify the data. :param data_representation: How the data is represented. :type node: dict :type url_file: str :type data: dict, str :type path: str :type data_representation: DataRepresentation :returns: Status code and content of response. :rtype: tuple :raises HoneycombError: If the given data representation is not defined in HEADERS.

static read_path_from_url_file(url_file)

Read path from *.url file.

For more information about *.url file see docs/honeycomb_url_files.rst :param url_file: URL file. The argument contains only the name of file without extension, not the full path. :type url_file: str :returns: Requested path. :rtype: str

static remove_item(data, path)

Remove a data item (single leaf or sub-tree) in data received from Honeycomb REST API.

Parameters:
  • data (dict) – Data received from Honeycomb REST API.
  • path (tuple) – Path to data we want to remove.
Returns:

Original data without removed part.

Return type:

dict

static set_item_value(data, path, new_value)

Set or change the value (single leaf or sub-tree) in data received from Honeycomb REST API.

If the item is not present in the data structure, it is created.

Parameters:
  • data (dict) – Data received from Honeycomb REST API.
  • path (tuple) – Path to data we want to change or create.
  • new_value (str, dict or list) – The value to be set.
Returns:

Original data with the new value.

Return type:

dict

Lisp module

This module implements keywords to manipulate Lisp data structures using Honeycomb REST API.

class resources.libraries.python.honeycomb.Lisp.LispKeywords

Bases: object

Implementation of keywords which make it possible to: - enable/disable Lisp feature - configure Lisp mappings - configure locator sets - configure map resolver - configure Lisp PITR feature - read operational data for all of the above

static add_lisp_adjacency(node, vni_id, map_name, adjacency_name, data)

Add an adjacency to an existing Lisp mapping.

Parameters:
  • node (dict) – Honeycomb node.
  • vni_id (int) – vni_id of the mapping.
  • map_name (str) – Name of the mapping.
  • adjacency_name (str) – Name for the new adjacency.
  • data (dict) – Adjacency settings.
Returns:

Content of response.

Return type:

bytearray

static add_locator(node, interface, locator_set, priority=1, weight=1)

Configure a new Lisp locator set.

Parameters:
  • node – Honeycomb node.
  • interface – An interface on the node.
  • locator_set – Name for the new locator set.
  • priority – Priority parameter for the locator.

:param weight. Weight parameter for the locator. :type node: dict :type interface: str :type locator_set: str :type priority: int :type weight: int :returns: Content of response. :rtype: bytearray

static add_map_resolver(node, ip_address)

Configure map resolver with the specified IP address.

Parameters:
  • node (dict) – Honeycomb node.
  • ip_address (str) – IP address to configure map resolver with.
Returns:

Content of response.

Return type:

bytearray

static configure_lisp_mapping(node, data)

Modify eid-table configuration to the data provided.

Parameters:
  • node (dict) – Honeycomb node.
  • data (dict) – Settings for the Lisp mappings.
Returns:

Content of response.

Return type:

bytearray

static configure_pitr(node, locator_set=None)

Configure PITR feature with the specified locator set. If not locator set is specified, disable PITR instead.

Parameters:
  • node (dict) – Honeycomb node.
  • locator_set (str) – Name of a locator set. Optional.
Returns:

Content of response.

Return type:

bytearray

static delete_map_resolver(node)

Delete an existing map resolver.

Parameters:node (dict) – Honeycomb node
Returns:Content of response
Return type:bytearray
static disable_lisp(node)

Remove all Lisp settings on the node.

Parameters:node (dict) – Honeycomb node.
Returns:Content of response.
Return type:bytearray
static get_lisp_operational_data(node)

Retrieve Lisp properties from Honeycomb operational data.

Parameters:node (dict) – Honeycomb node.
Returns:List operational data.
Return type:bytearray
static set_lisp_state(node, state)

Enable or disable the Lisp feature.

Parameters:
  • node (dict) – Honeycomb node.
  • state (str) – Desired Lisp state, enable or disable.
Returns:

Content of response.

Return type:

bytearray

NAT module

Keywords to manipulate NAT configuration using Honeycomb REST API.

class resources.libraries.python.honeycomb.NAT.NATKeywords

Bases: object

Keywords for NAT configuration.

static configure_nat_entries(node, data, instance=0, entry=1)

Configure NAT entries on node.

Parameters:
  • node (dict) – Honeycomb node.
  • data (dict) – Data to be configured on node.
  • instance (int) – NAT instance ID.
  • entry (int) – NAT entry index.
Returns:

Content of response.

Return type:

bytearray

static configure_nat_on_interface(node, interface, direction, delete=False)

Configure NAT on the specified interface.

Parameters:
  • node (dict) – Honeycomb node.
  • interface (str) – Name of an interface on the node.
  • direction (str) – NAT direction, outbound or inbound.
  • delete (bool) – Delete an existing interface NAT configuration.
Returns:

Content of response.

Return type:

bytearray

Raises:

HoneycombError – If the operation fails.

static get_nat_oper_data(node)

Read NAT operational data.

Parameters:node (dict) – Honeycomb node.
Returns:Content of response.
Return type:bytearray
Raises:HoneycombError – If the operation fails or the response

is not as expected.

Netconf module

Keywords used to connect to Honeycomb through Netconf, send messages and receive replies.

class resources.libraries.python.honeycomb.Netconf.Netconf(delimiter=']]>]]>')

Bases: object

Implements methods for creating and managing Netconf sessions.

create_session(node, hello, time_out=10)

Create an SSH session, connect to Honeycomb on the specified node, open a communication channel to the Netconf subsystem and exchange hello messages.

Parameters:
  • node (dict) – Honeycomb node.
  • hello (str) – Hello message and capability list to be sent to Honeycomb.
  • time_out (int) – Timeout value for the connection in seconds.
get_all_responses(size=4096, time_out=3)
Read responses from the receive buffer and catenate together
until a read operation times out.
Parameters:
  • size – Maximum number of bytes to read in one iteration.
  • time_out – Timeout value for getting the complete response.

:type size:int :type time_out:int :returns: Content of response. :rtype: str

get_response(size=4096, time_out=10, err='Unspecified Error.')

Iteratively read data from the receive buffer and catenate together until message ends with the message delimiter, or until timeout is reached.

Parameters:
  • size – Maximum number of bytes to read in one iteration.
  • time_out – Timeout value for getting the complete response.
  • err – Error message to provide when timeout is reached.

:type size:int :type time_out:int :type err:str :returns: Content of response. :rtype: str :raises HoneycombError: If the read process times out.

send(message)

Sends provided message through the channel.

Parameters:message (str) – Message to be sent to Honeycomb.

Notifications module

Implementation of keywords for managing Honeycomb notifications.

class resources.libraries.python.honeycomb.Notifications.Notifications(delimiter=']]>]]>')

Bases: resources.libraries.python.honeycomb.Netconf.Netconf

Implements keywords for receiving Honeycomb notifications.

The keywords implemented in this class make it possible to: - receive notifications from Honeycomb - read received notifications

add_notification_listener(subscription, time_out=10)

Open a new channel on the SSH session, connect to Netconf subsystem and subscribe to receive Honeycomb notifications.

Parameters:
  • subscription (str) – RPC for subscription to notifications.
  • time_out (int) – Timeout value for each read operation in seconds.
Raises:

HoneycombError – If subscription to notifications fails.

get_notification(time_out=10)

Read and return the next notification message.

Parameters:time_out (int) – Timeout value for the read operation in seconds.
Returns:Data received from buffer.
Return type:str