Skip to main content

Catalog

c.Catalog calls the API's Catalog group. The behaviors, the permissions and the roles that the controller serves, for the UI.

Methods​

MethodReturnsPermissionDescription
Get(ctx)*Response[CatalogResponse]catalog:readGet 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​

FieldTypeDescription
LabelstringThe label of the area.
NamestringThe name of the area.

CatalogBehavior​

FieldTypeDescription
AreastringThe area of the behavior, or empty for an internal behavior.
ChainstringThe chain of the behavior, as osapi dsl chain list prints it.
DocstringWhat the behavior manages.
InternalboolOnly other behaviors call it: it has no route.
Methods[]CatalogMethodThe methods of the behavior.
NamestringThe name of the behavior.
ParentstringThe behavior that the behavior is under, such as user for sshkey.
Platforms[]stringThe platforms of the providers of the behavior.
TitlestringThe title of the behavior.
UsedBy[]stringThe behaviors that call the behavior.
Uses[]stringThe behaviors that the behavior calls.

CatalogCall​

FieldTypeDescription
BehaviorstringThe behavior that is called.
Calls[]CatalogCallThe calls that the call makes.
MethodstringThe method that is called.

CatalogColumn​

FieldTypeDescription
Columns[]CatalogColumnThe columns of an object, or of a list of objects.
DocstringWhat the field is.
KindColumnKindColumnKind is what a field of an answer holds.
LabelstringThe label of the field.
NamestringThe json name of the field.
RenderstringThe render tag of the field, such as bytes.

CatalogControllerMethod​

FieldTypeDescription
DocstringWhat the method does, in one line.
GroupstringThe endpoint group.
MethodstringThe method.
OperationOperationIDAn operationId of an operation that needs a permission.
PermissionPermissionA permission that osapi knows, as resource:verb.

CatalogExample​

FieldTypeDescription
DocstringWhat the example does.
InputanyThe input of the example.
OutputanyThe output of the example.

CatalogField​

FieldTypeDescription
DocstringWhat the field is.
InFieldInFieldIn is where a field of a request goes.
KindFieldKindFieldKind is how a form takes the value of a field.
NamestringThe json name of the field.
Options[]stringThe values that the field takes: those of its type with enum, or of its oneof rule.
RequiredboolThe request needs the field.
SecretboolThe field is a secret.

CatalogMethod​

FieldTypeDescription
Calls[]CatalogCallThe calls that the examples of the method make to other behaviors.
Columns[]CatalogColumnThe fields of the rows that the method answers, as the CLI's output reads them.
DisruptionstringWhat the method interrupts.
DisruptiveboolThe method can interrupt a host, such as a reboot.
DocstringWhat the method does.
Examples[]CatalogExampleThe examples of the method.
Fields[]CatalogFieldThe fields of the input.
HttpMethodstringThe HTTP method of the route. An internal behavior has no route.
InputstringThe input type and its fields, a required one marked *.
KindMethodKindWhat a method does to a host, by the verb of its permission: read, write or action.
LongstringThe rest of what the method does.
NamestringThe name of the method.
OutputstringThe output type and its fields.
PathstringThe path of the route.
PermissionPermissionA permission that osapi knows, as resource:verb.
Platforms[]stringThe platforms that the method runs on: those that its On limits it to, else each platform of the behavior.
RunsOn[]stringThe host platforms that the method runs on, as the agent decides, and * for a Linux host whose platform gohai has no family for.

CatalogOperation​

FieldTypeDescription
IDOperationIDAn operationId of an operation that needs a permission.
PermissionPermissionA permission that osapi knows, as resource:verb.

CatalogResponse​

FieldTypeDescription
Areas[]CatalogAreaEach area, in order, with its label.
Behaviors[]CatalogBehaviorEach behavior that the API serves, and each internal behavior, in the order of the registry.
Controller[]CatalogControllerMethodEach method of an endpoint group of the Object Store area: a call of the controller that takes no target.
CountTonesmap[string]stringThe tone of a count above zero, by what it counts: ok, warn or err.
HostFamilies[]stringThe host platforms that gohai names. A method's runs_on has * for any other Linux.
Operations[]CatalogOperationThe permission of each operation that needs one, in the order of the operationIds.
Outcomes[]stringThe outcomes of a host, from the best to the worst, as the CLI's summary orders them.
Permissions[]PermissionEach permission that osapi knows.
RenderTags[]stringThe render tags of an output field, as the CLI reads them. short= takes a number, such as short=12.
Roles[]CatalogRoleThe built-in roles, in order, with the permissions of each.
StatusTonesmap[string]stringThe tone of each status word, as the CLI colors it: ok, warn or err.
Targets[]CatalogTargetThe targets that name no host: each agent, or any one agent.

CatalogRole​

FieldTypeDescription
DescriptionstringWho the role is for.
NamestringThe name of the role, as a token names it.
Permissions[]PermissionThe permissions of the role.

CatalogTarget​

FieldTypeDescription
DocstringWhat it sends the job to.
LabelstringIts label.
ValuestringThe 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.