p4utils.utils.sswitch_thrift_API module¶
This module provides the Simple Switch Thrift API. It builds on the generic Thrift API. It is a modified version of sswitch_CLI.py from behavioral model.
-
class
p4utils.utils.sswitch_thrift_API.
SimpleSwitchThriftAPI
(thrift_port, thrift_ip='localhost', json_path=None)[source]¶ Bases:
p4utils.utils.thrift_API.ThriftAPI
Simple Switch Thrift control plane API.
Parameters: -
get_time_since_epoch
()[source]¶ Prints time elapsed (in microseconds) since the switch clock’s epoch.
-
mirroring_add_port_and_mgrp
(mirror_id, egress_port, mgrp)[source]¶ Adds mirroring session to multicast group.
Parameters:
-
mirroring_delete
(mirror_id)[source]¶ Deletes mirroring mapping.
Parameters: mirror_id (int) – id of the mirror to delete
-
mirroring_get
(mirror_id)[source]¶ Prints mirroring session information
Parameters: mirror_id (int) – id of the mirror to display
-
parse_int
(arg, name)[source]¶ Tries to convert the argument to
int
.Parameters: Returns: integer value of the argument
Return type: Raises: p4utils.utils.thrift_API.UIn_Error
– if the argument cannot be transformed in an integer.
-
set_queue_depth
(queue_depth, egress_port=None, priority=None)[source]¶ Sets depth of one / all egress queue(s).
Parameters:
-