Units
systemd units of the host.
| Operation | Kind | HTTP |
|---|---|---|
units.list | call | GET /v1/units |
units.get | call | GET /v1/units/{unit} |
units.act | call | POST /v1/units/{unit}/{verb} |
units.list
The units and their state.
Host level only. Through rookery serve it needs the role view.
Result
Unit[]
{
"id": 1,
"op": "units.list"
}{
"id": 1,
"result": [
{
"active": "text",
"description": "text",
"load": "text",
"sub": "text",
"unit": "rookeryd.service"
}
]
}units.get
One unit's properties, as systemctl show gives them.
Host level only. Through rookery serve it needs the role view.
Arguments
| Name | Where | Required | Description |
|---|---|---|---|
unit | path | yes | A unit's name, such as ssh.service. Only the configured units. |
Result
map of string
{
"id": 1,
"op": "units.get",
"args": {
"unit": "rookeryd.service"
}
}{
"id": 1,
"result": {}
}units.act
Start, stop, restart, reload, enable or disable a unit.
Host level only. Through rookery serve it needs the role operate.
Arguments
| Name | Where | Required | Description |
|---|---|---|---|
unit | path | yes | A unit's name, such as ssh.service. Only the configured units. |
verb | path | yes | start, stop, restart, reload, enable or disable. |
Result
| Field | Type | Description |
|---|---|---|
ok | boolean |
{
"id": 1,
"op": "units.act",
"args": {
"unit": "rookeryd.service",
"verb": "restart"
}
}{
"id": 1,
"result": {
"ok": true
}
}Types
The named types used on this page.
Unit
| Field | Type | Description |
|---|---|---|
active | string | |
description | string | |
load | string | |
sub | string | |
unit | string |