JetStream

class jetstream.api.JetStream(socket_interface=<class 'jetstream.socketinterface.SocketInterface'>, logging_interface=<class 'jetstream.logginginterface.LoggingInterface'>, sync_interface=<class 'jetstream.syncinterface.SyncInterface'>)

The JetStream class serves as an API interface factory. Use this to instantiate an interface that may be used to issue commands to a JetStream server.

Note that this factory, on its own, does not connect to a JetStream server, nor issue commands. You use the returned interfaces to connect and issue commands.

Example

jetstream = JetStream()

# Instantiate an API interface.
api = jetstream.api(serverAddress, serverPort)

# Connect
with api:
    # Issue commands.
    api.server.getServerInfo()
    api.send.createManifest(...)

Method Summary

api Get an API interface for a JetStream server.
api_listen Get an API interface that listens for connections from JetStream servers.

Method Documentation

JetStream.api(serverAddress='localhost', serverPort=8886, timeoutSeconds=10, certificatePath=NULL, sslCertificateRequirements=0)

Get an API interface for a JetStream server.

This does not connect to the server. Use the returned interface to connect first, then issue commands.

Note

Timeout functionality is currently unimplemented.

Parameters:
  • serverAddress (str) – The address (host name) on which the JetStream server is running.
  • serverPort (int) – The control port on which the server is listening.
  • timeoutSeconds (float) – A timeout, in seconds, used to terminate blocking commands. If unassigned, blocking commands will never unblock.
  • certificatePath (str) – Path to an SSL certificate.
  • sslCertificateRequirements (int) – Level of strictness when checking SSL certificates. Can be one of: ssl.CERT_NONE (0), ssl.CERT_OPTIONAL (1), or ssl.CERT_REQUIRED (2).
Returns:

An API interface.

Return type:

APIInterface

JetStream.api_listen(listenAddress='', listenPort=8886, timeoutSeconds=10, certificatePath=NULL, sslCertificateRequirements=0)

Get an API interface that listens for connections from JetStream servers.

This does not listen for connections. Use the returned interface to start listening first, then issue commands

See api() for details.