teos.cli.teos_cli

class RPCClient(rpc_host, rpc_port)[source]

Bases: object

Creates and keeps a connection to the an RPC serving TowerServices. It has methods to call each of the available grpc services, and it returns a pretty-printed json response. Errors from the grpc calls are not handled.

Parameters
  • rpc_host (str) – the IP or host where the RPC server will be hosted.

  • rpc_port (int) – the port where the RPC server will be hosted.

channel

The Channel object.

Type

grpc.Channel

stub

The rpc client stub.

get_all_appointments()[source]

Gets a list of all the appointments in the watcher, and trackers in the responder.

get_tower_info()[source]

Gets generic information about the tower.

get_user(user_id)[source]

Gets information about a specific user.

Parameters

user_id (str) – the id of the requested user.

Raises

InvalidParameter – if user_id is not in the valid format.

get_users()[source]

Gets the list of registered user ids.

stop()[source]

Stops TEOS gracefully.

formatted(func)[source]

Transforms the given function by wrapping the return value with json_format.MessageToDict followed by json.dumps, in order to print the result in a prettyfied json format.

main(command, args, command_line_conf)[source]
to_json(obj)[source]

All conversions to json in this module should be consistent, therefore we restrict the options using this function.