Telepath API

class synmods.sidepocket.service.SidepocketApi

Bases: StormSvc, CellApi

A Telepath API for the Sidepocket service.

async addSource(name, stype, args, opts=None)

Add a data source.

Parameters:
  • name (str) – Name for the data source.

  • stype (str) – Type of data source to add.

  • args (dict) – Arguments to provide when connecting to the data source.

  • opts (dict) – Optional runtime arguments to provide when connecting to the data source.

Notes

The results dictionary contains the following keys:

success

True or False, whether the source was added succesfully.

mesg

String containing error details or empty if successful.

Returns:

Results dictionary.

Return type:

dict

async cancel(name, query_id, opts=None)

Cancel a query in the given data source.

NOTE: This method is not implemented for all connectors.

Parameters:
  • name (str) – Name of the data source to cancel the query in.

  • query_id (str) – Query id to cancel.

  • opts (dict) – Options to provide when cancelling the query.

Notes

The results dictionary contains the following keys:

success

True or False, whether the request was succesful.

mesg

String containing error details or empty if successful.

excinfo (optional)

Exception information.

Returns:

Results dictionary.

Return type:

dict

async delSource(name)

Remove a data source.

Parameters:

name (str) – Name of the data source.

Notes

The results dictionary contains the following keys:

success

True or False, whether the source was removed succesfully.

mesg

String containing error details or empty if successful.

Returns:

Results dictionary.

Return type:

dict

async listConnectors()

Get the data source connector types available.

Notes

The info dictionary contains the following keys:

args

Dict of connection argument names and a description.

query_syntax

String containing error details or empty if successful.

query_execution

One of (“sync”, “async”) representing the query execution pattern.

Yields:

tuple – Connector name and info dict.

async listSources()

Get a list of the data sources currently configured.

Notes

The info dictionary contains the following keys:

type

The connection type name.

args

Dict of arg name to the (sanitized) stored value.

extra_args

Dict of additional sanitized args stored for the source.

Yields:

tuple – Source name and info dictionary.

async query(name, query, opts=None)

Query a configured data source.

Parameters:
  • name (str) – Name of the data source to query.

  • query (str) – Query string to submit to the data source.

  • opts (dict) – Options to provide when querying the data source.

Yields:

tuple – Message tuple of (type, data, info)

async renameSource(name, newv)

Rename a data source.

Parameters:
  • name (str) – Name of the data source.

  • newv (str) – New name for the data source.

Notes

The results dictionary contains the following keys:

success

True or False, whether the source was rename succesfully.

mesg

String containing error details or empty if successful.

Returns:

Results dictionary.

Return type:

dict

async status(name, query_id=None, opts=None)

Retrieve the status for a query or for all queries in the given data source.

NOTE: This method is not implemented for all connectors.

Parameters:
  • name (str) – Name of the data source to retrieve status from.

  • query_id (str or None) – Query id to get the status for.

  • opts (dict) – Options to provide when retrieving statuses from the data source.

Yields:

tuple – Message tuple of (type, data, info)