testcenter.api package

Submodules

testcenter.api.stc_python module

author:yoram@ignissoft.com
class testcenter.api.stc_python.StcPythonWrapper(logger, stc_install_dir)

Bases: object

apply()

Sends a test configuration to the Spirent TestCenter chassis.

config(obj_ref, **attributes)

Set or modifies one or more object attributes, or a relation.

Parameters:
  • obj_ref – requested object reference.
  • attributes – dictionary of {attributes: values} to configure.
create(obj_type, parent, **attributes)

Creates one or more Spirent TestCenter Automation objects.

Parameters:
  • obj_type – object type.
  • parent – object parent - object will be created under this parent.
  • attributes – additional attributes.
Returns:

STC object reference.

get(obj_ref, attribute=[])

Returns the value(s) of one or more object attributes or a set of object handles.

Parameters:
  • obj_ref – requested object reference.
  • attribute – requested attribute. If empty - return values of all object attributes.
Returns:

requested value(s) as returned by get command.

getList(obj_ref, attribute)

Returns the value of the object attributes or a python list.

Parameters:
  • obj_ref – requested object reference.
  • attribute – requested attribute.
Returns:

requested value as returned by get command.

perform(command, **arguments)

Execute a command.

Parameters:
  • command – requested command.
  • arguments – additional arguments.
Returns:

dictionary {attribute, value} as returned by ‘perform command’.

subscribe(**arguments)

Subscribe to statistics view.

Parameters:arguments – subscribe command arguments. must arguments: parent, resultParent, configType, resultType + additional arguments.
Returns:ResultDataSet handler
unsubscribe(result_data_set)

Unsubscribe from statistics view.

Parameters:result_data_set – ResultDataSet handler
wait()

Wait until sequencer is finished.

testcenter.api.stc_rest module

author:yoram@ignissoft.com
class testcenter.api.stc_rest.StcRestWrapper(logger, server, port=80, user_name='docs', session_name=None)

Bases: object

apply()

Sends a test configuration to the Spirent TestCenter chassis.

config(obj_ref, **attributes)

Set or modifies one or more object attributes, or a relation.

Parameters:
  • obj_ref – requested object reference.
  • attributes – dictionary of {attributes: values} to configure.
create(obj_type, parent, **attributes)

Creates one or more Spirent TestCenter Automation objects.

Parameters:
  • obj_type – object type.
  • parent – object parent - object will be created under this parent.
  • attributes – additional attributes.
Returns:

STC object reference.

delete(obj_ref)

Delete Spirent TestCenter Automation object.

Parameters:obj_ref – object handle to delete.
disconnect(terminate)
get(obj_ref, attribute='')

Returns the value(s) of one or more object attributes or a set of object handles.

Parameters:
  • obj_ref – requested object reference.
  • attribute – requested attribute. If empty - return values of all object attributes.
Returns:

requested value(s) as returned by get command.

getList(obj_ref, attribute)

Returns the value of the object attributes or a python list.

Parameters:
  • obj_ref – requested object reference.
  • attribute – requested attribute.
Returns:

requested value as returned by get command.

perform(command, **arguments)

Execute a command.

Parameters:
  • command – requested command.
  • arguments – additional arguments.
subscribe(**arguments)

Subscribe to statistics view.

Parameters:arguments – subscribe command arguments. must arguments: parent, resultParent, configType, resultType + additional arguments.
Returns:ResultDataSet handler
unsubscribe(result_data_set)

Unsubscribe from statistics view.

Parameters:result_data_set – ResultDataSet handler
wait()

Wait until sequencer is finished.

testcenter.api.stc_tcl module

author:yoram@ignissoft.com
class testcenter.api.stc_tcl.StcTclWrapper(logger, stc_install_dir, tcl_interp=None)

Bases: trafficgenerator.tgn_tcl.TgnTclWrapper

STC Python API over Tcl interpreter.

apply()

Sends a test configuration to the Spirent TestCenter chassis.

config(obj_ref, **attributes)

Set or modifies one or more object attributes, or a relation.

Parameters:
  • obj_ref – requested object reference.
  • attributes – dictionary of {attributes: values} to configure.
create(obj_type, parent, **attributes)

Creates one or more Spirent TestCenter Automation objects.

Parameters:
  • obj_type – object type.
  • parent – object parent - object will be created under this parent.
  • attributes – additional attributes.
Returns:

STC object reference.

delete(obj_ref)

Delete the specified object.

Parameters:obj_ref – object reference of the object to delete.
get(obj_ref, attribute=None)

Returns the value(s) of one or more object attributes or a set of object handles.

Parameters:
  • obj_ref – requested object reference.
  • attribute – requested attribute. If empty - return values of all object attributes.
Returns:

requested value(s) as returned by get command. If all attributes were requested the return value is dictionary {attrib_name:attrib_val, attrib_name:attrib_val, ..} If single attribute was requested, the returned value is simple str.

getList(obj_ref, attribute)
perform(command, **arguments)

Execute a command.

Parameters:
  • command – requested command.
  • arguments – additional arguments.
Returns:

dictionary {attribute, value} as returned by ‘perform command’.

stc_command(command, *attributes)
subscribe(**arguments)

Subscribe to statistics view.

Parameters:arguments – subscribe command arguments. must arguments: parent, resultParent, configType, resultType + additional arguments.
Returns:ResultDataSet handler
unsubscribe(result_data_set)

Unsubscribe from statistics view.

Parameters:result_data_set – ResultDataSet handler
wait()

Wait until sequencer is finished.

Module contents