p4utils.utils.client module

class p4utils.utils.client.ThriftClient(thrift_port, sw_name, cli_bin=None, cli_input=None, log_enabled=True, log_dir='/tmp', **kwargs)[source]

Bases: object

This controller reads commands from a thrift configuration file and uses it to set up the thrift switch.

Parameters:
  • cli_bin (string) – client binary file path.
  • cli_input (string) – path of the configuration text file.
  • log_enabled (bool) – whether to enable logs.
  • log_dir (string) – directory to store logs.
  • thrift_port (int) – thrift server thrift_port number.
  • sw_name (string) – name of the switch to configure.
cli_bin = 'simple_switch_CLI'[source]
configure()[source]

This method configures the switch with the provided file.

get_conf()[source]

Returns self.cli_input

classmethod set_binary(cli_bin)[source]

Set class default binary.

set_conf(cli_input)[source]

Set the configuration file path.