Source

pycom / docs / proto.rst

Full commit

Protocol Specification

Low-level protocol

PyCOM services talk to each other via 0MQ multipart messages via REP-REQ pair of sockets:

  1. Command (only CALL is supported now, response will contain either OK on success or FAIL on fatal protocol or server error)
  2. JSON content in UTF-8.
  3. (optional, not implemented yet) binary attachment

Top-level request object contains the following properties:

Top-level response object contains the following properties:

Standard services remote API

NameServer

Remote interface for registering and locating interfaces and services.

Authenticator

Remote interface for authenticating users. There is no such service in PyCOM distribution. Why? Well, because the exact authentication procedure may differ broadly. You have to write an appropriate service yourself. :class:`pycom.apps.demos.static_auth.StaticAuth` can give you a good start.

BLOB Storage

Large binary objects storage. The main concept is bucket - set of files with a unique identifier. Can be roughly seen as a directory on a file system, but with some additional features like:

  • Reference counting for buckets
  • Easy cloning, compressing and deletion of a bucket
  • Web-interface for reading files in a bucket

Represents a single bucket. This interface is stateful: you open a bucket and work with it. For all methods except create and open :exc:`pycom.BadRequest` is raised if bucket was not opened previously.

Known Extensions

Authentication

The only extension present is a request extension: