Behaviors
A behavior is one thing that osapi manages on a host, for example kernel parameters. You define it one time, in Go. osapi builds its routes, commands, permissions, spec, docs and tests from that definition. Behaviors in the architecture tells how. It also tells about behaviors that only other behaviors use, and about behaviors that use other behaviors.
Every behavior in this build
Behaviors (18)
| NAME | GROUP | METHODS | DESCRIPTION | INTERNAL |
|---|---|---|---|---|
| disk | get | Get the disk usage of target hosts | ||
| hostname | get, update | Get or set the hostname of target hosts | ||
| load | get | Get the load averages of target hosts | ||
| managedfile | get, update, delete | Files osapi writes on a host and keeps a record of | yes | |
| memory | get | Get the memory usage of target hosts | ||
| netplan | update, delete, get | The netplan files osapi writes, validated and applied | yes | |
| object | get | The objects of the object store of the fleet, such as a file uploaded with osapi client file upload | yes | |
| os | get | Get the operating system of target hosts | ||
| package | list, get, create, delete | The packages installed on the host | ||
| service | list, get, create, update, delete, start, stop, restart, enable, disable | The systemd services of the host | ||
| status | get | The status summary of a node | ||
| sysctl | list, get, create, update, delete | Kernel parameters, written to sysctl.d files and applied | ||
| timezone | get, update | The timezone of the host | ||
| updatepackages | list, update | The updates the package index has for the host | ||
| uptime | get | Get the uptime of target hosts | ||
| dns | network | get, update, delete | The DNS resolvers of each interface of the host | |
| interface | network | list, get, create, update, delete | The network interfaces of the host | |
| route | network | list, get, create, update, delete | The routes of the host |
osapi does not serve an internal behavior. Other behaviors require it and call it on the same host. Uses and Used by show those chains.
Disk
Get the disk usage of target hosts. osapi behavior get --name disk and
DNS
The DNS resolvers of each interface of the host. osapi behavior get --name dns
Hostname
Get or set the hostname of target hosts. osapi behavior get --name hostname
Interface
The network interfaces of the host. osapi behavior get --name interface and
Load
Get the load averages of target hosts. osapi behavior get --name load and
Managedfile
Files osapi writes on a host and keeps a record of.
Memory
Get the memory usage of target hosts. osapi behavior get --name memory and
Netplan
The netplan files osapi writes, validated and applied.
Object
The objects of the object store of the fleet, such as a file uploaded with osapi
OS
Get the operating system of target hosts. osapi behavior get --name os and
Package
The packages installed on the host. osapi behavior get --name package and
Route
The routes of the host. osapi behavior get --name route and
Service
The systemd services of the host. osapi behavior get --name service and
Status
The status summary of a node. osapi behavior get --name status and
Sysctl
Kernel parameters, written to sysctl.d files and applied.
Timezone
The timezone of the host. osapi behavior get --name timezone and
Updatepackages
The updates the package index has for the host.
Uptime
Get the uptime of target hosts. osapi behavior get --name uptime and
See what a binary has
The binary describes its own behaviors. Thus the answer is always correct for the build that you run:
osapi behavior list # every behavior, internal ones marked
osapi behavior get --name sysctl # surfaces, platforms, chains, methods, settings
osapi behavior method get --name sysctl --method create # one method's input and output
osapi behavior validate # the rules every definition must meet
behavior get --json prints the input and the output of each method as JSON
Schema. It also prints the route, the command, the permission, the examples and
the refusals. An agent reads this before it calls a method.
Where they are defined
Each behavior is a directory under
internal/behavior/,
and internal/behaviors/sysctl is the reference.
Building a behavior covers the layout, the
tags and what is generated.