avalanche package¶
Subpackages¶
Submodules¶
avalanche.avl_app module¶
This module implements classes and utility functions to manage Avalanche application.
author: | yoram@ignissoft.com |
---|
-
class
avalanche.avl_app.
AvlApp
(logger, api_wrapper)¶ Bases:
trafficgenerator.tgn_app.TgnApp
Avalanche driver. Equivalent to Avalanche Application.
-
connect
(session_id=None)¶ Login to Avalanche server.
Login must be the first command.
Parameters: session_id – existing session ID to connect to.
-
disconnect
()¶ Disconnect from chassis and shutdown.
-
load_config
(config_file_name)¶ Import configuration file from spf file.
Parameters: config_file_name – full path to the configuration file.
-
new_config
()¶ Create new, empty, configuration.
-
save_config
(config_file_name)¶ Save configuration file as tcc or xml.
Parameters: config_file_name – full path to the configuration file.
-
-
avalanche.avl_app.
init_avl
(logger, tcl_lib_install_dir, avl_install_dir)¶ Create Avalanche application object.
Parameters: - logger – python logger object
- tcl_lib_install_dir – Tcllib directory
- avl_install_dir – Avalanche installation directory
Returns: Avalanche object
avalanche.avl_hw module¶
Classes and utilities to manage Avalanche HW.
author: | yoram@ignissoft.com |
---|
-
class
avalanche.avl_hw.
AvlHw
(**data)¶ Bases:
avalanche.avl_object.AvlObject
Represent STC port.
-
get_chassis
(hostname)¶
-
-
class
avalanche.avl_hw.
AvlPhyBase
(**data)¶ Bases:
avalanche.avl_object.AvlObject
Base class for all Avalanche Physical sub-tree objects.
-
get_inventory
()¶
-
-
class
avalanche.avl_hw.
AvlPhyChassis
(**data)¶ Bases:
avalanche.avl_hw.AvlPhyBase
Represent Avalanche physical chassis/appliance.
-
attributes_names
= ('ActiveSoftware', 'Model', 'SerialNumber')¶
-
children_types
= {'modules': ('PhysicalTestModules', 'SlotNumber')}¶
-
-
class
avalanche.avl_hw.
AvlPhyModule
(**data)¶ Bases:
avalanche.avl_hw.AvlPhyBase
-
attributes_names
= ()¶
-
children_types
= {'ports': ('Ports', 'PortNumber')}¶
-
avalanche.avl_object module¶
Base classes and utilities to manage Spirent Avalanche.
author: | yoram@ignissoft.com |
---|
-
class
avalanche.avl_object.
AvlObject
(**data)¶ Bases:
trafficgenerator.tgn_object.TgnObject
-
command
(command, wait_after=0, **arguments)¶
-
delete
()¶
-
get_active
()¶
-
get_attribute
(attribute)¶ Get single attribute value.
Parameters: attribute – attribute name. Returns: attribute value.
-
get_attributes
(*attributes)¶ Get multiple attributes values.
Some low level APIs (like Tcl over Telnet) supports limited output length. When using get_attributes() the method will use simple stc::get to read all attributes. This is efficient but the output might exceed the output limit and will be truncated. When using attributes(*attributes) the method will use stc::get -attribute to read the attributes one by one. This is less efficient but less likely to exceed the output length.
Parameters: attributes – list of attributes to retrieve. If empty (default) return all attribute values. Returns: dictionary {attribute: value} of all requested attributes.
-
get_children
(*types)¶ Get all children of the requested types.
Parameters: attribute – requested children types. Returns: list of all children of the requested types.
-
get_list_attribute
(attribute)¶ Returns: attribute value as Python list.
-
get_name
()¶
-
get_obj_class
(obj_type)¶ Parameters: obj_type – STC object type. Returns: object class if specific class else StcObject.
-
get_object_from_attribute
(attribute)¶
-
get_objects_from_attribute
(attribute)¶
-
set_active
(active)¶
-
set_attributes
(**attributes)¶
-
str_2_class
= {}¶
-
test_command_rc
(attribute)¶
-
-
avalanche.avl_object.
extract_avl_obj_type_from_obj_ref
(obj_ref)¶
avalanche.avl_project module¶
Classes and utilities to manage Avalanche project.
-
class
avalanche.avl_project.
AvlAssociation
(**data)¶ Bases:
avalanche.avl_object.AvlObject
Represents Avalanche association.
-
get_name
()¶
-
-
class
avalanche.avl_project.
AvlClient
(**data)¶ Bases:
avalanche.avl_project.AvlCluster
Represents Avalanche client side.
-
associations
¶
-
-
class
avalanche.avl_project.
AvlCluster
(**data)¶ Bases:
avalanche.avl_object.AvlObject
Represents Avalanche cluster.
-
class
avalanche.avl_project.
AvlInterface
(**data)¶ Bases:
avalanche.avl_object.AvlObject
Represents Avalanche interface.
-
set_port
(location)¶
-
-
class
avalanche.avl_project.
AvlProject
(**data)¶ Bases:
avalanche.avl_object.AvlObject
Represents Avalanche project object.
-
new_test
(name='Test', testtype='deviceComplex')¶ Create new test.
-
tests
¶
-
-
class
avalanche.avl_project.
AvlServer
(**data)¶ Bases:
avalanche.avl_project.AvlCluster
Represents Avalanche server side.
-
associations
¶
-
avalanche.avl_statistics_view module¶
Classes and utilities to manage STC statistics views.
-
class
avalanche.avl_statistics_view.
AvlClientStats
(project, view)¶
-
class
avalanche.avl_statistics_view.
AvlServerStats
(project, view)¶
-
class
avalanche.avl_statistics_view.
AvlStats
(project, side, view)¶ Bases:
object
Represents statistics view.
-
read_stats
()¶ Reads the statistics view from Avalanche and saves it in statistics dictionary.
-
statistics
= {}¶
-
subscribe
(side, view)¶ Subscribe to statistics view.
Parameters: - side – client/server.
- view – statistics view to subscribe to.
-
unsubscribe
()¶ UnSubscribe from statistics view.
-