Catalog
c.Catalog calls the API's Catalog group. The behaviors, the permissions and
the roles that the controller serves, for the UI.
Methods
| Method | Returns | Permission | Description |
|---|---|---|---|
Get(ctx) | *Response[CatalogResponse] | catalog:read | Get the catalog. |
Get
func (s *CatalogService) Get(
ctx context.Context,
) (*Response[CatalogResponse], error)
Get the catalog.
Returns each behavior with its methods, the areas, the permissions, the built-in roles, the permission of each operation, the tones of the statuses and the counts, and the host families. The UI reads it after sign-in. Each built-in role has catalog:read.
It sends GET /api/catalog, and needs the permission catalog:read.
The examples of the method's definition:
Get the catalog, go run catalog.go get:
resp, err := c.Catalog.Get(ctx)
Types
The fields of each type are the properties of its schema in the API's spec.
CatalogArea
| Field | Type | Description |
|---|---|---|
Label | string | The label of the area. |
Name | string | The name of the area. |
CatalogBehavior
| Field | Type | Description |
|---|---|---|
Area | string | The area of the behavior, or empty for an internal behavior. |
Chain | string | The chain of the behavior, as osapi dsl chain list prints it. |
Doc | string | What the behavior manages. |
Internal | bool | Only other behaviors call it: it has no route. |
Methods | []CatalogMethod | The methods of the behavior. |
Name | string | The name of the behavior. |
Parent | string | The behavior that the behavior is under, such as user for sshkey. |
Platforms | []string | The platforms of the providers of the behavior. |
Title | string | The title of the behavior. |
UsedBy | []string | The behaviors that call the behavior. |
Uses | []string | The behaviors that the behavior calls. |
CatalogCall
| Field | Type | Description |
|---|---|---|
Behavior | string | The behavior that is called. |
Calls | []CatalogCall | The calls that the call makes. |
Method | string | The method that is called. |
CatalogColumn
| Field | Type | Description |
|---|---|---|
Columns | []CatalogColumn | The columns of an object, or of a list of objects. |
Doc | string | What the field is. |
Kind | ColumnKind | ColumnKind is what a field of an answer holds. |
Label | string | The label of the field. |
Name | string | The json name of the field. |
Render | string | The render tag of the field, such as bytes. |
CatalogControllerMethod
| Field | Type | Description |
|---|---|---|
Doc | string | What the method does, in one line. |
Group | string | The endpoint group. |
Method | string | The method. |
Operation | OperationID | An operationId of an operation that needs a permission. |
Permission | Permission | A permission that osapi knows, as resource:verb. |
CatalogExample
| Field | Type | Description |
|---|---|---|
Doc | string | What the example does. |
Input | any | The input of the example. |
Output | any | The output of the example. |
CatalogField
| Field | Type | Description |
|---|---|---|
Doc | string | What the field is. |
In | FieldIn | FieldIn is where a field of a request goes. |
Kind | FieldKind | FieldKind is how a form takes the value of a field. |
Name | string | The json name of the field. |
Options | []string | The values that the field takes: those of its type with enum, or of its oneof rule. |
Required | bool | The request needs the field. |
Secret | bool | The field is a secret. |
CatalogMethod
| Field | Type | Description |
|---|---|---|
Calls | []CatalogCall | The calls that the examples of the method make to other behaviors. |
Columns | []CatalogColumn | The fields of the rows that the method answers, as the CLI's output reads them. |
Disruption | string | What the method interrupts. |
Disruptive | bool | The method can interrupt a host, such as a reboot. |
Doc | string | What the method does. |
Examples | []CatalogExample | The examples of the method. |
Fields | []CatalogField | The fields of the input. |
HttpMethod | string | The HTTP method of the route. An internal behavior has no route. |
Input | string | The input type and its fields, a required one marked *. |
Kind | MethodKind | What a method does to a host, by the verb of its permission: read, write or action. |
Long | string | The rest of what the method does. |
Name | string | The name of the method. |
Output | string | The output type and its fields. |
Path | string | The path of the route. |
Permission | Permission | A permission that osapi knows, as resource:verb. |
Platforms | []string | The platforms that the method runs on: those that its On limits it to, else each platform of the behavior. |
RunsOn | []string | The host platforms that the method runs on, as the agent decides, and * for a Linux host whose platform gohai has no family for. |
CatalogOperation
| Field | Type | Description |
|---|---|---|
ID | OperationID | An operationId of an operation that needs a permission. |
Permission | Permission | A permission that osapi knows, as resource:verb. |
CatalogResponse
| Field | Type | Description |
|---|---|---|
Areas | []CatalogArea | Each area, in order, with its label. |
Behaviors | []CatalogBehavior | Each behavior that the API serves, and each internal behavior, in the order of the registry. |
Controller | []CatalogControllerMethod | Each method of an endpoint group of the Object Store area: a call of the controller that takes no target. |
CountTones | map[string]string | The tone of a count above zero, by what it counts: ok, warn or err. |
HostFamilies | []string | The host platforms that gohai names. A method's runs_on has * for any other Linux. |
Operations | []CatalogOperation | The permission of each operation that needs one, in the order of the operationIds. |
Outcomes | []string | The outcomes of a host, from the best to the worst, as the CLI's summary orders them. |
Permissions | []Permission | Each permission that osapi knows. |
RenderTags | []string | The render tags of an output field, as the CLI reads them. short= takes a number, such as short=12. |
Roles | []CatalogRole | The built-in roles, in order, with the permissions of each. |
StatusTones | map[string]string | The tone of each status word, as the CLI colors it: ok, warn or err. |
Targets | []CatalogTarget | The targets that name no host: each agent, or any one agent. |
CatalogRole
| Field | Type | Description |
|---|---|---|
Description | string | Who the role is for. |
Name | string | The name of the role, as a token names it. |
Permissions | []Permission | The permissions of the role. |
CatalogTarget
| Field | Type | Description |
|---|---|---|
Doc | string | What it sends the job to. |
Label | string | Its label. |
Value | string | The target, as a method takes it. |
ColumnKind
ColumnKind is what a field of an answer holds.
A string, one of value, values, object, list.
FieldIn
FieldIn is where a field of a request goes.
A string, one of path, query, body.
FieldKind
FieldKind is how a form takes the value of a field.
A string, one of string, number, bool, list, object.
MethodKind
What a method does to a host, by the verb of its permission: read, write or action.
A string, one of read, write, action.
OperationID
An operationId of an operation that needs a permission.
A string, one of AdmitMachine, DeleteFileByName, DeleteJobByID,
DeleteMachine, DeleteNodeCertificate, DeleteNodeDns, DeleteNodeDocker,
DeleteNodeFile, DeleteNodeGroup, DeleteNodeImage, DeleteNodeInterface,
DeleteNodeInterfaceRoute, DeleteNodeNtp, DeleteNodePackage,
DeleteNodeSchedule, DeleteNodeService, DeleteNodeSysctl, DeleteNodeUser,
DeleteNodeUserSshkey, DeleteSecret, DrainAgent, GetAdmission,
GetAdmissions, GetAgentConfig, GetAgentDetails, GetAgentFacts,
GetAgents, GetAuditExport, GetAuditLogByID, GetAuditLogs, GetCatalog,
GetFileByName, GetFileStale, GetFiles, GetHealthStatus, GetJobByID,
GetJobs, GetNodeCertificate, GetNodeCertificateByKey, GetNodeDisk,
GetNodeDnsByKey, GetNodeDocker, GetNodeDockerByKey, GetNodeFile,
GetNodeGroup, GetNodeGroupByKey, GetNodeHostname, GetNodeImage,
GetNodeInterface, GetNodeInterfaceByKey, GetNodeInterfaceRoute,
GetNodeLoad, GetNodeLog, GetNodeLogSource, GetNodeMemory, GetNodeNtp,
GetNodeOs, GetNodePackage, GetNodePackageByKey, GetNodePackageUpdates,
GetNodeProcess, GetNodeProcessByKey, GetNodeSchedule,
GetNodeScheduleByKey, GetNodeService, GetNodeServiceByKey,
GetNodeStatus, GetNodeSysctl, GetNodeSysctlByKey, GetNodeTimezone,
GetNodeUptime, GetNodeUser, GetNodeUserByKey, GetNodeUserSshkey,
GetSecret, GetSecretValue, GetSecretVaults, GetSecrets, GetTrace,
PostFile, PostNodeCertificate, PostNodeCommandExec,
PostNodeCommandShell, PostNodeConnectivityPing, PostNodeDocker,
PostNodeDockerExec, PostNodeDockerStart, PostNodeDockerStop,
PostNodeGroup, PostNodeImagePull, PostNodeInterface,
PostNodeInterfaceRoute, PostNodeNtp, PostNodePackage,
PostNodePowerReboot, PostNodePowerShutdown, PostNodeProcessSignal,
PostNodeSchedule, PostNodeService, PostNodeServiceDisable,
PostNodeServiceEnable, PostNodeServiceRestart, PostNodeServiceStart,
PostNodeServiceStop, PostNodeSysctl, PostNodeUser, PostNodeUserSshkey,
PutAgentConfig, PutFileByName, PutNodeCertificate, PutNodeDns,
PutNodeFile, PutNodeGroup, PutNodeHostname, PutNodeInterface,
PutNodeInterfaceRoute, PutNodeNtp, PutNodePackageUpdates,
PutNodeSchedule, PutNodeService, PutNodeSysctl, PutNodeTimezone,
PutNodeUser, PutNodeUserPassword, PutSecret, RejectMachine,
RetryJobByID, RevokeMachine, UndrainAgent.
Permission
A permission that osapi knows, as resource:verb.
A string, one of health:read, trace:read, secret:use, secret:reveal,
certificate:read, certificate:write, command:execute, command:shell,
connectivity:execute, disk:read, dns:read, dns:write, docker:read,
docker:write, docker:execute, docker:exec, file:read, file:write,
group:read, group:write, hostname:read, hostname:write, image:read,
image:execute, image:write, interface:read, interface:write,
load:read, log:read, memory:read, ntp:read, ntp:write, os:read,
package:read, package:write, power:execute, process:read,
process:execute, schedule:read, schedule:write, service:read,
service:write, service:execute, status:read, sysctl:read,
sysctl:write, timezone:read, timezone:write, uptime:read, user:read,
user:write, admission:read, admission:write, agent:read, agent:write,
audit:read, catalog:read, job:read, job:write, secret:read,
secret:write.
Example
examples/sdk/client/catalog.go
runs each example of this page. With no argument, it lists them.