Next: /alive, Previous: /conf, Up: Control API [Contents][Index]
A request sent to this URI selects one or more components and applies operation defined by the request type to all of them.
Components are selected using a query in the form of JSON object (a selector). Valid selectors are:
Matches nothing.
Matches all components.
Matches component with the given tag (see tag).
Matches all components.
Matches all commands.
Matches all components with the given mode. See component mode.
Matches all active components.
Matches all components with the given status (one of ‘stopped’, ‘running’, ‘listener’, ‘sleeping’, ‘stopping’, ‘finished’). See component status for a discussion of these values.
Negates condition, which is any valid selector.
Returns the result of logical conjunction on the array of selectors.
Returns the result of logical disjunction on the array of selectors.
For example, the following selector matches all components that are in ‘running’ state, excepting components of ‘inetd’ mode:
{ "op": "and", "arg": [ { "op": "type", "arg": "component" }, { "op": "not", "arg": { "op": "mode", "arg": "inetd" } ] }
The following requests are supported:
This request returns information about components matched by selector (see below for the ‘/programs/tag variant’. The response is a JSON array of descriptions. If no component matches the selector, empty array is returned. Each description is a JSON object with the following attributes:
Type of the described entity: ‘component’ for an instance of a configured component, and ‘command’ for a command run as a part of exit action (see Exit Actions), including mailer invocations (see Notification).
Mode of the entity. See component mode.
Entity status. Possible values are:
finished
A ‘once’ or ‘startup’ component has finished.
listener
Component is an inetd listener.
running
Component is running.
sleeping
Component has been put to sleep because of excessive number of failures (see respawn).
stopped
Component is stopped.
stopping
Component is being stopped (a SIGTERM
was sent).
Whether this component is active. By default, all components are active, unless marked with a ‘disable’ flag (see flags) or administratively stopped.
PID of the running process.
(for ‘inetd’ components) URL of the socket the component is listening on.
(for ‘tcpmux’ components) TCPMUX service name. See TCPMUX.
(for ‘tcpmux’ components) Tag of master TCPMUX component. See TCPMUX.
For inittab components, the string of runlevels this component is configured to run in. See Init Process.
If component is in the ‘sleeping’ state, this attribute gives the number of seconds after which an attempt will be made to restart it.
Component command line split into words.
Component command.
Stop components matched by the selector. On success returns:
{ "status":"OK" }
On failure, returns
{ "status":"ER", "message": text }
where text is a textual human-readable description of the failure.
Start components matched by selector.
Restart components. The selector is supplied in the request content.
Wherever a selector is passed via query parameters, a simplified form with component tag passed as query path is also allowed. For example:
GET /programs/tag
is a shortcut for:
{ "op":"and", "arg":[ {"op":"type", "arg":"component"}, {"op":"component", "arg":tag } ] }
Next: /alive, Previous: /conf, Up: Control API [Contents][Index]