Skip to content

Latest commit

 

History

History
77 lines (58 loc) · 1.37 KB

PROTOCOL.md

File metadata and controls

77 lines (58 loc) · 1.37 KB

Celestial Protocol

The Celestial protocol is a simple REST API. The snippets below are in CSON for readability. Response strings are the equivalent types.

GET /vessels

timestamp: "Time" # Last edit in UTC
vessels:   "Array(Vessel)" # Array of Vessels - each equivalent to output of 'GET /vessels/:id' on that vessel

GET /vessels/:id

name:     "String"
attr:     "String"
note:     "String"
parent:   "Int64"
owner:    "Int64"
triggers: "Hash(String, String)"

POST /vessels/:id

name:     "String"
attr:     "String?"
note:     "String?"
parent:   "Int64"
owner:    "Int64?"
triggers: "Hash(String, String)?"

-->

type:      "success",
id:        "Int32"
timestamp: "Time"

PATCH /vessels/:id

name:     "String?"
attr:     "String?"
note:     "String?"
parent:   "Int64?"
owner:    "Int64?"
triggers: "Hash(String, String)?"

-->

type:      "success",
timestamp: "Time"

DELETE /vessels/:id

type:      "success",
timestamp: "Time"

WebSockets

A client may also open a websocket to the server. The server will periodically send notifications to listening clients, following this format:

type: "notify"
change:
  "String": "Int64"

The contents of the change hash are the operation performed on the vessel, and the ID of that vessel.