code
stringlengths 10
58.5k
| file_path
stringlengths 53
173
|
---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
class IxiaError(RuntimeError):
''' Ixia error '''
TCL_NOT_FOUND = 1
HLTAPI_NOT_FOUND = 2
HLTAPI_NOT_PREPARED = 3
HLTAPI_NOT_INITED = 4
COMMAND_FAIL = 5,
WINREG_NOT_FOUND = 6
IXNETWORK_API_NOT_FOUND = 7
XML_PROCESS_FAIL = 8
IXNET_ERROR = 9
HLAPI_NO_SESSION = 10
IXNETWORK_TCL_API_NOT_FOUND = 11
__error_texts = {
TCL_NOT_FOUND: 'No compatible TCL interpretor could be found',
HLTAPI_NOT_FOUND: 'No HLTAPI installation found',
HLTAPI_NOT_PREPARED: 'Unable to prepare the initialization of Ixia TCL package',
HLTAPI_NOT_INITED: 'Unable to initialize HLTAPI',
COMMAND_FAIL: 'HLTAPI command failed',
WINREG_NOT_FOUND: 'Could not find a product in windows registry. Please specify manually in constructor',
IXNETWORK_API_NOT_FOUND: 'IxNetwork python API was not found',
XML_PROCESS_FAIL: 'Failed to process return xml',
IXNET_ERROR: 'Ixnetwork error occured',
HLAPI_NO_SESSION: 'No NGPF session was found. Please call IxiaNgpf.connect first',
IXNETWORK_TCL_API_NOT_FOUND: 'IxNetwork TCL API/library was not found',
}
def __init__(self, msgid, additional_info=''):
if msgid not in self.__error_texts.keys():
raise ValueError('message id is incorrect')
self.msgid = msgid
self.message = self.__error_texts[msgid]
if additional_info:
self.message += '\nAdditional error info:\n' + additional_info
super(self.__class__, self).__init__(self.message) | KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiaerror.py_part1 |
import sys
import ixiautil
import uuid
from ixiaerror import IxiaError
from ixiautil import Logger
from ixiahlt import IxiaHlt
class IxiaNgpf(object):
'''
Python wrapper class over the NGPF commands
'''
def __init__(self, ixiahlt):
self.__logger = Logger('ixiangpf', print_timestamp=False)
try:
import IxNetwork
except (ImportError, ):
raise IxiaError(IxiaError.IXNETWORK_API_NOT_FOUND)
self.ixiahlt = ixiahlt
self.ixnet = IxNetwork.IxNet()
self.__IxNetwork = IxNetwork
self.__session_id = None
self.NONE = "NO-OPTION-SELECTED-ECF9612A-0DA3-4096-88B3-3941A60BA0F5"
def __ixn_call(self, func_name, *args, **kwargs):
try:
return getattr(self.ixnet, func_name)(*args, **kwargs)
except (self.__IxNetwork.IxNetError, ):
e = sys.exc_info()[1]
raise IxiaError(IxiaError.IXNET_ERROR, str(e))
def __get_session_status(self):
'''
This method blocks the client until the execution of the current command on the opened session is completed
Notes:
1. The method will display intermediate messages that are available, including the command's final status.
2. The method returns the result (in a dict format) of the command currently executing
'''
while True:
# Below command will block until a command response or a message is available
# We need to run it in a loop until a result is available.
return_string = self.__ixn_call('execute', 'GetSessionStatus', self.__session_id)
quote_escape_guid = "{PYTHON-RETURN-SEPARATOR-94C8ABEE-4749-4878-98B0-E3CC4BFCEB72}"
return_string = return_string.replace(quote_escape_guid, "\\\"")
session_status = eval(return_string)
def _print_messages(category):
if 'messages' in session_status:
for (k, v) in session_status['messages'].items():
self.__logger.log(category, v)
if session_status['status'] == IxiaHlt.SUCCESS:
# Print any status messages that are found
if self.__logger.ENABLED:
_print_messages(Logger.CAT_INFO)
if 'result' in session_status:
return session_status['result']
else:
# Command was not handled on IxNet side and we have no result
# If there are messages received log them as warn
_print_messages(Logger.CAT_WARN)
# Return the user the entire dict as it might contain error info.
return session_status
def __set_command_parameters(self, command_id, hlpy_args):
'''
This method requires the following input parameters:
1. A dict whose keys represent attribute names and whose values represent the corresponding attribute values.
The method uses the specified ixnetwork connection to set the sdm attributes of the specified command and
commits the changes at the end of the call.
'''
for (k, v) in hlpy_args.items():
# Required format for IxN setA: objRef, -name, value
self.__ixn_call('setAttribute', command_id, '-' + k, v)
return self.__ixn_call('commit')
def __execute_command(self, command_name, not_implemented_params, mandatory_params, file_params, hlpy_args):
'''
This method will call the specified high level API command using the specified arguments on the currently
opened session. The method will also display any intermediate status messages that are available before
the command execution is finished.
'''
legacy_result = {}
if self.__session_id is None:
raise IxiaError(IxiaError.HLAPI_NO_SESSION)
# Extract the arguments that are not implemented by the ixiangpf namespace
not_implemented_args = ixiautil.extract_specified_args(not_implemented_params, hlpy_args)
# Extract the mandatory arguments
mandatory_args = ixiautil.extract_specified_args(mandatory_params, hlpy_args)
# Extract and process file arguments
file_args = ixiautil.extract_specified_args(file_params, hlpy_args)
self.__process_file_args(hlpy_args, file_args)
if not_implemented_params and mandatory_args:
legacy_result = getattr(self.ixiahlt, command_name)(**not_implemented_args)
if legacy_result['status'] == IxiaHlt.FAIL:
return legacy_result
# Create the command node under the current session
command_node = self.__ixn_call('add', self.__session_id, command_name)
self.__ixn_call('commit')
# Populate the command's arguments
hlpy_args['args_to_validate'] = self.__get_args_to_validate(hlpy_args)
# Call the ixiangpf function
self.__set_command_parameters(command_node, hlpy_args)
self.__ixn_call('execute', 'executeCommand', command_node)
# Block until the command's execution completes and return the result
ixiangpf_result = self.__get_session_status()
if not int(ixiangpf_result['command_handled']):
# Ignore framework's response and call the ixiahlt implementation instead
del hlpy_args['args_to_validate']
return getattr(self.ixiahlt, command_name)(**hlpy_args)
# Just remove the command_handled key before returning
del ixiangpf_result['command_handled']
return ixiautil.merge_dicts(legacy_result, ixiangpf_result)
def __get_port_mapping(self):
''' Accessor for the GetPortMapping util '''
mapping_string = self.ixiahlt.ixiatcl._eval('GetPortMapping')
return mapping_string[1:-1]
def __requires_hlapi_connect(self):
''' Accessor for the RequiresHlapiConnect util '''
return self.ixiahlt.ixiatcl._eval('RequiresHlapiConnect')
def __get_args_to_validate(self, hlpy_args):
'''
This method accepts the following input parameter:
1. A dict whose keys represent attribute names and whose values represent the corresponding attribute values.
The method parses the references and create a string that can be passed to the HLAPI in order to validate the
corresponding arguments.
'''
tcl_string = self.ixiahlt.ixiatcl._tcl_flatten(hlpy_args, key_prefix='-')
return tcl_string
def __process_file_args(self, hlpy_args, file_args):
'''
This method takes the file_args dict and copies all files to the IxNetwork server.
The original file names are then replaced with the new locations from the server.
'''
server_file_args = {}
for (i, (k, v)) in enumerate(file_args.items()):
# add guid to the server file name
persistencePath = self.__ixn_call('getAttribute', '/globals', '-persistencePath')
file_guid = "pythonServerFile" + str(uuid.uuid4()) + "%s"
server_file_args[k] = persistencePath + '\\' + file_guid % i
client_stream = self.__ixn_call('readFrom', v)
server_stream = self.__ixn_call('writeTo', server_file_args[k], '-ixNetRelative', '-overwrite')
self.__ixn_call('execute', 'copyFile', client_stream, server_stream)
hlpy_args.update(server_file_args)
@property
def INTERACTIVE(self):
return self.__logger.ENABLED
# attach all hlapi_framework commands
import ixiangpf_commands.cleanup_session
import ixiangpf_commands.clear_ixiangpf_cache
import ixiangpf_commands.connect
import ixiangpf_commands.dhcp_client_extension_config
import ixiangpf_commands.dhcp_extension_stats
import ixiangpf_commands.dhcp_server_extension_config
import ixiangpf_commands.emulation_ancp_config
import ixiangpf_commands.emulation_ancp_control
import ixiangpf_commands.emulation_ancp_stats
import ixiangpf_commands.emulation_ancp_subscriber_lines_config
import ixiangpf_commands.emulation_bfd_config
import ixiangpf_commands.emulation_bfd_control
import ixiangpf_commands.emulation_bfd_info
import ixiangpf_commands.emulation_bgp_config
import ixiangpf_commands.emulation_bgp_control
import ixiangpf_commands.emulation_bgp_flow_spec_config
import ixiangpf_commands.emulation_bgp_info
import ixiangpf_commands.emulation_bgp_mvpn_config
import ixiangpf_commands.emulation_bgp_route_config
import ixiangpf_commands.emulation_bgp_srte_policies_config
import ixiangpf_commands.emulation_bondedgre_config
import ixiangpf_commands.emulation_bondedgre_control
import ixiangpf_commands.emulation_bondedgre_info
import ixiangpf_commands.emulation_cfm_network_group_config
import ixiangpf_commands.emulation_dhcp_config
import ixiangpf_commands.emulation_dhcp_control
import ixiangpf_commands.emulation_dhcp_group_config
import ixiangpf_commands.emulation_dhcp_server_config
import ixiangpf_commands.emulation_dhcp_server_control
import ixiangpf_commands.emulation_dhcp_server_stats
import ixiangpf_commands.emulation_dhcp_stats
import ixiangpf_commands.emulation_dotonex_config
import ixiangpf_commands.emulation_dotonex_control
import ixiangpf_commands.emulation_dotonex_info
import ixiangpf_commands.emulation_esmc_config
import ixiangpf_commands.emulation_esmc_control
import ixiangpf_commands.emulation_esmc_info
import ixiangpf_commands.emulation_evpn_vxlan_wizard
import ixiangpf_commands.emulation_igmp_config
import ixiangpf_commands.emulation_igmp_control
import ixiangpf_commands.emulation_igmp_group_config
import ixiangpf_commands.emulation_igmp_info
import ixiangpf_commands.emulation_igmp_querier_config
import ixiangpf_commands.emulation_isis_config
import ixiangpf_commands.emulation_isis_control
import ixiangpf_commands.emulation_isis_info
import ixiangpf_commands.emulation_isis_network_group_config
import ixiangpf_commands.emulation_isis_srv6_config
import ixiangpf_commands.emulation_lacp_control
import ixiangpf_commands.emulation_lacp_info
import ixiangpf_commands.emulation_lacp_link_config
import ixiangpf_commands.emulation_lag_config
import ixiangpf_commands.emulation_ldp_config
import ixiangpf_commands.emulation_ldp_control
import ixiangpf_commands.emulation_ldp_info
import ixiangpf_commands.emulation_ldp_route_config
import ixiangpf_commands.emulation_macsec_config
import ixiangpf_commands.emulation_macsec_control
import ixiangpf_commands.emulation_macsec_info
import ixiangpf_commands.emulation_mka_config
import ixiangpf_commands.emulation_mka_control
import ixiangpf_commands.emulation_mka_info
import ixiangpf_commands.emulation_mld_config
import ixiangpf_commands.emulation_mld_control
import ixiangpf_commands.emulation_mld_group_config
import ixiangpf_commands.emulation_mld_info
import ixiangpf_commands.emulation_mld_querier_config
import ixiangpf_commands.emulation_msrp_control
import ixiangpf_commands.emulation_msrp_info
import ixiangpf_commands.emulation_msrp_listener_config
import ixiangpf_commands.emulation_msrp_talker_config
import ixiangpf_commands.emulation_multicast_group_config
import ixiangpf_commands.emulation_multicast_source_config
import ixiangpf_commands.emulation_netconf_client_config
import ixiangpf_commands.emulation_netconf_client_control
import ixiangpf_commands.emulation_netconf_client_info
import ixiangpf_commands.emulation_netconf_server_config
import ixiangpf_commands.emulation_netconf_server_control
import ixiangpf_commands.emulation_netconf_server_info
import ixiangpf_commands.emulation_ngpf_cfm_config
import ixiangpf_commands.emulation_ngpf_cfm_control
import ixiangpf_commands.emulation_ngpf_cfm_info
import ixiangpf_commands.emulation_ospf_config
import ixiangpf_commands.emulation_ospf_control
import ixiangpf_commands.emulation_ospf_info
import ixiangpf_commands.emulation_ospf_lsa_config
import ixiangpf_commands.emulation_ospf_network_group_config
import ixiangpf_commands.emulation_ospf_topology_route_config
import ixiangpf_commands.emulation_ovsdb_config
import ixiangpf_commands.emulation_ovsdb_control
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiangpf.py_part1 |
The original file names are then replaced with the new locations from the server.
'''
server_file_args = {}
for (i, (k, v)) in enumerate(file_args.items()):
# add guid to the server file name
persistencePath = self.__ixn_call('getAttribute', '/globals', '-persistencePath')
file_guid = "pythonServerFile" + str(uuid.uuid4()) + "%s"
server_file_args[k] = persistencePath + '\\' + file_guid % i
client_stream = self.__ixn_call('readFrom', v)
server_stream = self.__ixn_call('writeTo', server_file_args[k], '-ixNetRelative', '-overwrite')
self.__ixn_call('execute', 'copyFile', client_stream, server_stream)
hlpy_args.update(server_file_args)
@property
def INTERACTIVE(self):
return self.__logger.ENABLED
# attach all hlapi_framework commands
import ixiangpf_commands.cleanup_session
import ixiangpf_commands.clear_ixiangpf_cache
import ixiangpf_commands.connect
import ixiangpf_commands.dhcp_client_extension_config
import ixiangpf_commands.dhcp_extension_stats
import ixiangpf_commands.dhcp_server_extension_config
import ixiangpf_commands.emulation_ancp_config
import ixiangpf_commands.emulation_ancp_control
import ixiangpf_commands.emulation_ancp_stats
import ixiangpf_commands.emulation_ancp_subscriber_lines_config
import ixiangpf_commands.emulation_bfd_config
import ixiangpf_commands.emulation_bfd_control
import ixiangpf_commands.emulation_bfd_info
import ixiangpf_commands.emulation_bgp_config
import ixiangpf_commands.emulation_bgp_control
import ixiangpf_commands.emulation_bgp_flow_spec_config
import ixiangpf_commands.emulation_bgp_info
import ixiangpf_commands.emulation_bgp_mvpn_config
import ixiangpf_commands.emulation_bgp_route_config
import ixiangpf_commands.emulation_bgp_srte_policies_config
import ixiangpf_commands.emulation_bondedgre_config
import ixiangpf_commands.emulation_bondedgre_control
import ixiangpf_commands.emulation_bondedgre_info
import ixiangpf_commands.emulation_cfm_network_group_config
import ixiangpf_commands.emulation_dhcp_config
import ixiangpf_commands.emulation_dhcp_control
import ixiangpf_commands.emulation_dhcp_group_config
import ixiangpf_commands.emulation_dhcp_server_config
import ixiangpf_commands.emulation_dhcp_server_control
import ixiangpf_commands.emulation_dhcp_server_stats
import ixiangpf_commands.emulation_dhcp_stats
import ixiangpf_commands.emulation_dotonex_config
import ixiangpf_commands.emulation_dotonex_control
import ixiangpf_commands.emulation_dotonex_info
import ixiangpf_commands.emulation_esmc_config
import ixiangpf_commands.emulation_esmc_control
import ixiangpf_commands.emulation_esmc_info
import ixiangpf_commands.emulation_evpn_vxlan_wizard
import ixiangpf_commands.emulation_igmp_config
import ixiangpf_commands.emulation_igmp_control
import ixiangpf_commands.emulation_igmp_group_config
import ixiangpf_commands.emulation_igmp_info
import ixiangpf_commands.emulation_igmp_querier_config
import ixiangpf_commands.emulation_isis_config
import ixiangpf_commands.emulation_isis_control
import ixiangpf_commands.emulation_isis_info
import ixiangpf_commands.emulation_isis_network_group_config
import ixiangpf_commands.emulation_isis_srv6_config
import ixiangpf_commands.emulation_lacp_control
import ixiangpf_commands.emulation_lacp_info
import ixiangpf_commands.emulation_lacp_link_config
import ixiangpf_commands.emulation_lag_config
import ixiangpf_commands.emulation_ldp_config
import ixiangpf_commands.emulation_ldp_control
import ixiangpf_commands.emulation_ldp_info
import ixiangpf_commands.emulation_ldp_route_config
import ixiangpf_commands.emulation_macsec_config
import ixiangpf_commands.emulation_macsec_control
import ixiangpf_commands.emulation_macsec_info
import ixiangpf_commands.emulation_mka_config
import ixiangpf_commands.emulation_mka_control
import ixiangpf_commands.emulation_mka_info
import ixiangpf_commands.emulation_mld_config
import ixiangpf_commands.emulation_mld_control
import ixiangpf_commands.emulation_mld_group_config
import ixiangpf_commands.emulation_mld_info
import ixiangpf_commands.emulation_mld_querier_config
import ixiangpf_commands.emulation_msrp_control
import ixiangpf_commands.emulation_msrp_info
import ixiangpf_commands.emulation_msrp_listener_config
import ixiangpf_commands.emulation_msrp_talker_config
import ixiangpf_commands.emulation_multicast_group_config
import ixiangpf_commands.emulation_multicast_source_config
import ixiangpf_commands.emulation_netconf_client_config
import ixiangpf_commands.emulation_netconf_client_control
import ixiangpf_commands.emulation_netconf_client_info
import ixiangpf_commands.emulation_netconf_server_config
import ixiangpf_commands.emulation_netconf_server_control
import ixiangpf_commands.emulation_netconf_server_info
import ixiangpf_commands.emulation_ngpf_cfm_config
import ixiangpf_commands.emulation_ngpf_cfm_control
import ixiangpf_commands.emulation_ngpf_cfm_info
import ixiangpf_commands.emulation_ospf_config
import ixiangpf_commands.emulation_ospf_control
import ixiangpf_commands.emulation_ospf_info
import ixiangpf_commands.emulation_ospf_lsa_config
import ixiangpf_commands.emulation_ospf_network_group_config
import ixiangpf_commands.emulation_ospf_topology_route_config
import ixiangpf_commands.emulation_ovsdb_config
import ixiangpf_commands.emulation_ovsdb_control
import ixiangpf_commands.emulation_ovsdb_info
import ixiangpf_commands.emulation_pcc_config
import ixiangpf_commands.emulation_pcc_control
import ixiangpf_commands.emulation_pcc_info
import ixiangpf_commands.emulation_pce_config
import ixiangpf_commands.emulation_pce_control
import ixiangpf_commands.emulation_pce_info
import ixiangpf_commands.emulation_pim_config
import ixiangpf_commands.emulation_pim_control
import ixiangpf_commands.emulation_pim_group_config
import ixiangpf_commands.emulation_pim_info
import ixiangpf_commands.emulation_rsvpte_tunnel_control
import ixiangpf_commands.emulation_rsvp_config
import ixiangpf_commands.emulation_rsvp_control
import ixiangpf_commands.emulation_rsvp_info
import ixiangpf_commands.emulation_rsvp_tunnel_config
import ixiangpf_commands.emulation_static_macsec_config
import ixiangpf_commands.emulation_static_macsec_control
import ixiangpf_commands.emulation_static_macsec_info
import ixiangpf_commands.emulation_vxlan_config
import ixiangpf_commands.emulation_vxlan_control
import ixiangpf_commands.emulation_vxlan_stats
import ixiangpf_commands.get_execution_log
import ixiangpf_commands.interface_config
import ixiangpf_commands.internal_compress_overlays
import ixiangpf_commands.internal_legacy_control
import ixiangpf_commands.ixnetwork_traffic_control
import ixiangpf_commands.ixvm_config
import ixiangpf_commands.ixvm_control
import ixiangpf_commands.ixvm_info
import ixiangpf_commands.l2tp_config
import ixiangpf_commands.l2tp_control
import ixiangpf_commands.l2tp_stats
import ixiangpf_commands.legacy_commands
import ixiangpf_commands.multivalue_config
import ixiangpf_commands.multivalue_subset_config
import ixiangpf_commands.network_group_config
import ixiangpf_commands.pppox_config
import ixiangpf_commands.pppox_control
import ixiangpf_commands.pppox_stats
import ixiangpf_commands.protocol_info
import ixiangpf_commands.ptp_globals_config
import ixiangpf_commands.ptp_options_config
import ixiangpf_commands.ptp_over_ip_config
import ixiangpf_commands.ptp_over_ip_control
import ixiangpf_commands.ptp_over_ip_stats
import ixiangpf_commands.ptp_over_mac_config
import ixiangpf_commands.ptp_over_mac_control
import ixiangpf_commands.ptp_over_mac_stats
import ixiangpf_commands.test_control
import ixiangpf_commands.tlv_config
import ixiangpf_commands.topology_config
import ixiangpf_commands.traffic_handle_translator
import ixiangpf_commands.traffic_l47_config
import ixiangpf_commands.traffic_tag_config
import ixiangpf_commands.wizard_multivalue_config
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiangpf.py_part2 |
import ixiangpf_commands.emulation_ovsdb_control
import ixiangpf_commands.emulation_ovsdb_info
import ixiangpf_commands.emulation_pcc_config
import ixiangpf_commands.emulation_pcc_control
import ixiangpf_commands.emulation_pcc_info
import ixiangpf_commands.emulation_pce_config
import ixiangpf_commands.emulation_pce_control
import ixiangpf_commands.emulation_pce_info
import ixiangpf_commands.emulation_pim_config
import ixiangpf_commands.emulation_pim_control
import ixiangpf_commands.emulation_pim_group_config
import ixiangpf_commands.emulation_pim_info
import ixiangpf_commands.emulation_rsvpte_tunnel_control
import ixiangpf_commands.emulation_rsvp_config
import ixiangpf_commands.emulation_rsvp_control
import ixiangpf_commands.emulation_rsvp_info
import ixiangpf_commands.emulation_rsvp_tunnel_config
import ixiangpf_commands.emulation_static_macsec_config
import ixiangpf_commands.emulation_static_macsec_control
import ixiangpf_commands.emulation_static_macsec_info
import ixiangpf_commands.emulation_vxlan_config
import ixiangpf_commands.emulation_vxlan_control
import ixiangpf_commands.emulation_vxlan_stats
import ixiangpf_commands.get_execution_log
import ixiangpf_commands.interface_config
import ixiangpf_commands.internal_compress_overlays
import ixiangpf_commands.internal_legacy_control
import ixiangpf_commands.ixnetwork_traffic_control
import ixiangpf_commands.ixvm_config
import ixiangpf_commands.ixvm_control
import ixiangpf_commands.ixvm_info
import ixiangpf_commands.l2tp_config
import ixiangpf_commands.l2tp_control
import ixiangpf_commands.l2tp_stats
import ixiangpf_commands.legacy_commands
import ixiangpf_commands.multivalue_config
import ixiangpf_commands.multivalue_subset_config
import ixiangpf_commands.network_group_config
import ixiangpf_commands.pppox_config
import ixiangpf_commands.pppox_control
import ixiangpf_commands.pppox_stats
import ixiangpf_commands.protocol_info
import ixiangpf_commands.ptp_globals_config
import ixiangpf_commands.ptp_options_config
import ixiangpf_commands.ptp_over_ip_config
import ixiangpf_commands.ptp_over_ip_control
import ixiangpf_commands.ptp_over_ip_stats
import ixiangpf_commands.ptp_over_mac_config
import ixiangpf_commands.ptp_over_mac_control
import ixiangpf_commands.ptp_over_mac_stats
import ixiangpf_commands.test_control
import ixiangpf_commands.tlv_config
import ixiangpf_commands.topology_config
import ixiangpf_commands.traffic_handle_translator
import ixiangpf_commands.traffic_l47_config
import ixiangpf_commands.traffic_tag_config
import ixiangpf_commands.wizard_multivalue_config
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiangpf.py_part3 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
__version__ = '1.0'
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/__init__.py_part1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import getpass
import itertools
import platform
import re
import sys
import xml.etree.ElementTree as ElementTree
from datetime import datetime
from ixiaerror import IxiaError
class Logger(object):
CAT_INFO = 'info'
CAT_WARN = 'warn'
CAT_DEBUG = 'debug'
ENABLED = True
def __init__(self, prefix, print_timestamp=True):
self.prefix = prefix
self.print_timestamp = print_timestamp
def log(self, category, msg):
parts = []
if self.print_timestamp:
parts.append(datetime.now().strftime('%H:%M:%S.%f'))
parts.append(self.prefix)
parts.append(category)
parts.append(' ' + msg)
if self.ENABLED:
print(':'.join(parts))
def info(self, msg):
self.log(Logger.CAT_INFO, msg)
def warn(self, msg):
self.log(Logger.CAT_WARN, msg)
def debug(self, msg):
self.log(Logger.CAT_DEBUG, msg)
class _PartialMetaclass(type):
'''
Metaclass used for adding methods to existing classes.
This is needed because of name mangling of __prefixed variabled and methods.
'''
def __new__(cls, name, bases, dict):
if not bases:
return type.__new__(cls, name, bases, dict)
if len(bases) != 2:
raise TypeError("Partial classes need to have exactly 2 bases")
base = bases[1]
# add the new methods to the existing base class
for k, v in dict.items():
if k == '__module__':
continue
setattr(base, k, v)
return base
# compatibility for python2 and python3
def __metaclass(meta, *bases):
class metaclass(meta):
def __new__(cls, name, this_bases, d):
return meta(name, bases, d)
return type.__new__(metaclass, 'temporary_class', (), {})
class PartialClass(__metaclass(_PartialMetaclass)):
pass
def version_sorted(version_list):
''' sort a dotted-style version list '''
# split versions list and make each sublist item an int for sorting
split_versions = [[int(y) for y in x.split('.')] for x in version_list]
# sort by internal list integers and redo the string versions
return ['.'.join([str(y) for y in x]) for x in sorted(split_versions)]
def get_hostname():
'''
This method returns the hostname of the client machine or a predefined
string if the hostname cannot be determined
'''
hostname = platform.node()
if hostname:
return hostname
return "UNKNOWN MACHINE"
def get_username():
'''
This method returns the username of the client machine. A predified string
("UNKNOWN HLAPI USER") will be returned in case of failing to get the current username.
'''
username = "UNKNOWN HLAPI USER"
try:
username = getpass.getuser()
except(Exception, ):
return "UNKNOWN HLAPI USER"
return username
def extract_specified_args(arguments_to_extract, hlpy_args):
'''
This method accepts a list as input and a dict. The method iterates through the elements of the dict and searches
for the keys that have the same name. All the entries that are found are copied to a new dict which is returned.
'''
return {key: hlpy_args[key] for key in arguments_to_extract if key in hlpy_args}
def merge_dicts(*dicts):
'''
This method accepts a list of dictionaries as input and returns a new dictionary with all the items
(all elements from the input dictionaries will be merged into the same dictionary)
'''
return dict(itertools.chain(*[iter(d.items()) for d in dicts]))
def get_ixnetwork_server_and_port(hlpy_args):
'''
This method parses the input arguments and looks for a key called ixnetwork_tcl_server. If the key is found, the
value of the key is parsed in order to separate the hostname and port by ":" separator. The parsed information is
returned as a dict with hostname and port keys. If no port is given 8009 will be used as default. If no hostname
is given it will default to loopback address. Valid input formats for ixnetwork_tcl_server value:
127.0.0.1:8009, hostname:8009, hostname, 127.0.0.1,
2005::1, [2005::1]:8009,
2005:0:0:0:0:0:0:1, [2005:0:0:0:0:0:0:1]:8009,
2005:0000:0000:0000:0000:0000:0000:001, [2005:0001::0001:001]:8009
Not valid: 2005::1:8009 or 2005:0:0:0:0:0:0:1:8009
Returns hostname, port and an invalid sessionId -1
'''
default_hostname = '127.0.0.1'
default_port = '8009'
try:
ixnetwork_tcl_server = hlpy_args['ixnetwork_tcl_server']
list = ixnetwork_tcl_server.split(":")
if len(list) == 1:
return {'hostname': ixnetwork_tcl_server, 'port': default_port, 'sessionId': -1}
elif len(list) == 2:
# does not contain ipv6 address
return {'hostname':list[0], 'port': list[1],'sessionId': -1}
else:
# consider the hostname might be an ipv6 address in [ipv6]:port format (ex.: [2005::1]:8009)
# we don't want to validate that the ipv6 is correct, just to know if port is included or not
list = ixnetwork_tcl_server.split("]:")
m = re.match(r'\[(?P<hostname>.*)\]', ixnetwork_tcl_server)
if m:
hostname = m.group('hostname')
else:
hostname = list[0]
if len(list) == 1:
return {'hostname': hostname, 'port': default_port,'sessionId': -1}
else:
return {'hostname': hostname, 'port': list[1], 'sessionId': -1}
except (Exception, ):
return {'hostname': default_hostname, 'port': default_port, 'sessionId': -1}
from ixiahlt import IxiaHlt
def make_hltapi_fail(log):
return {'status': IxiaHlt.FAIL, 'log': log}
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiautil.py_part1 |
from ixiahlt import IxiaHlt
def make_hltapi_fail(log):
return {'status': IxiaHlt.FAIL, 'log': log}
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiautil.py_part2 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import sys
import os
try:
import Tkinter as tkinter
except ImportError:
import tkinter
from ixiautil import Logger
class IxiaTcl(object):
'''
Python wrapper class over Tkinter tcl interp
__init__ kwargs:
tcl_autopath=['list of items to append to the TCL interp ::auto_path']
Defaults:
on windows: []
on unix: []
Examples:
tcl_autopath=[
'/home/smurf/IXIA_LATEST/ixos/lib',
'/home/smurf/IXIA_LATEST/ixn/IxTclProtocol',
'/home/smurf/IXIA_LATEST/ixn/IxTclNetwork'
]
'''
def __init__(self, **kwargs):
self._debug_tcl_eval = False
self.__logger = Logger('ixiatcl', print_timestamp=False)
self.__init_tcl_interp(kwargs.get('tcl_autopath', []))
self.__build_tcl_commands()
tcl_version = self._eval('info patchlevel')
self.__logger.info('Tcl version: %s' % tcl_version)
self.__initialized = tcl_version
def __tcl_print(self, message, nonewline="0", out_stderr="0"):
if out_stderr == "1":
print(message, file=sys.stderr)
else:
if nonewline == "1":
print(message, end=' ')
else:
print(message)
def __init_tcl_environment(self) :
osType = sys.platform
pyVer = float(str(sys.version_info.major) + '.' + str(sys.version_info.minor))
if (osType == 'win32') :
if (pyVer >= 3.0) :
# only windows + python version 3.x combination should reach here
os.environ['TCL_LIBRARY'] = os.path.join(os.path.dirname(os.path.dirname(os.__file__)), 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(os.path.dirname(os.path.dirname(os.__file__)), 'tcl', 'tk8.6')
# end if
# end if
return
# end def
def __init_tcl_interp(self, tcl_autopath):
self.__init_tcl_environment()
self.__interp = tkinter.Tcl()
self.__interp.createcommand('__py_puts', self.__tcl_print)
self._eval("""
if { [catch { puts -nonewline {} }] } {
#stdout is close. Python's IDLE does not have stdout.
__py_puts "Redirecting Tcl's stdout to Python console output."
rename puts __tcl_puts
proc puts {args} {
set processed_args $args
set keep_current_line 0
set write_to_stderr 0
set args_size [llength $args]
#check if -nonewline is present
set no_new_line_index [lsearch -nocase $processed_args -nonewline]
if {$no_new_line_index > -1} {
lreplace $processed_args $no_new_line_index $no_new_line_index
set keep_current_line 1
incr args_size -1
}
#check if stederr is present
set stderr_index [lsearch -nocase $processed_args stderr]
if {$stderr_index > -1} {
lreplace $processed_args $stderr_index $stderr_index
set write_to_stderr 1
incr args_size -1
}
if { $args_size < 2} {
# a message for stdout or stderr. Sent to python's print method
__py_puts [lindex $processed_args [expr [llength $processed_args] - 1]] $keep_current_line $write_to_stderr
} else {
# probably a socket. use native tcl puts
set cmd "__tcl_puts $args"
eval $cmd
}
}
}
""")
for auto_path_item in tcl_autopath:
self._eval("lappend ::auto_path %s" % auto_path_item)
def tcl_error_info(self):
''' Return tcl interp ::errorInfo '''
return self.__interp.eval('set ::errorInfo')
def _eval(self, code):
''' Eval given code in tcl interp '''
if self._debug_tcl_eval:
self.__logger.debug('TCL: ' + code)
ret = self.__interp.eval(code)
if self._debug_tcl_eval:
self.__logger.debug('RET: ' + ret)
return ret
def _tcl_flatten(self, obj, key_prefix='', first_call=True):
'''
Flatten a python data structure involving dicts, lists and basic data types
to a tcl list. For the outermost dictionary do not return as a quoted tcl list
because the quoting is done at evaluation (first_call=True means dont quote)
'''
if isinstance(obj, list):
retlist = [self.quote_tcl_string(self._tcl_flatten(x, key_prefix, False)) for x in obj]
tcl_string = ' '.join(retlist)
elif isinstance(obj, dict):
retlist = []
for (k, v) in obj.items():
if not first_call:
vflat = self._tcl_flatten(v, '', False)
rettext = k + ' ' + self.quote_tcl_string(vflat)
retlist.append(self.quote_tcl_string(rettext))
else:
retlist.append(key_prefix + k)
vflat = self._tcl_flatten(v, '', False)
retlist.append(self.quote_tcl_string(vflat))
tcl_string = ' '.join(retlist)
elif isinstance(obj, str):
tcl_string = self.__quote_tcl_invalid(obj)
else:
tcl_string = str(obj)
return tcl_string
def __quote_tcl_invalid(self, tcl_string):
'''
For user input string quote any tcl list separators
in order to get good quoting using Tcl_merge. Otherwise, the
function will quote individual characters instead of the whole string.
'''
if not isinstance(tcl_string, str):
raise ValueError('input not a string')
invalid_chars = ['{', '}', '\\', '[', ']']
# state 0 - none
# state 1 - escaping
state = 0
ret = ''
count = 1
need_closing = 0
for c in tcl_string:
if state == 0:
if c == '\\':
state = 1
elif c in invalid_chars:
if c == '{' and count == 1:
a = tcl_string.rfind('}')
if a == len(tcl_string)-1:
ret += '{'
need_closing = 1
else:
ret += r'\{'
continue
elif c == '}' and count == len(tcl_string) and need_closing == 1:
ret += '}'
else:
ret += '\\'
elif state == 1:
state = 0
count += 1
ret += c
if state == 1:
ret += '\\'
return ret
def quote_tcl_string(self, tcl_string):
''' Returns a tcl string quoting any invalid tcl characters '''
# TODO - refactor this method when upgrading to Python3+
# strigify does not handle dollar signs: BUG1424852
tcl_final_string = tcl_string
tcl_final_string = tcl_final_string.replace(r"\{", "{")
tcl_final_string = tcl_final_string.replace(r"\}", "}")
tcl_final_string = tcl_final_string.replace(r"\ ", " ")
tcl_final_string = tcl_final_string.replace('\n', ' ').replace('\r', '')
if ((tcl_final_string.find(' ') >= 0) or
(tcl_final_string.find('$') >= 0) or
(tcl_final_string.find('\\') >= 0) or
(tcl_final_string == "")) :
return '{' + tcl_final_string + '}'
else :
return(tcl_final_string)
def convert_tcl_list(self, tcl_string):
''' Returns a python list representing the input tcl list '''
return list(self.__interp.splitlist(tcl_string))
def keylget(self, dict_input, key):
''' Python implementation of the tcl's keylget command. This can be used with python's dict '''
if not isinstance(dict_input, dict):
raise TypeError("Expected a dictionary and received a %s as input" % type(dict_input).__name__)
if not isinstance(key, str):
raise TypeError("Expected a string as a key filter and received %s as input" % type(key).__name__)
resulted_dict = dict_input
for k in key.split('.'):
try:
resulted_dict = resulted_dict[k]
except KeyError:
raise KeyError("Key %s is not found is the given dictionary" % key)
return resulted_dict
@staticmethod
def _make_tcl_method(tcl_funcname, conversion_in=None, conversion_out=None, eval_getter=None):
def __tcl_method(self, *args, **kwargs):
if conversion_in:
tcl_args = ' '.join(conversion_in(args, kwargs))
else:
tcl_args = ' '.join(args)
code = tcl_funcname + ' ' + tcl_args
if eval_getter:
eval_func = eval_getter(self)
else:
eval_func = self._eval
result = eval_func(code)
if conversion_out:
result = conversion_out(result)
return result
# strip namespace if any
__tcl_method.__name__ = tcl_funcname.split(':')[-1]
return __tcl_method
def __build_tcl_commands(self):
''' Adds the main tcl commands as methods to this class '''
command_list = [
"after", "append", "array",
"bgerror", "binary",
"cd", "clock", "close", "concat",
"encoding", "eof", "error", "expr",
"fblocked", "fconfigure", "fcopy", "file", "fileevent", "filename", "flush", "format",
"gets", "glob",
"incr", "info", "interp", "join", "lappend", "lindex", "linsert", "list", "llength", "load",
"lrange", "lreplace", "lsearch", "lset", "lsort",
"namespace",
"open",
"package", "parray", "pid", "proc", "puts", "pwd",
"read", "regexp", "registry", "regsub", "rename", "resource",
"scan", "seek", "set", "socket", "source", "split", "string", "subst", "switch",
"tell", "time", "trace",
"unknown", "unset", "update", "uplevel", "upvar",
"variable", "vwait"
]
def convert_in(args, kwargs):
return tuple([str(x) for x in args])
def convert_in_py(args, kwargs):
return tuple([self.quote_tcl_string(self._tcl_flatten(x)) for x in args])
def convert_out_py(tcl_string):
if tcl_string == '':
return None
ret = self.convert_tcl_list(tcl_string)
if len(ret) == 1:
return ret[0]
return ret
for command in command_list:
method = self._make_tcl_method(
command,
conversion_in=convert_in
)
method_py = self._make_tcl_method(
command,
conversion_in=convert_in_py,
conversion_out=convert_out_py
)
method.__doc__ = 'Lowlevel python wrapper over TCL command. The input parameters are TCL-style datatypes'
method_py.__doc__ = 'Lowlevel python wrapper over TCL command. The input parameters are python datatypes'
setattr(self.__class__, command, method)
setattr(self.__class__, command + '_py', method_py)
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiatcl.py_part1 |
for c in tcl_string:
if state == 0:
if c == '\\':
state = 1
elif c in invalid_chars:
if c == '{' and count == 1:
a = tcl_string.rfind('}')
if a == len(tcl_string)-1:
ret += '{'
need_closing = 1
else:
ret += r'\{'
continue
elif c == '}' and count == len(tcl_string) and need_closing == 1:
ret += '}'
else:
ret += '\\'
elif state == 1:
state = 0
count += 1
ret += c
if state == 1:
ret += '\\'
return ret
def quote_tcl_string(self, tcl_string):
''' Returns a tcl string quoting any invalid tcl characters '''
# TODO - refactor this method when upgrading to Python3+
# strigify does not handle dollar signs: BUG1424852
tcl_final_string = tcl_string
tcl_final_string = tcl_final_string.replace(r"\{", "{")
tcl_final_string = tcl_final_string.replace(r"\}", "}")
tcl_final_string = tcl_final_string.replace(r"\ ", " ")
tcl_final_string = tcl_final_string.replace('\n', ' ').replace('\r', '')
if ((tcl_final_string.find(' ') >= 0) or
(tcl_final_string.find('$') >= 0) or
(tcl_final_string.find('\\') >= 0) or
(tcl_final_string == "")) :
return '{' + tcl_final_string + '}'
else :
return(tcl_final_string)
def convert_tcl_list(self, tcl_string):
''' Returns a python list representing the input tcl list '''
return list(self.__interp.splitlist(tcl_string))
def keylget(self, dict_input, key):
''' Python implementation of the tcl's keylget command. This can be used with python's dict '''
if not isinstance(dict_input, dict):
raise TypeError("Expected a dictionary and received a %s as input" % type(dict_input).__name__)
if not isinstance(key, str):
raise TypeError("Expected a string as a key filter and received %s as input" % type(key).__name__)
resulted_dict = dict_input
for k in key.split('.'):
try:
resulted_dict = resulted_dict[k]
except KeyError:
raise KeyError("Key %s is not found is the given dictionary" % key)
return resulted_dict
@staticmethod
def _make_tcl_method(tcl_funcname, conversion_in=None, conversion_out=None, eval_getter=None):
def __tcl_method(self, *args, **kwargs):
if conversion_in:
tcl_args = ' '.join(conversion_in(args, kwargs))
else:
tcl_args = ' '.join(args)
code = tcl_funcname + ' ' + tcl_args
if eval_getter:
eval_func = eval_getter(self)
else:
eval_func = self._eval
result = eval_func(code)
if conversion_out:
result = conversion_out(result)
return result
# strip namespace if any
__tcl_method.__name__ = tcl_funcname.split(':')[-1]
return __tcl_method
def __build_tcl_commands(self):
''' Adds the main tcl commands as methods to this class '''
command_list = [
"after", "append", "array",
"bgerror", "binary",
"cd", "clock", "close", "concat",
"encoding", "eof", "error", "expr",
"fblocked", "fconfigure", "fcopy", "file", "fileevent", "filename", "flush", "format",
"gets", "glob",
"incr", "info", "interp", "join", "lappend", "lindex", "linsert", "list", "llength", "load",
"lrange", "lreplace", "lsearch", "lset", "lsort",
"namespace",
"open",
"package", "parray", "pid", "proc", "puts", "pwd",
"read", "regexp", "registry", "regsub", "rename", "resource",
"scan", "seek", "set", "socket", "source", "split", "string", "subst", "switch",
"tell", "time", "trace",
"unknown", "unset", "update", "uplevel", "upvar",
"variable", "vwait"
]
def convert_in(args, kwargs):
return tuple([str(x) for x in args])
def convert_in_py(args, kwargs):
return tuple([self.quote_tcl_string(self._tcl_flatten(x)) for x in args])
def convert_out_py(tcl_string):
if tcl_string == '':
return None
ret = self.convert_tcl_list(tcl_string)
if len(ret) == 1:
return ret[0]
return ret
for command in command_list:
method = self._make_tcl_method(
command,
conversion_in=convert_in
)
method_py = self._make_tcl_method(
command,
conversion_in=convert_in_py,
conversion_out=convert_out_py
)
method.__doc__ = 'Lowlevel python wrapper over TCL command. The input parameters are TCL-style datatypes'
method_py.__doc__ = 'Lowlevel python wrapper over TCL command. The input parameters are python datatypes'
setattr(self.__class__, command, method)
setattr(self.__class__, command + '_py', method_py)
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiatcl.py_part2 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import os
import os.path
import sys
from glob import glob
from ixiaerror import *
from ixiautil import *
try:
from Tkinter import TclError
except ImportError:
from tkinter import TclError
class IxiaHlt(object):
r'''
Python wrapper class over the HLTAPI commands
__init__ kwargs:
ixia_version='specific HLTSET to use'
The environment variable IXIA_VERSION has precedence.
hltapi_path_override='path to a specific HLTAPI installation to use'
tcl_packages_path='path to external TCL interp path from which to load additional packages'
Defaults:
ixia_version:
on windows: latest HLTAPI set taken from Ixia TCL package
on unix: latest HLTAPI set taken from Ixia TCL package
hltapi_path_override:
on windows: latest HLTAPI version installed in Ixia folder
on unix: none
tcl_packages_path:
on windows: path of packages from the latest TCL version installed in Ixia folder
on unix: none
Examples:
ixia_version='HLTSET165'
hltapi_path_override='C:\Program Files (x86)\Ixia\hltapi\4.90.0.16'
tcl_packages_path='C:\Program Files (x86)\Ixia\Tcl\8.5.12.0\lib\teapot\package\win32-ix86\lib'
'''
SUCCESS = '1'
FAIL = '0'
def __init__(self, ixiatcl, **kwargs):
# overrides
self.hltapi_path_override = kwargs.get('hltapi_path_override', None)
self.tcl_packages_path = kwargs.get('tcl_packages_path', None)
self.use_legacy_api = kwargs.get('use_legacy_api', None)
self.__logger = Logger('ixiahlt', print_timestamp=False)
self.ixiatcl = ixiatcl
self.tcl_mejor_version = self.__get_tcl_mejor_version()
self.__prepare_tcl_interp(self.ixiatcl)
# check whether ixia_version param is passed
# env variable takes precedence
ixia_version = kwargs.get('ixia_version', None)
if ixia_version:
if 'IXIA_VERSION' not in os.environ:
os.environ['IXIA_VERSION'] = ixia_version
else:
self.__logger.warn('IXIA_VERSION specified by env; ignoring parameter ixia_version')
if os.name == 'nt':
if os.getenv('IXIA_PY_DEV'):
self.__logger.debug('!! IXIA_PY_DEV enabled => Dev mode')
# dev access to hltapi version
hlt_init_glob = 'C:/Program Files*/Ixia/hltapi/4.90.0.16/TclScripts/bin/hlt_init.tcl'
hlt_init_files = glob(hlt_init_glob)
if not len(hlt_init_files):
raise IxiaError(IxiaError.HLTAPI_NOT_FOUND, additional_info='Tried glob %s' % hlt_init_glob)
hlt_init_path = hlt_init_files[0]
self.__logger.debug('!! using %s' % hlt_init_path)
else:
tcl_scripts_path = self.__get_hltapi_path()
# cut /lib/hltapi
for i in range(2):
tcl_scripts_path = os.path.dirname(tcl_scripts_path)
hlt_init_path = os.path.join(tcl_scripts_path, 'bin', 'hlt_init.tcl')
try:
# sourcing this might throw errors
self.ixiatcl.source(self.ixiatcl.quote_tcl_string(hlt_init_path))
except (TclError,):
raise IxiaError(IxiaError.HLTAPI_NOT_PREPARED, additional_info=ixiatcl.tcl_error_info())
else:
# path to ixia package, dependecies should be specified in tcl ::auto_path
self.ixiatcl.lappend('::auto_path', self.__get_hltapi_path())
try:
self.ixiatcl.package('require', 'Ixia')
except (TclError,):
raise IxiaError(IxiaError.HLTAPI_NOT_INITED, additional_info=ixiatcl.tcl_error_info())
try:
pythonIxNetworkLib = ixiatcl._eval("set env(IXTCLNETWORK_[ixNet getVersion])")
if os.name == 'nt':
#cut /TclScripts/lib/IxTclNetwork
for i in range(3):
pythonIxNetworkLib = os.path.dirname(pythonIxNetworkLib)
pythonIxNetworkLib = os.path.join(pythonIxNetworkLib, 'api', 'python')
else:
pythonIxNetworkLib = os.path.dirname(pythonIxNetworkLib)
pythonIxNetworkLib = os.path.join(pythonIxNetworkLib, 'PythonApi')
sys.path.append(pythonIxNetworkLib)
except (TclError,):
raise IxiaError(IxiaError.IXNETWORK_TCL_API_NOT_FOUND, additional_info=ixiatcl.tcl_error_info())
self.__build_hltapi_commands()
def __get_bitness(self):
machine = '32bit'
if os.name == 'nt' and sys.version_info[:2] < (2, 7):
machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', ''))
else:
import platform
machine = platform.machine()
mapping = {
'AMD64': '64bit',
'x86_64': '64bit',
'i386': '32bit',
'x86': '32bit'
}
return mapping[machine]
def __get_reg_subkeys(self, regkey):
try:
from _winreg import EnumKey
except ImportError:
from winreg import EnumKey
keys = []
try:
i = 0
while True:
matchObj = re.match(r'\d+\.\d+\.\d+\.\d+', EnumKey(regkey, i), re.M | re.I)
if matchObj:
keys.append(EnumKey(regkey, i))
i += 1
except (WindowsError,):
e = sys.exc_info()[1]
# 259 is no more subkeys
if e.winerror != 259:
raise e
return keys
def __get_tcl_mejor_version(self):
tkinter_tcl_version = [int(i) for i in self.ixiatcl._eval('info patchlevel').split('.')]
if (tkinter_tcl_version[0], tkinter_tcl_version[1]) <= (8,5):
return '8.5'
else:
return '8.6'
def __get_tcl_version(self, version_keys):
for version_key in version_keys:
if version_key.split('.')[:2] == self.tcl_mejor_version.split('.'):
return version_key
return version_key
def __get_reg_product_path(self, product, force_version=None):
try:
from _winreg import OpenKey, QueryValueEx
from _winreg import HKEY_LOCAL_MACHINE, KEY_READ
except ImportError:
from winreg import OpenKey, QueryValueEx
from winreg import HKEY_LOCAL_MACHINE, KEY_READ
wowtype = ''
if self.__get_bitness() == '64bit':
wowtype = 'Wow6432Node'
key_path = '\\'.join(['SOFTWARE', wowtype, 'Ixia Communications', product])
try:
with OpenKey(HKEY_LOCAL_MACHINE, key_path, KEY_READ) as key:
version_keys = version_sorted(self.__get_reg_subkeys(key))
if not len(version_keys):
return None
version_key = self.__get_tcl_version(version_keys)
if force_version:
if force_version in version_keys:
version_key = force_version
else:
return None
info_key_path = '\\'.join([key_path, version_key, 'InstallInfo'])
with OpenKey(HKEY_LOCAL_MACHINE, info_key_path, KEY_READ) as info_key:
return QueryValueEx(info_key, 'HOMEDIR')[0]
except (WindowsError,):
e = sys.exc_info()[1]
# WindowsError: [Error 2] The system cannot find the file specified
if e.winerror == 2:
raise IxiaError(IxiaError.WINREG_NOT_FOUND, 'Product name: %s' % product)
raise e
return None
def __get_tcl_packages_path(self):
if self.tcl_packages_path:
return self.tcl_packages_path
if os.name == 'nt':
tcl_path = self.__get_reg_product_path('Tcl')
if not tcl_path:
raise IxiaError(IxiaError.TCL_NOT_FOUND)
if self.tcl_mejor_version == '8.5':
return os.path.join(tcl_path, 'lib\\teapot\\package\\win32-ix86\\lib')
else:
return os.path.join(tcl_path, 'lib')
else:
# TODO
raise NotImplementedError()
def __get_hltapi_path(self):
if self.hltapi_path_override:
return self.hltapi_path_override
hltapi_path = os.path.realpath(__file__)
# cut /library/common/ixiangpf/python/ixiahlt.py
for i in range(5):
hltapi_path = os.path.dirname(hltapi_path)
return hltapi_path
def __prepare_tcl_interp(self, ixiatcl):
'''
Sets any TCL interp variables, commands or other items
specifically needed by HLTAPI
'''
if os.name == 'nt':
tcl_packages_path = self.__get_tcl_packages_path()
ixiatcl.lappend('::auto_path', self.ixiatcl.quote_tcl_string(tcl_packages_path))
# hltapi tries to use some wish console things; invalidate them -ae
ixiatcl.proc('console', 'args', '{}')
ixiatcl.proc('wm', 'args', '{}')
ixiatcl.set('::tcl_interactive', '0')
# this function generates unique variables names
# they are needed when parsing hlt return values -ae
ixiatcl.namespace('eval', '::tcl::tmp', '''{
variable global_counter 0
namespace export unique_name
}''')
ixiatcl.proc('tcl::tmp::unique_name', 'args', '''{
variable global_counter
set pattern "[namespace current]::unique%s"
set result {}
set num [llength $args]
set num [expr {($num)? $num : 1}]
for {set i 0} {$i < $num} {incr i} {
set name [format $pattern [incr global_counter]]
while {
[info exists $name] ||
[namespace exists $name] ||
[llength [info commands $name]]
} {
set name [format $pattern [incr global_counter]]
}
lappend result $name
}
if { [llength $args] } {
foreach varname $args name $result {
uplevel set $varname $name
}
}
return [lindex $result 0]
}''')
def __build_hltapi_commands(self):
''' Adds all supported HLTAPI commands as methods to this class '''
ixia_ns = '::ixia::'
# List of legacy commands
command_list = [
{'name': 'connect', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'cleanup_session', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'reboot_port_cpu', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_vport_to_porthandle', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_porthandle_to_vport', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_portname_to_vport', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'session_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'device_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'vport_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_control', 'namespace': ixia_ns, 'parse_io': True},
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiahlt.py_part1 |
raise e
return keys
def __get_tcl_mejor_version(self):
tkinter_tcl_version = [int(i) for i in self.ixiatcl._eval('info patchlevel').split('.')]
if (tkinter_tcl_version[0], tkinter_tcl_version[1]) <= (8,5):
return '8.5'
else:
return '8.6'
def __get_tcl_version(self, version_keys):
for version_key in version_keys:
if version_key.split('.')[:2] == self.tcl_mejor_version.split('.'):
return version_key
return version_key
def __get_reg_product_path(self, product, force_version=None):
try:
from _winreg import OpenKey, QueryValueEx
from _winreg import HKEY_LOCAL_MACHINE, KEY_READ
except ImportError:
from winreg import OpenKey, QueryValueEx
from winreg import HKEY_LOCAL_MACHINE, KEY_READ
wowtype = ''
if self.__get_bitness() == '64bit':
wowtype = 'Wow6432Node'
key_path = '\\'.join(['SOFTWARE', wowtype, 'Ixia Communications', product])
try:
with OpenKey(HKEY_LOCAL_MACHINE, key_path, KEY_READ) as key:
version_keys = version_sorted(self.__get_reg_subkeys(key))
if not len(version_keys):
return None
version_key = self.__get_tcl_version(version_keys)
if force_version:
if force_version in version_keys:
version_key = force_version
else:
return None
info_key_path = '\\'.join([key_path, version_key, 'InstallInfo'])
with OpenKey(HKEY_LOCAL_MACHINE, info_key_path, KEY_READ) as info_key:
return QueryValueEx(info_key, 'HOMEDIR')[0]
except (WindowsError,):
e = sys.exc_info()[1]
# WindowsError: [Error 2] The system cannot find the file specified
if e.winerror == 2:
raise IxiaError(IxiaError.WINREG_NOT_FOUND, 'Product name: %s' % product)
raise e
return None
def __get_tcl_packages_path(self):
if self.tcl_packages_path:
return self.tcl_packages_path
if os.name == 'nt':
tcl_path = self.__get_reg_product_path('Tcl')
if not tcl_path:
raise IxiaError(IxiaError.TCL_NOT_FOUND)
if self.tcl_mejor_version == '8.5':
return os.path.join(tcl_path, 'lib\\teapot\\package\\win32-ix86\\lib')
else:
return os.path.join(tcl_path, 'lib')
else:
# TODO
raise NotImplementedError()
def __get_hltapi_path(self):
if self.hltapi_path_override:
return self.hltapi_path_override
hltapi_path = os.path.realpath(__file__)
# cut /library/common/ixiangpf/python/ixiahlt.py
for i in range(5):
hltapi_path = os.path.dirname(hltapi_path)
return hltapi_path
def __prepare_tcl_interp(self, ixiatcl):
'''
Sets any TCL interp variables, commands or other items
specifically needed by HLTAPI
'''
if os.name == 'nt':
tcl_packages_path = self.__get_tcl_packages_path()
ixiatcl.lappend('::auto_path', self.ixiatcl.quote_tcl_string(tcl_packages_path))
# hltapi tries to use some wish console things; invalidate them -ae
ixiatcl.proc('console', 'args', '{}')
ixiatcl.proc('wm', 'args', '{}')
ixiatcl.set('::tcl_interactive', '0')
# this function generates unique variables names
# they are needed when parsing hlt return values -ae
ixiatcl.namespace('eval', '::tcl::tmp', '''{
variable global_counter 0
namespace export unique_name
}''')
ixiatcl.proc('tcl::tmp::unique_name', 'args', '''{
variable global_counter
set pattern "[namespace current]::unique%s"
set result {}
set num [llength $args]
set num [expr {($num)? $num : 1}]
for {set i 0} {$i < $num} {incr i} {
set name [format $pattern [incr global_counter]]
while {
[info exists $name] ||
[namespace exists $name] ||
[llength [info commands $name]]
} {
set name [format $pattern [incr global_counter]]
}
lappend result $name
}
if { [llength $args] } {
foreach varname $args name $result {
uplevel set $varname $name
}
}
return [lindex $result 0]
}''')
def __build_hltapi_commands(self):
''' Adds all supported HLTAPI commands as methods to this class '''
ixia_ns = '::ixia::'
# List of legacy commands
command_list = [
{'name': 'connect', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'cleanup_session', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'reboot_port_cpu', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_vport_to_porthandle', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_porthandle_to_vport', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_portname_to_vport', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'session_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'device_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'vport_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'get_nodrop_rate', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'find_in_csv', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'test_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'test_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_buffers', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_filter', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_triggers', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'uds_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'uds_filter_pallette_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'capture_packets', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'get_packet_content', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'increment_ipv4_address', 'namespace': ixia_ns, 'parse_io': False},
{'name': 'increment_ipv6_address', 'namespace': ixia_ns, 'parse_io': False},
{'name': 'generate_hex_values', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'enable_dpdk_performance_acceleration', 'namespace': ixia_ns, 'parse_io': True}
]
if self.use_legacy_api == 1:
# List of commands used by RobotFramework
command_list = [{'name': 'connect', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'cleanup_session', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'reboot_port_cpu', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'reset_port', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_vport_to_porthandle', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_porthandle_to_vport', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_portname_to_vport', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'session_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'device_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'vport_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'get_nodrop_rate', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'get_port_list_from_connect', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'find_in_csv', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'test_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'test_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_buffers', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_filter', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_triggers', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'uds_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'uds_filter_pallette_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'capture_packets', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'get_packet_content', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'increment_ipv4_address', 'namespace': ixia_ns, 'parse_io': False},
{'name': 'increment_ipv6_address', 'namespace': ixia_ns, 'parse_io': False},
{'name': 'dhcp_client_extension_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dhcp_extension_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dhcp_server_extension_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ancp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ancp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ancp_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ancp_subscriber_lines_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bfd_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bfd_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bfd_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bfd_session_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bgp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bgp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bgp_info', 'namespace': ixia_ns, 'parse_io': True},
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiahlt.py_part2 |
{'name': 'traffic_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'get_nodrop_rate', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'find_in_csv', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'test_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'test_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_buffers', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_filter', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_triggers', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'uds_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'uds_filter_pallette_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'capture_packets', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'get_packet_content', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'increment_ipv4_address', 'namespace': ixia_ns, 'parse_io': False},
{'name': 'increment_ipv6_address', 'namespace': ixia_ns, 'parse_io': False},
{'name': 'generate_hex_values', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'enable_dpdk_performance_acceleration', 'namespace': ixia_ns, 'parse_io': True}
]
if self.use_legacy_api == 1:
# List of commands used by RobotFramework
command_list = [{'name': 'connect', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'cleanup_session', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'reboot_port_cpu', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'reset_port', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_vport_to_porthandle', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_porthandle_to_vport', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'convert_portname_to_vport', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'session_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'device_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'vport_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'interface_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'traffic_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'get_nodrop_rate', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'get_port_list_from_connect', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'find_in_csv', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'test_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'test_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_buffers', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_filter', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_config_triggers', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'packet_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'uds_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'uds_filter_pallette_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'capture_packets', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'get_packet_content', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'increment_ipv4_address', 'namespace': ixia_ns, 'parse_io': False},
{'name': 'increment_ipv6_address', 'namespace': ixia_ns, 'parse_io': False},
{'name': 'dhcp_client_extension_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dhcp_extension_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dhcp_server_extension_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ancp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ancp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ancp_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ancp_subscriber_lines_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bfd_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bfd_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bfd_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bfd_session_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bgp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bgp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bgp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bgp_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_custom_tlv_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_links_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_md_meg_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_mip_mep_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_vlan_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_group_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_server_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_server_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_server_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_efm_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_efm_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_efm_org_var_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_efm_stat', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_eigrp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_eigrp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_eigrp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_eigrp_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_elmi_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_elmi_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_igmp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_igmp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_igmp_group_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_igmp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_igmp_querier_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_isis_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_isis_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_isis_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_isis_topology_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_lacp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_lacp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_lacp_link_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ldp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ldp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ldp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ldp_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mld_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mld_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mld_group_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mplstp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mplstp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mplstp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mplstp_lsp_pw_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_multicast_group_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_multicast_source_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_oam_config_msg', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_oam_config_topology', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_oam_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_oam_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ospf_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ospf_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ospf_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ospf_lsa_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ospf_topology_route_config', 'namespace': ixia_ns, 'parse_io': True},
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiahlt.py_part3 |
{'name': 'emulation_bgp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_bgp_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_custom_tlv_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_links_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_md_meg_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_mip_mep_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_cfm_vlan_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_group_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_server_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_server_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_server_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_dhcp_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_efm_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_efm_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_efm_org_var_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_efm_stat', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_eigrp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_eigrp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_eigrp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_eigrp_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_elmi_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_elmi_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_igmp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_igmp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_igmp_group_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_igmp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_igmp_querier_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_isis_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_isis_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_isis_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_isis_topology_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_lacp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_lacp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_lacp_link_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ldp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ldp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ldp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ldp_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mld_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mld_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mld_group_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mplstp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mplstp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mplstp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_mplstp_lsp_pw_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_multicast_group_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_multicast_source_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_oam_config_msg', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_oam_config_topology', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_oam_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_oam_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ospf_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ospf_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ospf_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ospf_lsa_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_ospf_topology_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pbb_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pbb_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pbb_custom_tlv_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pbb_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pbb_trunk_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pim_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pim_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pim_group_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pim_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rip_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rip_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rip_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rsvp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rsvp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rsvp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rsvp_tunnel_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rsvp_tunnel_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_bridge_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_lan_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_msti_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_vlan_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_control_range_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_server_range_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_test_range_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_client_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_client_global_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_client_options_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_client_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_fport_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_fport_global_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_fport_options_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_fport_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_fport_vnport_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'l2tp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'l2tp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'l2tp_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'l3vpn_generate_stream', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'pppox_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'pppox_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'pppox_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dcbxrange_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dcbxrange_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dcbxrange_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dcbxtlv_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dcbxtlvqaz_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'esmc_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'esmc_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'esmc_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ethernetrange_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_client_globals_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_client_options_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_control', 'namespace': ixia_ns, 'parse_io': True},
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiahlt.py_part4 |
{'name': 'emulation_ospf_topology_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pbb_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pbb_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pbb_custom_tlv_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pbb_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pbb_trunk_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pim_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pim_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pim_group_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_pim_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rip_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rip_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rip_route_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rsvp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rsvp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rsvp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rsvp_tunnel_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_rsvp_tunnel_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_bridge_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_lan_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_msti_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_stp_vlan_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_control_range_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_info', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_server_range_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'emulation_twamp_test_range_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_client_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_client_global_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_client_options_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_client_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_fport_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_fport_global_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_fport_options_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_fport_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fc_fport_vnport_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'l2tp_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'l2tp_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'l2tp_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'l3vpn_generate_stream', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'pppox_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'pppox_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'pppox_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dcbxrange_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dcbxrange_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dcbxrange_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dcbxtlv_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'dcbxtlvqaz_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'esmc_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'esmc_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'esmc_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ethernetrange_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_client_globals_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_client_options_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_globals_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_options_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_vnport_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_globals_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_options_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_ip_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_ip_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_ip_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_mac_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_mac_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_mac_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'generate_hex_values', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'enable_dpdk_performance_acceleration', 'namespace': ixia_ns, 'parse_io': True}
]
def convert_in_kwargs(args, kwargs):
return [self.ixiatcl._tcl_flatten(kwargs, '-')]
def convert_out_list(tcl_string):
if tcl_string == '':
return None
ret = self.ixiatcl.convert_tcl_list(tcl_string)
if len(ret) == 1:
return ret[0]
return ret
def convert_out_dict(tcl_string):
# populate a tcl keyed list variable
unique_list_name = self.ixiatcl._eval('::tcl::tmp::unique_name')
unique_catch_name = self.ixiatcl._eval('::tcl::tmp::unique_name')
self.ixiatcl.set(unique_list_name, self.ixiatcl.quote_tcl_string(tcl_string))
ret = {}
for key in self.ixiatcl.convert_tcl_list(self.ixiatcl._eval('keylkeys %s' % unique_list_name)):
qualified_key = self.ixiatcl.quote_tcl_string(key)
key_value = self.ixiatcl._eval('keylget %s %s' % (unique_list_name, qualified_key))
catch_result = self.ixiatcl._eval(
'catch {{keylkeys {0} {1}}} {2}'.format(
unique_list_name,
qualified_key,
unique_catch_name
)
)
if catch_result == '1' or self.ixiatcl.llength('$' + unique_catch_name) == '0':
# no more subkeys
ret[key] = key_value
else:
if '\\' in key_value and "{" not in key_value:
# Tcl BUG -> Whe value conains \ keylkeys will wronfully report that element is a keylist
# even when is not. A keylist always has a { and }, so if { is not present, but \ is assume
# the value is not a keylist
ret[key] = key_value
else:
ret[key] = convert_out_dict(key_value)
self.ixiatcl.unset(unique_list_name)
self.ixiatcl.unset(unique_catch_name)
# clear any stale errorInfo from the above catches
self.ixiatcl.set('::errorInfo', '{}')
return ret
for command in command_list:
# note: this may change in the future if alternate conversions are needed -ae
convert_in = None
convert_out = convert_out_list
if command['parse_io']:
convert_in = convert_in_kwargs
convert_out = convert_out_dict
method = self.ixiatcl._make_tcl_method(
command['namespace'] + command['name'],
conversion_in=convert_in,
conversion_out=convert_out,
eval_getter=lambda self_hlt: self_hlt.ixiatcl._eval
)
setattr(self.__class__, command['name'], method)
@property
def INTERACTIVE(self):
return self.__logger.ENABLED | KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiahlt.py_part5 |
{'name': 'fcoe_fwd_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_globals_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_options_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'fcoe_fwd_vnport_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_globals_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_options_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_ip_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_ip_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_ip_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_mac_config', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_mac_control', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'ptp_over_mac_stats', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'generate_hex_values', 'namespace': ixia_ns, 'parse_io': True},
{'name': 'enable_dpdk_performance_acceleration', 'namespace': ixia_ns, 'parse_io': True}
]
def convert_in_kwargs(args, kwargs):
return [self.ixiatcl._tcl_flatten(kwargs, '-')]
def convert_out_list(tcl_string):
if tcl_string == '':
return None
ret = self.ixiatcl.convert_tcl_list(tcl_string)
if len(ret) == 1:
return ret[0]
return ret
def convert_out_dict(tcl_string):
# populate a tcl keyed list variable
unique_list_name = self.ixiatcl._eval('::tcl::tmp::unique_name')
unique_catch_name = self.ixiatcl._eval('::tcl::tmp::unique_name')
self.ixiatcl.set(unique_list_name, self.ixiatcl.quote_tcl_string(tcl_string))
ret = {}
for key in self.ixiatcl.convert_tcl_list(self.ixiatcl._eval('keylkeys %s' % unique_list_name)):
qualified_key = self.ixiatcl.quote_tcl_string(key)
key_value = self.ixiatcl._eval('keylget %s %s' % (unique_list_name, qualified_key))
catch_result = self.ixiatcl._eval(
'catch {{keylkeys {0} {1}}} {2}'.format(
unique_list_name,
qualified_key,
unique_catch_name
)
)
if catch_result == '1' or self.ixiatcl.llength('$' + unique_catch_name) == '0':
# no more subkeys
ret[key] = key_value
else:
if '\\' in key_value and "{" not in key_value:
# Tcl BUG -> Whe value conains \ keylkeys will wronfully report that element is a keylist
# even when is not. A keylist always has a { and }, so if { is not present, but \ is assume
# the value is not a keylist
ret[key] = key_value
else:
ret[key] = convert_out_dict(key_value)
self.ixiatcl.unset(unique_list_name)
self.ixiatcl.unset(unique_catch_name)
# clear any stale errorInfo from the above catches
self.ixiatcl.set('::errorInfo', '{}')
return ret
for command in command_list:
# note: this may change in the future if alternate conversions are needed -ae
convert_in = None
convert_out = convert_out_list
if command['parse_io']:
convert_in = convert_in_kwargs
convert_out = convert_out_dict
method = self.ixiatcl._make_tcl_method(
command['namespace'] + command['name'],
conversion_in=convert_in,
conversion_out=convert_out,
eval_getter=lambda self_hlt: self_hlt.ixiatcl._eval
)
setattr(self.__class__, command['name'], method)
@property
def INTERACTIVE(self):
return self.__logger.ENABLED | KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiahlt.py_part6 |
# -*- coding: utf-8 -*-
import sys
from ixiaerror import IxiaError
from ixiangpf import IxiaNgpf
from ixiautil import PartialClass, make_hltapi_fail
class IxiaNgpf(PartialClass, IxiaNgpf):
def emulation_ldp_config(self, **kwargs):
r'''
#Procedure Header
Name:
emulation_ldp_config
Description:
This procedure configures LDP simulated routers and the router interfaces.
Synopsis:
emulation_ldp_config
[-handle ANY]
[-mode CHOICES create
CHOICES delete
CHOICES disable
CHOICES enable
CHOICES modify]
n [-port_handle ANY]
[-label_adv CHOICES unsolicited on_demand
DEFAULT unsolicited]
n [-peer_discovery ANY]
[-count NUMERIC
DEFAULT 1]
n [-interface_handle ANY]
n [-interface_mode ANY]
[-intf_ip_addr IPV4
DEFAULT 0.0.0.0]
[-intf_prefix_length RANGE 1-32
DEFAULT 24]
[-intf_ip_addr_step IPV4
DEFAULT 0.0.1.0]
x [-loopback_ip_addr IPV4]
x [-loopback_ip_addr_step IPV4
x DEFAULT 0.0.1.0]
[-intf_ipv6_addr IPV6
DEFAULT 0:0:0:1::0]
[-intf_ipv6_prefix_length RANGE 1-64
DEFAULT 64]
[-intf_ipv6_addr_step IPV6
DEFAULT 0:0:0:1::0]
x [-loopback_ipv6_addr IPV6]
x [-loopback_ipv6_addr_step IPV6
x DEFAULT 0:0:0:1::0]
x [-lsr_id IPV4]
x [-lsr_id_step IPV4
x DEFAULT 0.0.1.0]
[-label_space RANGE 0-65535]
[-mac_address_init MAC]
x [-mac_address_step MAC
x DEFAULT 0000.0000.0001]
[-remote_ip_addr IPV4]
[-remote_ip_addr_target IPV6]
[-remote_ip_addr_step IPV4]
[-remote_ip_addr_step_target IPV6]
[-hello_interval RANGE 0-65535]
[-hello_hold_time RANGE 0-65535]
[-keepalive_interval RANGE 0-65535]
[-keepalive_holdtime RANGE 0-65535]
[-discard_self_adv_fecs CHOICES 0 1]
x [-vlan CHOICES 0 1
x DEFAULT 0]
[-vlan_id RANGE 0-4095]
[-vlan_id_mode CHOICES fixed increment
DEFAULT increment]
[-vlan_id_step RANGE 0-4096
DEFAULT 1]
[-vlan_user_priority RANGE 0-7
DEFAULT 0]
n [-vpi ANY]
n [-vci ANY]
n [-vpi_step ANY]
n [-vci_step ANY]
n [-atm_encapsulation ANY]
x [-auth_mode CHOICES null md5
x DEFAULT null]
x [-auth_key ANY]
x [-bfd_registration CHOICES 0 1
x DEFAULT 0]
x [-bfd_registration_mode CHOICES single_hop multi_hop
x DEFAULT multi_hop]
n [-atm_range_max_vpi ANY]
n [-atm_range_min_vpi ANY]
n [-atm_range_max_vci ANY]
n [-atm_range_min_vci ANY]
n [-atm_vc_dir ANY]
n [-enable_explicit_include_ip_fec ANY]
n [-enable_l2vpn_vc_fecs ANY]
n [-enable_remote_connect ANY]
n [-enable_vc_group_matching ANY]
x [-gateway_ip_addr IPV4]
x [-gateway_ip_addr_step IPV4
x DEFAULT 0.0.1.0]
x [-gateway_ipv6_addr IPV6]
x [-gateway_ipv6_addr_step IPV6
x DEFAULT 0:0:0:1::0]
x [-graceful_restart_enable CHOICES 0 1]
n [-no_write ANY]
x [-reconnect_time RANGE 0-300000]
x [-recovery_time RANGE 0-300000]
x [-reset FLAG]
x [-targeted_hello_hold_time RANGE 0-65535]
x [-targeted_hello_interval RANGE 0-65535]
n [-override_existence_check ANY]
n [-override_tracking ANY]
n [-cfi ANY]
n [-config_seq_no ANY]
n [-egress_label_mode ANY]
n [-label_start ANY]
n [-label_step ANY]
n [-label_type ANY]
n [-loop_detection ANY]
n [-max_lsps ANY]
n [-max_pdu_length ANY]
n [-message_aggregation ANY]
n [-mtu ANY]
n [-path_vector_limit ANY]
n [-timeout ANY]
n [-transport_ip_addr ANY]
n [-user_priofity ANY]
n [-vlan_cfi ANY]
x [-peer_count NUMERIC]
x [-interface_name ALPHA]
x [-interface_multiplier NUMERIC]
x [-interface_active CHOICES 0 1]
x [-target_name ALPHA]
x [-target_multiplier NUMERIC]
x [-target_auth_key ANY]
x [-initiate_targeted_hello CHOICES 0 1]
x [-target_auth_mode CHOICES null md5]
x [-target_active CHOICES 0 1]
x [-router_name ALPHA]
x [-router_multiplier NUMERIC]
x [-router_active CHOICES 0 1]
x [-targeted_peer_name ALPHA]
x [-start_rate_scale_mode CHOICES port device_group
x DEFAULT port]
x [-start_rate_enabled CHOICES 0 1]
x [-start_rate NUMERIC]
x [-start_rate_interval NUMERIC]
x [-stop_rate_scale_mode CHOICES port device_group
x DEFAULT port]
x [-stop_rate_enabled CHOICES 0 1]
x [-stop_rate NUMERIC]
x [-stop_rate_interval NUMERIC]
x [-lpb_interface_name ALPHA]
x [-lpb_interface_active CHOICES 0 1]
x [-root_ranges_count_v4 NUMERIC]
x [-leaf_ranges_count_v4 NUMERIC]
x [-root_ranges_count_v6 NUMERIC]
x [-leaf_ranges_count_v6 NUMERIC]
x [-ipv6_peer_count NUMERIC]
x [-ldp_version CHOICES version1 version2]
x [-session_preference CHOICES any ipv4 ipv6]
x [-include_sac ANY]
x [-enable_ipv4_fec ANY]
x [-enable_ipv6_fec ANY]
x [-enable_fec128 ANY]
x [-enable_fec129 ANY]
x [-ignore_received_sac ANY]
x [-enable_p2mp_capability ANY]
x [-enable_bfd_mpls_learned_lsp ANY]
x [-enable_lsp_ping_learned_lsp ANY]
x [-lsp_type CHOICES p2MP]
x [-root_address ANY]
x [-root_address_count ANY]
x [-root_address_step ANY]
x [-lsp_count_per_root ANY]
x [-label_value_start ANY]
x [-label_value_step ANY]
x [-continuous_increment_opaque_value_across_root ANY]
x [-number_of_tlvs NUMERIC]
x [-group_address_v4 ANY]
x [-group_address_v6 ANY]
x [-group_count_per_lsp ANY]
x [-group_count_per_lsp_root ANY]
x [-source_address_v4 ANY]
x [-source_address_v6 ANY]
x [-source_count_per_lsp ANY]
x [-filter_on_group_address ANY]
x [-start_group_address_v4 ANY]
x [-start_group_address_v6 ANY]
x [-active_leafrange ANY]
x [-name ALPHA]
x [-active ANY]
x [-type ANY]
x [-tlv_length ANY]
x [-value ANY]
x [-increment ANY]
Arguments:
-handle
An LDP handle returned from this procedure and now being used when
the -mode is anything but create.
When -handle is provided with the /globals value the arguments that configure global protocol
setting accept both multivalue handles and simple values.
When -handle is provided with a a protocol stack handle or a protocol session handle, the arguments
that configure global settings will only accept simple values. In this situation, these arguments will
configure only the settings of the parent device group or the ports associated with the parent topology.
-mode
The mode that is being performed. All but create require the use of
the -handle option.
n -port_handle
n This argument defined by Cisco is not supported for NGPF implementation.
-label_adv
The mode by which the simulated router advertises its FEC ranges.
n -peer_discovery
n This argument defined by Cisco is not supported for NGPF implementation.
-count
Defines the number of LDP interfaces to create.
n -interface_handle
n This argument defined by Cisco is not supported for NGPF implementation.
n -interface_mode
n This argument defined by Cisco is not supported for NGPF implementation.
-intf_ip_addr
Interface IP address of the LDP session router. Mandatory when -mode is create.
When using IxTclNetwork (new API) this parameter can be omitted if -interface_handle is used.
For IxTclProtocol (old API), when -mode is modify and one of the layer
2-3 parameters (-intf_ip_addr, -gateway_ip_addr, -loopback_ip_addr, etc)
needs to be modified, the emulation_ldp_config command must be provided
with the entire list of layer 2-3 parameters. Otherwise they will be
set to their default values.
-intf_prefix_length
Prefix length on the interface.
-intf_ip_addr_step
Define interface IP address for multiple sessions.
Valid only for -mode create.
x -loopback_ip_addr
x The IP address of the unconnected protocol interface that will be
x created behind the intf_ip_addr interface. The loopback(unconnected)
x interface is the one that will be used for LDP emulation. This type
x of interface is needed when creating extended Martini sessions.
x -loopback_ip_addr_step
x Valid only for -mode create.
x The incrementing step for the loopback_ip_addr parameter.
-intf_ipv6_addr
Interface IP address of the LDP session router. Mandatory when -mode is create.
When using IxTclNetwork (new API) this parameter can be omitted if -interface_handle is used.
For IxTclProtocol (old API), when -mode is modify and one of the layer
2-3 parameters (-intf_ip_addr, -gateway_ip_addr, -loopback_ip_addr, etc)
needs to be modified, the emulation_ldp_config command must be provided
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiangpf_commands/emulation_ldp_config.py_part1 |
x [-target_name ALPHA]
x [-target_multiplier NUMERIC]
x [-target_auth_key ANY]
x [-initiate_targeted_hello CHOICES 0 1]
x [-target_auth_mode CHOICES null md5]
x [-target_active CHOICES 0 1]
x [-router_name ALPHA]
x [-router_multiplier NUMERIC]
x [-router_active CHOICES 0 1]
x [-targeted_peer_name ALPHA]
x [-start_rate_scale_mode CHOICES port device_group
x DEFAULT port]
x [-start_rate_enabled CHOICES 0 1]
x [-start_rate NUMERIC]
x [-start_rate_interval NUMERIC]
x [-stop_rate_scale_mode CHOICES port device_group
x DEFAULT port]
x [-stop_rate_enabled CHOICES 0 1]
x [-stop_rate NUMERIC]
x [-stop_rate_interval NUMERIC]
x [-lpb_interface_name ALPHA]
x [-lpb_interface_active CHOICES 0 1]
x [-root_ranges_count_v4 NUMERIC]
x [-leaf_ranges_count_v4 NUMERIC]
x [-root_ranges_count_v6 NUMERIC]
x [-leaf_ranges_count_v6 NUMERIC]
x [-ipv6_peer_count NUMERIC]
x [-ldp_version CHOICES version1 version2]
x [-session_preference CHOICES any ipv4 ipv6]
x [-include_sac ANY]
x [-enable_ipv4_fec ANY]
x [-enable_ipv6_fec ANY]
x [-enable_fec128 ANY]
x [-enable_fec129 ANY]
x [-ignore_received_sac ANY]
x [-enable_p2mp_capability ANY]
x [-enable_bfd_mpls_learned_lsp ANY]
x [-enable_lsp_ping_learned_lsp ANY]
x [-lsp_type CHOICES p2MP]
x [-root_address ANY]
x [-root_address_count ANY]
x [-root_address_step ANY]
x [-lsp_count_per_root ANY]
x [-label_value_start ANY]
x [-label_value_step ANY]
x [-continuous_increment_opaque_value_across_root ANY]
x [-number_of_tlvs NUMERIC]
x [-group_address_v4 ANY]
x [-group_address_v6 ANY]
x [-group_count_per_lsp ANY]
x [-group_count_per_lsp_root ANY]
x [-source_address_v4 ANY]
x [-source_address_v6 ANY]
x [-source_count_per_lsp ANY]
x [-filter_on_group_address ANY]
x [-start_group_address_v4 ANY]
x [-start_group_address_v6 ANY]
x [-active_leafrange ANY]
x [-name ALPHA]
x [-active ANY]
x [-type ANY]
x [-tlv_length ANY]
x [-value ANY]
x [-increment ANY]
Arguments:
-handle
An LDP handle returned from this procedure and now being used when
the -mode is anything but create.
When -handle is provided with the /globals value the arguments that configure global protocol
setting accept both multivalue handles and simple values.
When -handle is provided with a a protocol stack handle or a protocol session handle, the arguments
that configure global settings will only accept simple values. In this situation, these arguments will
configure only the settings of the parent device group or the ports associated with the parent topology.
-mode
The mode that is being performed. All but create require the use of
the -handle option.
n -port_handle
n This argument defined by Cisco is not supported for NGPF implementation.
-label_adv
The mode by which the simulated router advertises its FEC ranges.
n -peer_discovery
n This argument defined by Cisco is not supported for NGPF implementation.
-count
Defines the number of LDP interfaces to create.
n -interface_handle
n This argument defined by Cisco is not supported for NGPF implementation.
n -interface_mode
n This argument defined by Cisco is not supported for NGPF implementation.
-intf_ip_addr
Interface IP address of the LDP session router. Mandatory when -mode is create.
When using IxTclNetwork (new API) this parameter can be omitted if -interface_handle is used.
For IxTclProtocol (old API), when -mode is modify and one of the layer
2-3 parameters (-intf_ip_addr, -gateway_ip_addr, -loopback_ip_addr, etc)
needs to be modified, the emulation_ldp_config command must be provided
with the entire list of layer 2-3 parameters. Otherwise they will be
set to their default values.
-intf_prefix_length
Prefix length on the interface.
-intf_ip_addr_step
Define interface IP address for multiple sessions.
Valid only for -mode create.
x -loopback_ip_addr
x The IP address of the unconnected protocol interface that will be
x created behind the intf_ip_addr interface. The loopback(unconnected)
x interface is the one that will be used for LDP emulation. This type
x of interface is needed when creating extended Martini sessions.
x -loopback_ip_addr_step
x Valid only for -mode create.
x The incrementing step for the loopback_ip_addr parameter.
-intf_ipv6_addr
Interface IP address of the LDP session router. Mandatory when -mode is create.
When using IxTclNetwork (new API) this parameter can be omitted if -interface_handle is used.
For IxTclProtocol (old API), when -mode is modify and one of the layer
2-3 parameters (-intf_ip_addr, -gateway_ip_addr, -loopback_ip_addr, etc)
needs to be modified, the emulation_ldp_config command must be provided
with the entire list of layer 2-3 parameters. Otherwise they will be
set to their default values.
-intf_ipv6_prefix_length
Prefix length on the interface.
-intf_ipv6_addr_step
Define interface IP address for multiple sessions.
Valid only for -mode create.
x -loopback_ipv6_addr
x The IP address of the unconnected protocol interface that will be
x created behind the intf_ip_addr interface. The loopback(unconnected)
x interface is the one that will be used for LDP emulation. This type
x of interface is needed when creating extended Martini sessions.
x -loopback_ipv6_addr_step
x Valid only for -mode create.
x The incrementing step for the loopback_ip_addr parameter.
x -lsr_id
x The ID of the router to be emulated.
x -lsr_id_step
x Used to define the lsr_id step for multiple interface creations.
x Valid only for -mode create.
-label_space
The label space identifier for the interface.
-mac_address_init
MAC address to be used for the first session.
x -mac_address_step
x Valid only for -mode create.
x The incrementing step for the MAC address configured on the directly
x connected interfaces. Valid only when IxNetwork Tcl API is used.
-remote_ip_addr
The IPv4 address of a targeted peer.
-remote_ip_addr_target
The IPv6 address of a targeted peer.
-remote_ip_addr_step
When creating multiple sessions and using the -remote_ip_addr, tells
how to increment between sessions.
Valid only for -mode create.
-remote_ip_addr_step_target
When creating multiple sessions and using the -remote_ip_addr, tells
how to increment between sessions.
Valid only for -mode create.
-hello_interval
The amount of time, expressed in seconds, between transmitted
HELLO messages.
-hello_hold_time
The amount of time, expressed in seconds, that an LDP adjacency
will be maintained in the absence of a HELLO message.
-keepalive_interval
The amount of time, expressed in seconds, between keep-alive messages
sent from simulated routers to their adjacency in the absence of
other PDUs sent to the adjacency.
-keepalive_holdtime
The amount of time, expressed in seconds, that an LDP adjacency
will be maintained in the absence of a PDU received from the adjacency.
-discard_self_adv_fecs
Discard learned labels from the DUT that match any of the enabled
configured IPv4 FEC ranges.This flag is only set when LDP is
started.If it is to be changed later, LDP should be stopped,
the value changed and then restart LDP.
x -vlan
x Enables vlan on the directly connected LDP router interface.
x Valid options are: 0 - disable, 1 - enable.
x This option is valid only when -mode is create or -mode is modify
x and -handle is a LDP router handle.
x This option is available only when IxNetwork tcl API is used.
-vlan_id
VLAN ID for protocol interface.
-vlan_id_mode
For multiple neighbor configuration, configures the VLAN ID mode.
-vlan_id_step
Valid only for -mode create.
Defines the step for the VLAN ID when the VLAN ID mode is increment.
When vlan_id_step causes the vlan_id value to exceed its maximum value the
increment will be done modulo <number of possible vlan ids>.
Examples: vlan_id = 4094; vlan_id_step = 2-> new vlan_id value = 0
vlan_id = 4095; vlan_id_step = 11 -> new vlan_id value = 10
-vlan_user_priority
VLAN user priority assigned to protocol interface.
n -vpi
n This argument defined by Cisco is not supported for NGPF implementation.
n -vci
n This argument defined by Cisco is not supported for NGPF implementation.
n -vpi_step
n This argument defined by Cisco is not supported for NGPF implementation.
n -vci_step
n This argument defined by Cisco is not supported for NGPF implementation.
n -atm_encapsulation
n This argument defined by Cisco is not supported for NGPF implementation.
x -auth_mode
x Select the type of cryptographic authentication to be used for this targeted peer.
x -auth_key
x Active only when "md5" is selected in the Authentication Type field.
x (String) Enter a value to be used as a "secret" MD5 key for authentication.
x The maximum length allowed is 255 characters.
x One MD5 key can be configured per interface.
x -bfd_registration
x Enable or disable BFD registration.
x -bfd_registration_mode
x Set BFD registration mode to single hop or multi hop.
n -atm_range_max_vpi
n This argument defined by Cisco is not supported for NGPF implementation.
n -atm_range_min_vpi
n This argument defined by Cisco is not supported for NGPF implementation.
n -atm_range_max_vci
n This argument defined by Cisco is not supported for NGPF implementation.
n -atm_range_min_vci
n This argument defined by Cisco is not supported for NGPF implementation.
n -atm_vc_dir
n This argument defined by Cisco is not supported for NGPF implementation.
n -enable_explicit_include_ip_fec
n This argument defined by Cisco is not supported for NGPF implementation.
n -enable_l2vpn_vc_fecs
n This argument defined by Cisco is not supported for NGPF implementation.
n -enable_remote_connect
n This argument defined by Cisco is not supported for NGPF implementation.
n -enable_vc_group_matching
n This argument defined by Cisco is not supported for NGPF implementation.
x -gateway_ip_addr
x Gives the gateway IP address for the protocol interface that will
x be created for use by the simulated routers.
x -gateway_ip_addr_step
x Valid only for -mode create.
x Gives the step for the gateway IP address.
x -gateway_ipv6_addr
x Gives the gateway IP address for the protocol interface that will
x be created for use by the simulated routers.
x -gateway_ipv6_addr_step
x Valid only for -mode create.
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiangpf_commands/emulation_ldp_config.py_part2 |
with the entire list of layer 2-3 parameters. Otherwise they will be
set to their default values.
-intf_ipv6_prefix_length
Prefix length on the interface.
-intf_ipv6_addr_step
Define interface IP address for multiple sessions.
Valid only for -mode create.
x -loopback_ipv6_addr
x The IP address of the unconnected protocol interface that will be
x created behind the intf_ip_addr interface. The loopback(unconnected)
x interface is the one that will be used for LDP emulation. This type
x of interface is needed when creating extended Martini sessions.
x -loopback_ipv6_addr_step
x Valid only for -mode create.
x The incrementing step for the loopback_ip_addr parameter.
x -lsr_id
x The ID of the router to be emulated.
x -lsr_id_step
x Used to define the lsr_id step for multiple interface creations.
x Valid only for -mode create.
-label_space
The label space identifier for the interface.
-mac_address_init
MAC address to be used for the first session.
x -mac_address_step
x Valid only for -mode create.
x The incrementing step for the MAC address configured on the directly
x connected interfaces. Valid only when IxNetwork Tcl API is used.
-remote_ip_addr
The IPv4 address of a targeted peer.
-remote_ip_addr_target
The IPv6 address of a targeted peer.
-remote_ip_addr_step
When creating multiple sessions and using the -remote_ip_addr, tells
how to increment between sessions.
Valid only for -mode create.
-remote_ip_addr_step_target
When creating multiple sessions and using the -remote_ip_addr, tells
how to increment between sessions.
Valid only for -mode create.
-hello_interval
The amount of time, expressed in seconds, between transmitted
HELLO messages.
-hello_hold_time
The amount of time, expressed in seconds, that an LDP adjacency
will be maintained in the absence of a HELLO message.
-keepalive_interval
The amount of time, expressed in seconds, between keep-alive messages
sent from simulated routers to their adjacency in the absence of
other PDUs sent to the adjacency.
-keepalive_holdtime
The amount of time, expressed in seconds, that an LDP adjacency
will be maintained in the absence of a PDU received from the adjacency.
-discard_self_adv_fecs
Discard learned labels from the DUT that match any of the enabled
configured IPv4 FEC ranges.This flag is only set when LDP is
started.If it is to be changed later, LDP should be stopped,
the value changed and then restart LDP.
x -vlan
x Enables vlan on the directly connected LDP router interface.
x Valid options are: 0 - disable, 1 - enable.
x This option is valid only when -mode is create or -mode is modify
x and -handle is a LDP router handle.
x This option is available only when IxNetwork tcl API is used.
-vlan_id
VLAN ID for protocol interface.
-vlan_id_mode
For multiple neighbor configuration, configures the VLAN ID mode.
-vlan_id_step
Valid only for -mode create.
Defines the step for the VLAN ID when the VLAN ID mode is increment.
When vlan_id_step causes the vlan_id value to exceed its maximum value the
increment will be done modulo <number of possible vlan ids>.
Examples: vlan_id = 4094; vlan_id_step = 2-> new vlan_id value = 0
vlan_id = 4095; vlan_id_step = 11 -> new vlan_id value = 10
-vlan_user_priority
VLAN user priority assigned to protocol interface.
n -vpi
n This argument defined by Cisco is not supported for NGPF implementation.
n -vci
n This argument defined by Cisco is not supported for NGPF implementation.
n -vpi_step
n This argument defined by Cisco is not supported for NGPF implementation.
n -vci_step
n This argument defined by Cisco is not supported for NGPF implementation.
n -atm_encapsulation
n This argument defined by Cisco is not supported for NGPF implementation.
x -auth_mode
x Select the type of cryptographic authentication to be used for this targeted peer.
x -auth_key
x Active only when "md5" is selected in the Authentication Type field.
x (String) Enter a value to be used as a "secret" MD5 key for authentication.
x The maximum length allowed is 255 characters.
x One MD5 key can be configured per interface.
x -bfd_registration
x Enable or disable BFD registration.
x -bfd_registration_mode
x Set BFD registration mode to single hop or multi hop.
n -atm_range_max_vpi
n This argument defined by Cisco is not supported for NGPF implementation.
n -atm_range_min_vpi
n This argument defined by Cisco is not supported for NGPF implementation.
n -atm_range_max_vci
n This argument defined by Cisco is not supported for NGPF implementation.
n -atm_range_min_vci
n This argument defined by Cisco is not supported for NGPF implementation.
n -atm_vc_dir
n This argument defined by Cisco is not supported for NGPF implementation.
n -enable_explicit_include_ip_fec
n This argument defined by Cisco is not supported for NGPF implementation.
n -enable_l2vpn_vc_fecs
n This argument defined by Cisco is not supported for NGPF implementation.
n -enable_remote_connect
n This argument defined by Cisco is not supported for NGPF implementation.
n -enable_vc_group_matching
n This argument defined by Cisco is not supported for NGPF implementation.
x -gateway_ip_addr
x Gives the gateway IP address for the protocol interface that will
x be created for use by the simulated routers.
x -gateway_ip_addr_step
x Valid only for -mode create.
x Gives the step for the gateway IP address.
x -gateway_ipv6_addr
x Gives the gateway IP address for the protocol interface that will
x be created for use by the simulated routers.
x -gateway_ipv6_addr_step
x Valid only for -mode create.
x Gives the step for the gateway IP address.
x -graceful_restart_enable
x Will enable graceful restart (HA) on the LDP neighbor.
n -no_write
n This argument defined by Cisco is not supported for NGPF implementation.
x -reconnect_time
x (in milliseconds) This Fault Tolerant (FT) Reconnect Timer value is
x advertised in the FT Session TLV in the Initialization message sent by
x a neighbor LSR. It is a request sent by an LSR to its neighbor(s) - in
x the event that the receiving neighbor detects that the LDP session has
x failed, the receiver should maintain MPLS forwarding state and wait
x for the sender to perform a restart of the control plane and LDP
x protocol. If the value = 0, the sender is indicating that it will not
x preserve its MPLS forwarding state across the restart.
x If -graceful_restart_enable is set.
x -recovery_time
x If -graceful_restart_enable is set; (in milliseconds)
x The restarting LSR is advertising the amount of time that it will
x retain its MPLS forwarding state. This time period begins when it
x sends the restart Initialization message, with the FT session TLV,
x to the neighbor LSRs (to re-establish the LDP session). This timer
x allows the neighbors some time to resync the LSPs in an orderly
x manner. If the value = 0, it means that the restarting LSR was not
x able to preserve the MPLS forwarding state.
x -reset
x If set, then all existing simulated routers will be removed
x before creating a new one.
x -targeted_hello_hold_time
x The amount of time, expressed in seconds, that an LDP adjacency will
x be maintained for a targeted peer in the absence of a HELLO message.
x -targeted_hello_interval
x The amount of time, expressed in seconds, between transmitted HELLO
x messages to targeted peers.
n -override_existence_check
n This argument defined by Cisco is not supported for NGPF implementation.
n -override_tracking
n This argument defined by Cisco is not supported for NGPF implementation.
n -cfi
n This argument defined by Cisco is not supported for NGPF implementation.
n -config_seq_no
n This argument defined by Cisco is not supported for NGPF implementation.
n -egress_label_mode
n This argument defined by Cisco is not supported for NGPF implementation.
n -label_start
n This argument defined by Cisco is not supported for NGPF implementation.
n -label_step
n This argument defined by Cisco is not supported for NGPF implementation.
n -label_type
n This argument defined by Cisco is not supported for NGPF implementation.
n -loop_detection
n This argument defined by Cisco is not supported for NGPF implementation.
n -max_lsps
n This argument defined by Cisco is not supported for NGPF implementation.
n -max_pdu_length
n This argument defined by Cisco is not supported for NGPF implementation.
n -message_aggregation
n This argument defined by Cisco is not supported for NGPF implementation.
n -mtu
n This argument defined by Cisco is not supported for NGPF implementation.
n -path_vector_limit
n This argument defined by Cisco is not supported for NGPF implementation.
n -timeout
n This argument defined by Cisco is not supported for NGPF implementation.
n -transport_ip_addr
n This argument defined by Cisco is not supported for NGPF implementation.
n -user_priofity
n This argument defined by Cisco is not supported for NGPF implementation.
n -vlan_cfi
n This argument defined by Cisco is not supported for NGPF implementation.
x -peer_count
x Peer Count(multiplier)
x -interface_name
x NOT DEFINED
x -interface_multiplier
x number of layer instances per parent instance (multiplier)
x -interface_active
x Flag.
x -target_name
x NOT DEFINED
x -target_multiplier
x number of this object per parent object
x -target_auth_key
x MD5Key
x -initiate_targeted_hello
x Initiate Targeted Hello
x -target_auth_mode
x The Authentication mode which will be used.
x -target_active
x Enable or Disable LDP Targeted Peer
x -router_name
x NOT DEFINED
x -router_multiplier
x number of layer instances per parent instance (multiplier)
x -router_active
x Enable or Disable LDP Router
x -targeted_peer_name
x Targted Peer Name.
x -start_rate_scale_mode
x Indicates whether the control is specified per port or per device group
x -start_rate_enabled
x Enabled
x -start_rate
x Number of times an action is triggered per time interval
x -start_rate_interval
x Time interval used to calculate the rate for triggering an action (rate = count/interval)
x -stop_rate_scale_mode
x Indicates whether the control is specified per port or per device group
x -stop_rate_enabled
x Enabled
x -stop_rate
x Number of times an action is triggered per time interval
x -stop_rate_interval
x Time interval used to calculate the rate for triggering an action (rate = count/interval)
x -lpb_interface_name
x Name of NGPF element
x -lpb_interface_active
x Enable or Disable LDP Interface
x -root_ranges_count_v4
x The number of Root Ranges configured for this LDP router
x -leaf_ranges_count_v4
x The number of Leaf Ranges configured for this LDP router
x -root_ranges_count_v6
x The number of Root Ranges configured for this LDP router
x -leaf_ranges_count_v6
x The number of Leaf Ranges configured for this LDP router
x -ipv6_peer_count
x The number of Ipv6 peers
x -ldp_version
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiangpf_commands/emulation_ldp_config.py_part3 |
x Valid only for -mode create.
x Gives the step for the gateway IP address.
x -graceful_restart_enable
x Will enable graceful restart (HA) on the LDP neighbor.
n -no_write
n This argument defined by Cisco is not supported for NGPF implementation.
x -reconnect_time
x (in milliseconds) This Fault Tolerant (FT) Reconnect Timer value is
x advertised in the FT Session TLV in the Initialization message sent by
x a neighbor LSR. It is a request sent by an LSR to its neighbor(s) - in
x the event that the receiving neighbor detects that the LDP session has
x failed, the receiver should maintain MPLS forwarding state and wait
x for the sender to perform a restart of the control plane and LDP
x protocol. If the value = 0, the sender is indicating that it will not
x preserve its MPLS forwarding state across the restart.
x If -graceful_restart_enable is set.
x -recovery_time
x If -graceful_restart_enable is set; (in milliseconds)
x The restarting LSR is advertising the amount of time that it will
x retain its MPLS forwarding state. This time period begins when it
x sends the restart Initialization message, with the FT session TLV,
x to the neighbor LSRs (to re-establish the LDP session). This timer
x allows the neighbors some time to resync the LSPs in an orderly
x manner. If the value = 0, it means that the restarting LSR was not
x able to preserve the MPLS forwarding state.
x -reset
x If set, then all existing simulated routers will be removed
x before creating a new one.
x -targeted_hello_hold_time
x The amount of time, expressed in seconds, that an LDP adjacency will
x be maintained for a targeted peer in the absence of a HELLO message.
x -targeted_hello_interval
x The amount of time, expressed in seconds, between transmitted HELLO
x messages to targeted peers.
n -override_existence_check
n This argument defined by Cisco is not supported for NGPF implementation.
n -override_tracking
n This argument defined by Cisco is not supported for NGPF implementation.
n -cfi
n This argument defined by Cisco is not supported for NGPF implementation.
n -config_seq_no
n This argument defined by Cisco is not supported for NGPF implementation.
n -egress_label_mode
n This argument defined by Cisco is not supported for NGPF implementation.
n -label_start
n This argument defined by Cisco is not supported for NGPF implementation.
n -label_step
n This argument defined by Cisco is not supported for NGPF implementation.
n -label_type
n This argument defined by Cisco is not supported for NGPF implementation.
n -loop_detection
n This argument defined by Cisco is not supported for NGPF implementation.
n -max_lsps
n This argument defined by Cisco is not supported for NGPF implementation.
n -max_pdu_length
n This argument defined by Cisco is not supported for NGPF implementation.
n -message_aggregation
n This argument defined by Cisco is not supported for NGPF implementation.
n -mtu
n This argument defined by Cisco is not supported for NGPF implementation.
n -path_vector_limit
n This argument defined by Cisco is not supported for NGPF implementation.
n -timeout
n This argument defined by Cisco is not supported for NGPF implementation.
n -transport_ip_addr
n This argument defined by Cisco is not supported for NGPF implementation.
n -user_priofity
n This argument defined by Cisco is not supported for NGPF implementation.
n -vlan_cfi
n This argument defined by Cisco is not supported for NGPF implementation.
x -peer_count
x Peer Count(multiplier)
x -interface_name
x NOT DEFINED
x -interface_multiplier
x number of layer instances per parent instance (multiplier)
x -interface_active
x Flag.
x -target_name
x NOT DEFINED
x -target_multiplier
x number of this object per parent object
x -target_auth_key
x MD5Key
x -initiate_targeted_hello
x Initiate Targeted Hello
x -target_auth_mode
x The Authentication mode which will be used.
x -target_active
x Enable or Disable LDP Targeted Peer
x -router_name
x NOT DEFINED
x -router_multiplier
x number of layer instances per parent instance (multiplier)
x -router_active
x Enable or Disable LDP Router
x -targeted_peer_name
x Targted Peer Name.
x -start_rate_scale_mode
x Indicates whether the control is specified per port or per device group
x -start_rate_enabled
x Enabled
x -start_rate
x Number of times an action is triggered per time interval
x -start_rate_interval
x Time interval used to calculate the rate for triggering an action (rate = count/interval)
x -stop_rate_scale_mode
x Indicates whether the control is specified per port or per device group
x -stop_rate_enabled
x Enabled
x -stop_rate
x Number of times an action is triggered per time interval
x -stop_rate_interval
x Time interval used to calculate the rate for triggering an action (rate = count/interval)
x -lpb_interface_name
x Name of NGPF element
x -lpb_interface_active
x Enable or Disable LDP Interface
x -root_ranges_count_v4
x The number of Root Ranges configured for this LDP router
x -leaf_ranges_count_v4
x The number of Leaf Ranges configured for this LDP router
x -root_ranges_count_v6
x The number of Root Ranges configured for this LDP router
x -leaf_ranges_count_v6
x The number of Leaf Ranges configured for this LDP router
x -ipv6_peer_count
x The number of Ipv6 peers
x -ldp_version
x Version of LDP. When RFC 5036 is chosen, LDP version is version 1. When draft-pdutta-mpls-ldp-adj-capability-00 is chosen, LDP version is version 2
x -session_preference
x The transport connection preference of the LDP router that is conveyed in Dual-stack capability TLV included in LDP Hello message.
x -include_sac
x Select to include 'State Advertisement Control Capability' TLV in Initialization message and Capability message
x -enable_ipv4_fec
x If selected, IPv4-Prefix LSP app type is enabled in SAC TLV.
x -enable_ipv6_fec
x If selected, IPv6-Prefix LSP app type is enabled in SAC TLV.
x -enable_fec128
x If selected, FEC128 P2P-PW app type is enabled in SAC TLV.
x -enable_fec129
x If selected, FEC129 P2P-PW app type is enabled in SAC TLV.
x -ignore_received_sac
x If selected, LDP Router ignores SAC TLV it receives.
x -enable_p2mp_capability
x If selected, LDP Router is P2MP capable.
x -enable_bfd_mpls_learned_lsp
x If selected, BFD MPLS is enabled.
x -enable_lsp_ping_learned_lsp
x If selected, LSP Ping is enabled for learned LSPs.
x -lsp_type
x LSP Type
x -root_address
x Root Address
x -root_address_count
x Root Address Count
x -root_address_step
x Root Address Step
x -lsp_count_per_root
x LSP Count Per Root
x -label_value_start
x Label Value Start
x -label_value_step
x Label Value Step
x -continuous_increment_opaque_value_across_root
x Continuous Increment Opaque Value Across Root
x -number_of_tlvs
x Number Of TLVs
x -group_address_v4
x IPv4 Group Address
x -group_address_v6
x IPv6 Group Address
x -group_count_per_lsp
x Group Count per LSP
x -group_count_per_lsp_root
x Group Count per LSP
x -source_address_v4
x IPv4 Source Address
x -source_address_v6
x IPv6 Source Address
x -source_count_per_lsp
x Source Count Per LSP
x -filter_on_group_address
x If selected, all the LSPs will belong to the same set of groups
x -start_group_address_v4
x Start Group Address(V4)
x -start_group_address_v6
x Start Group Address(V6)
x -active_leafrange
x Activate/Deactivate Configuration
x -name
x Name of NGPF element, guaranteed to be unique in Scenario
x -active
x If selected, Then the TLV is enabled
x -type
x Type
x -tlv_length
x Length
x -value
x Value
x -increment
x Increment Step
Return Values:
A list containing the ipv4 loopback protocol stack handles that were added by the command (if any).
x key:ipv4_loopback_handle value:A list containing the ipv4 loopback protocol stack handles that were added by the command (if any).
A list containing the ipv6 loopback protocol stack handles that were added by the command (if any).
x key:ipv6_loopback_handle value:A list containing the ipv6 loopback protocol stack handles that were added by the command (if any).
A list containing the ipv4 protocol stack handles that were added by the command (if any).
x key:ipv4_handle value:A list containing the ipv4 protocol stack handles that were added by the command (if any).
A list containing the ipv6 protocol stack handles that were added by the command (if any).
x key:ipv6_handle value:A list containing the ipv6 protocol stack handles that were added by the command (if any).
A list containing the ethernet protocol stack handles that were added by the command (if any).
x key:ethernet_handle value:A list containing the ethernet protocol stack handles that were added by the command (if any).
A list containing the ldp basic router protocol stack handles that were added by the command (if any).
x key:ldp_basic_router_handle value:A list containing the ldp basic router protocol stack handles that were added by the command (if any).
A list containing the ldp connected interface protocol stack handles that were added by the command (if any).
x key:ldp_connected_interface_handle value:A list containing the ldp connected interface protocol stack handles that were added by the command (if any).
A list containing the ldp targeted router protocol stack handles that were added by the command (if any).
x key:ldp_targeted_router_handle value:A list containing the ldp targeted router protocol stack handles that were added by the command (if any).
A list containing the leaf ranges protocol stack handles that were added by the command (if any).
x key:leaf_ranges value:A list containing the leaf ranges protocol stack handles that were added by the command (if any).
A list containing the root ranges protocol stack handles that were added by the command (if any).
x key:root_ranges value:A list containing the root ranges protocol stack handles that were added by the command (if any).
A list containing the ldpv6 basic router protocol stack handles that were added by the command (if any).
x key:ldpv6_basic_router_handle value:A list containing the ldpv6 basic router protocol stack handles that were added by the command (if any).
A list containing the ldpv6 connected interface protocol stack handles that were added by the command (if any).
x key:ldpv6_connected_interface_handle value:A list containing the ldpv6 connected interface protocol stack handles that were added by the command (if any).
A list containing the ldpv6 targeted router protocol stack handles that were added by the command (if any).
x key:ldpv6_targeted_router_handle value:A list containing the ldpv6 targeted router protocol stack handles that were added by the command (if any).
$::SUCCESS | $::FAILURE
key:status value:$::SUCCESS | $::FAILURE
If status is failure, detailed information provided.
key:log value:If status is failure, detailed information provided.
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiangpf_commands/emulation_ldp_config.py_part4 |
x Version of LDP. When RFC 5036 is chosen, LDP version is version 1. When draft-pdutta-mpls-ldp-adj-capability-00 is chosen, LDP version is version 2
x -session_preference
x The transport connection preference of the LDP router that is conveyed in Dual-stack capability TLV included in LDP Hello message.
x -include_sac
x Select to include 'State Advertisement Control Capability' TLV in Initialization message and Capability message
x -enable_ipv4_fec
x If selected, IPv4-Prefix LSP app type is enabled in SAC TLV.
x -enable_ipv6_fec
x If selected, IPv6-Prefix LSP app type is enabled in SAC TLV.
x -enable_fec128
x If selected, FEC128 P2P-PW app type is enabled in SAC TLV.
x -enable_fec129
x If selected, FEC129 P2P-PW app type is enabled in SAC TLV.
x -ignore_received_sac
x If selected, LDP Router ignores SAC TLV it receives.
x -enable_p2mp_capability
x If selected, LDP Router is P2MP capable.
x -enable_bfd_mpls_learned_lsp
x If selected, BFD MPLS is enabled.
x -enable_lsp_ping_learned_lsp
x If selected, LSP Ping is enabled for learned LSPs.
x -lsp_type
x LSP Type
x -root_address
x Root Address
x -root_address_count
x Root Address Count
x -root_address_step
x Root Address Step
x -lsp_count_per_root
x LSP Count Per Root
x -label_value_start
x Label Value Start
x -label_value_step
x Label Value Step
x -continuous_increment_opaque_value_across_root
x Continuous Increment Opaque Value Across Root
x -number_of_tlvs
x Number Of TLVs
x -group_address_v4
x IPv4 Group Address
x -group_address_v6
x IPv6 Group Address
x -group_count_per_lsp
x Group Count per LSP
x -group_count_per_lsp_root
x Group Count per LSP
x -source_address_v4
x IPv4 Source Address
x -source_address_v6
x IPv6 Source Address
x -source_count_per_lsp
x Source Count Per LSP
x -filter_on_group_address
x If selected, all the LSPs will belong to the same set of groups
x -start_group_address_v4
x Start Group Address(V4)
x -start_group_address_v6
x Start Group Address(V6)
x -active_leafrange
x Activate/Deactivate Configuration
x -name
x Name of NGPF element, guaranteed to be unique in Scenario
x -active
x If selected, Then the TLV is enabled
x -type
x Type
x -tlv_length
x Length
x -value
x Value
x -increment
x Increment Step
Return Values:
A list containing the ipv4 loopback protocol stack handles that were added by the command (if any).
x key:ipv4_loopback_handle value:A list containing the ipv4 loopback protocol stack handles that were added by the command (if any).
A list containing the ipv6 loopback protocol stack handles that were added by the command (if any).
x key:ipv6_loopback_handle value:A list containing the ipv6 loopback protocol stack handles that were added by the command (if any).
A list containing the ipv4 protocol stack handles that were added by the command (if any).
x key:ipv4_handle value:A list containing the ipv4 protocol stack handles that were added by the command (if any).
A list containing the ipv6 protocol stack handles that were added by the command (if any).
x key:ipv6_handle value:A list containing the ipv6 protocol stack handles that were added by the command (if any).
A list containing the ethernet protocol stack handles that were added by the command (if any).
x key:ethernet_handle value:A list containing the ethernet protocol stack handles that were added by the command (if any).
A list containing the ldp basic router protocol stack handles that were added by the command (if any).
x key:ldp_basic_router_handle value:A list containing the ldp basic router protocol stack handles that were added by the command (if any).
A list containing the ldp connected interface protocol stack handles that were added by the command (if any).
x key:ldp_connected_interface_handle value:A list containing the ldp connected interface protocol stack handles that were added by the command (if any).
A list containing the ldp targeted router protocol stack handles that were added by the command (if any).
x key:ldp_targeted_router_handle value:A list containing the ldp targeted router protocol stack handles that were added by the command (if any).
A list containing the leaf ranges protocol stack handles that were added by the command (if any).
x key:leaf_ranges value:A list containing the leaf ranges protocol stack handles that were added by the command (if any).
A list containing the root ranges protocol stack handles that were added by the command (if any).
x key:root_ranges value:A list containing the root ranges protocol stack handles that were added by the command (if any).
A list containing the ldpv6 basic router protocol stack handles that were added by the command (if any).
x key:ldpv6_basic_router_handle value:A list containing the ldpv6 basic router protocol stack handles that were added by the command (if any).
A list containing the ldpv6 connected interface protocol stack handles that were added by the command (if any).
x key:ldpv6_connected_interface_handle value:A list containing the ldpv6 connected interface protocol stack handles that were added by the command (if any).
A list containing the ldpv6 targeted router protocol stack handles that were added by the command (if any).
x key:ldpv6_targeted_router_handle value:A list containing the ldpv6 targeted router protocol stack handles that were added by the command (if any).
$::SUCCESS | $::FAILURE
key:status value:$::SUCCESS | $::FAILURE
If status is failure, detailed information provided.
key:log value:If status is failure, detailed information provided.
List of LDP routers created Please note that this key will be omitted if the current session or command were run with -return_detailed_handles 0.
key:handle value:List of LDP routers created Please note that this key will be omitted if the current session or command were run with -return_detailed_handles 0.
Examples:
See files starting with LDP_ in the Samples subdirectory. Also see some of the L2VPN, L3VPN, MPLS, and MVPN sample files for further examples of the LDP usage.
See the LDP example in Appendix A, "Example APIs," for one specific example usage.
Sample Input:
Sample Output:
Notes:
Coded versus functional specification.
If one wants to modify the ineterface to which the protocol interface is
connected, one has to specify the correct MAC address of that interface.
If this requirement is not fulfilled, the interface is not guaranteed to
be correctly determined because more interfaces can have the exact same
configuration.
When -handle is provided with the /globals value the arguments that configure global protocol
setting accept both multivalue handles and simple values.
When -handle is provided with a a protocol stack handle or a protocol session handle, the arguments
that configure global settings will only accept simple values. In this situation, these arguments will
configure only the settings of the parent device group or the ports associated with the parent topology.
If the current session or command was run with -return_detailed_handles 0 the following keys will be omitted from the command response: handle
See Also:
'''
hlpy_args = locals().copy()
hlpy_args.update(kwargs)
del hlpy_args['self']
del hlpy_args['kwargs']
not_implemented_params = []
mandatory_params = []
file_params = []
try:
return self.__execute_command(
'emulation_ldp_config',
not_implemented_params, mandatory_params, file_params,
hlpy_args
)
except (IxiaError, ):
e = sys.exc_info()[1]
return make_hltapi_fail(e.message)
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiangpf_commands/emulation_ldp_config.py_part5 |
List of LDP routers created Please note that this key will be omitted if the current session or command were run with -return_detailed_handles 0.
key:handle value:List of LDP routers created Please note that this key will be omitted if the current session or command were run with -return_detailed_handles 0.
Examples:
See files starting with LDP_ in the Samples subdirectory. Also see some of the L2VPN, L3VPN, MPLS, and MVPN sample files for further examples of the LDP usage.
See the LDP example in Appendix A, "Example APIs," for one specific example usage.
Sample Input:
Sample Output:
Notes:
Coded versus functional specification.
If one wants to modify the ineterface to which the protocol interface is
connected, one has to specify the correct MAC address of that interface.
If this requirement is not fulfilled, the interface is not guaranteed to
be correctly determined because more interfaces can have the exact same
configuration.
When -handle is provided with the /globals value the arguments that configure global protocol
setting accept both multivalue handles and simple values.
When -handle is provided with a a protocol stack handle or a protocol session handle, the arguments
that configure global settings will only accept simple values. In this situation, these arguments will
configure only the settings of the parent device group or the ports associated with the parent topology.
If the current session or command was run with -return_detailed_handles 0 the following keys will be omitted from the command response: handle
See Also:
'''
hlpy_args = locals().copy()
hlpy_args.update(kwargs)
del hlpy_args['self']
del hlpy_args['kwargs']
not_implemented_params = []
mandatory_params = []
file_params = []
try:
return self.__execute_command(
'emulation_ldp_config',
not_implemented_params, mandatory_params, file_params,
hlpy_args
)
except (IxiaError, ):
e = sys.exc_info()[1]
return make_hltapi_fail(e.message)
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiangpf_commands/emulation_ldp_config.py_part6 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import sys
import ixiautil
from ixiahlt import IxiaHlt
from ixiangpf import IxiaNgpf
class IxiaNgpf(ixiautil.PartialClass, IxiaNgpf):
# TODO: set man and defaulted args, docstring
def cleanup_session(self, **kwargs):
'''
Procedure Header
Name:
::ixiangpf::cleanup_session
Description:
This command disconnects from chassis, IxNetwork Tcl Server and Tcl Server,
resets to factory defaults, and removes ownership from a list of ports.
This command can be used after a script is run.
Synopsis:
::ixiangpf::cleanup_session
x [-port_handle REGEXP ^[0-9]+/[0-9]+/[0-9]+$]
[-maintain_lock CHOICES 0 1
CHOICES 1 0]
x [-clear_csv CHOICES 0 1]
x [-skip_wait_pending_operations FLAG]
x [-reset FLAG]
n [-handle ANY]
Arguments:
x -port_handle
x List ports to release.
x When using IxTclHal, IxTclProtocol or IxTclAccess, -port_handle option
x should always be present, otherwise only the disconnect part will be
x completed.
-maintain_lock
When using IxNetwork with the -reset option, this parameter will be
ignored.
x -clear_csv
x Valid choices are:
x 0 - The CSV files are not deleted after cleanup_session procedure is called
x 1 - The CSV files created after calling traffic_stats are deleted
x -skip_wait_pending_operations
x If there are any disconnect operations issued, this flag will prevent
x procedure from waiting for them to end. If this flag is used then
x there is no warrantythat the disconnect operations have ended and
x exiting the script with these operations still running can be the
x source of errors.
x -reset
x Reset the ports to factory defaults before releasing them.
x When using IxTclHal and IxTclProtocol, -port_handle option should be
x present also, otherwise the reset will not be completed.
n -handle
n This argument defined by Cisco is not supported for NGPF implementation.
Return Values:
$::SUCCESS | $::FAILURE
key:status value:$::SUCCESS | $::FAILURE
On status of failure, gives detailed information.
key:log value:On status of failure, gives detailed information.
'''
result = {'status': IxiaHlt.SUCCESS}
try:
# Will not fail the cleanup_session if the remove or commit fails. The user might be already disconnected
# if TCP timeout out or from other reasons and he want to cleanup the session.
if self.__session_id:
self.ixnet.remove(self.__session_id)
self.__commit()
# Try to cleanup the IxNetwork connection
self.ixnet.disconnect()
except (Exception, ):
e = sys.exc_info()[1]
# Log failure, but continue to run legacy cleanup
result['log'] = "Could not cleanup IxNetwork session gracefully: " + str(e)
self.__session_id = None
legacy_result = self.ixiahlt.cleanup_session(**kwargs)
if legacy_result['status'] == IxiaHlt.FAIL:
result['status'] = IxiaHlt.FAIL
if 'log' in result:
if 'log' in legacy_result:
legacy_result['log'] = "%s; %s" % (legacy_result['log'], result['log'])
else:
legacy_result['log'] = result['log']
return legacy_result
| KeysightData/IxNetworkAPI9.30.2212.7PI/ixia/hlapi/9.30.2212.6/library/common/ixiangpf/python/ixiangpf_commands/cleanup_session.py_part1 |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 0