Certain requests and responses should be implemented by all BAPS3
servers understanding the Internal API, and are not associated with
any FEATURES
flag. These are enumerated here.
dump
— dump snapshot of statedump
dump
asks the service to relay as much of its current, variable
state as possible. This should consist of the initial responses,
less OHAI
and FEATURES
if they cannot change over the service’s
lifetime. It may omit other non-changing parts of the initial
responses.
quit
— quit server stackquit
quit
is a request to a server, and all servers downstream from
it, to close gracefully.
FAIL
— server failureFAIL <MESSAGE>
FAIL
must be sent to acknowledge a request that has failed.
Said request must be provided, in a form identical to the original
request (up to encoding and escaping differences), as the third and
later words of the FAIL
response.
The second word of the FAIL
response is a human-readable error
message. Future revisions of the spec may define a structure for
this error message.
OK
— command receivedOK <COMMAND> [ARGS…]
OK
must be sent to acknowledge a request that has successfully
terminated. Said request must be provided, in a form identical
to the original request (up to encoding and escaping differences),
as the second and later words of the OK
response.
OHAI
— server welcomeOHAI <IDENTIFIER>
OHAI
must be sent as the first initial response given to any
connecting upstream, and identifies the server (as well as the BAPS3
internal protocol).
Any client connecting to a BAPS3 Internal API-compliant server may
take the absence of an initial OHAI
as grounds for rejecting the
server. This is not an absolute requirement.
STATE
— state updateSTATE <STATE-NAME>
STATE
should be sent when:
The list of available states always contains the following:
The list of available states is added to by certain features. For
example, the PlayStop
feature adds the Playing
and Stopped
states, and mandates that the initial state is Stopped
unless any
other feature specifically overrides that mandate. Servers should
not use Ready
if another feature state better fits its present
situation.
WHAT
— bad commandWHAT <MESSAGE> <COMMAND> [ARGS…]
WHAT
must be sent to acknowledge an invalid request: one that
does not fit the syntax of its declared command, or one with an
unknown command. Said request must be provided, in a form identical
to the original request (up to encoding and escaping differences),
as the third and later words of the WHAT
response.
The second word of the WHAT
response is a human-readable error
message. Future revisions of the spec may define a structure for
this error message.
/
The root resource. Every resource is a descendant of this resource.
Behaves as a simple composite resource for all actions.
/control
The control resource, which contains both read-only information about the service, and writable flags that affect the service’s running and configuration.
Behaves as a simple composite resource for all actions.
/control/features
Contains a list of strings representing the implemented features on
the queried service (those returned by a FEATURES
Internal API
response from this service).
All actions apart from GET
are forbidden.
GET
GET
responses must return a list of strings that correspond
exactly to the names of the features implemented by the queried
service. There is no defined ordering on the strings.
If a service provides FEATURES PlayStop FileLoad End
, the GET
response value for /control/features
may be ["PlayStop",
"FileLoad", "End"]
(or any permutation thereof).
/control/serverid
Contains the server identifier that would be returned by the OHAI
Internal API response.
All actions apart from GET
are forbidden.
If a service identifies as OHAI listd-0.3.0/playd-0.3.0
, then the
GET
response value for /control/serverid
shall be
"listd-0.3.0/playd-0.3.0"
.
/control/state
The current state of this service.
GET
GET
requests should return a Boolean: false
if the service is
known to be shutting down, and true
otherwise. Generally, this will
be the latter, as non-running services will likely close their
External API endpoints upon starting to exit.
PUT
Attempts to set the state to the given state. The state payload must be a string, and should be interpreted in a case-insensitive manner.
Any unknown states, or malformed payloads, should result in a malformed value error.
access The semantics of each state is specified alongside the documentation for the feature introducing that state. The semantics of the two core states are as follows:
Ready
Services should reject an attempt to set the state to Ready
.
Quitting
Services should interpret this as equivalent to a QUIT
Internal
API request.
DELETE
Behaves as a PUT
with the payload value Quitting
.