Modules

class chariot_base.connector.local.LocalConnector[source]

All subscribers/publisers at Chariot project should extend this class

clear()[source]

Reinitialize the connector

close_span(span)[source]

Close a logging span

Parameters:span – Span to close
inject_tracer(tracer)[source]

Inject an opentracing client

Parameters:tracer – the opentracing client
on_connect(client, flags, rc, properties)[source]

The handler run when the connections is established

Parameters:
  • client – the subscribed MQTT client
  • flags
  • rc
  • properties – Custom properties
on_disconnect(client, packet)[source]

The handler run when the connections is fineshed

Parameters:
  • client – the subscribed MQTT client
  • packet
on_message(client, topic, payload, qos, properties)[source]

Handler for new message

Parameters:
  • client – the subscribed MQTT client
  • topic – the MQTT topic
  • payload – the message
  • qos – MQTT broker quality of service
  • properties – Custom properties
on_subscribe(client, mid, qos)[source]

The handler run when the client subscribed to a new topic

Parameters:
  • client – the subscribed MQTT client
  • mid
  • qos – MQTT broker quality of service
publish(topic, msg, qos=1)[source]

Publish to a topic

Parameters:
  • msg – the published message
  • qos – MQTT broker quality of service
register_for_client(client)[source]

Register handlers to the client.

Parameters:client – Client to register handlers
set_up_tracer(options)[source]

Configure a new opentracing client

Parameters:options – options to configure the new client
start_span(span_id, child_span=None)[source]

Start a new logging span

Parameters:
  • span_id – identifier of a new logging span
  • child_span – parent span
subscribe(topic, qos=1)[source]

Subscribe to a topic

Parameters:
  • topic – Which topic the subscriber should listen for new message.
  • qos – MQTT broker quality of service
chariot_base.connector.local.create_client(options, postfix='_client')[source]

Create a new GMQTT client

Parameters:options – Options for client initialization
Para postfix:Unique postfix for the client
class chariot_base.connector.watson.WatsonConnector(options)[source]
publish(point)[source]
Parameters:point – A point represent received message.
Returns:True if event publish is successfull.
class chariot_base.model.alert.Alert(name, msg=None, severity=100)[source]

Describe each alert raised by Chariot

dict()[source]

Converts alert object to dictionary

class chariot_base.model.point.DataPointFactory(db, table)[source]

Converts to a new point

from_json_string(msg)[source]

From JSON message payload

from_mqtt_message(message)[source]

From mosquitto message payload

class chariot_base.model.message.Message(sensor_id, value)[source]

Describe message passed between Chariot’s components

class chariot_base.model.subscriber.Subscriber(subscriber_id)[source]

Chariot gateway subscriber

class chariot_base.tests.utils.Callbacks[source]
on_message(client, topic, payload, qos, properties)[source]

Handler for new message

Parameters:
  • client – the subscribed MQTT client
  • topic – the MQTT topic
  • payload – the message
  • qos – MQTT broker quality of service
  • properties – Custom properties
on_subscribe(client, mid, qos)[source]

The handler run when the client subscribed to a new topic

Parameters:
  • client – the subscribed MQTT client
  • mid
  • qos – MQTT broker quality of service