Skip to main content

Get

Print a served behavior's part of the OpenAPI spec, as YAML.

It prints the spec as the definition makes it: the part that go generate writes to the behavior's gen/api.yaml, and puts in the full spec of the API. An internal behavior serves no route, so it has none.

osapi dsl behavior openapi get [flags]

Examples​

osapi dsl behavior openapi get --name sysctl

Result​

The command prints:

$ osapi dsl behavior openapi get --name sysctl
paths:
  /api/node/{hostname}/sysctl/{key}:
    put:
      operationId: PutNodeSysctl
      summary: Set a kernel parameter, manage it, and apply it
      tags:
        - sysctl_operations

With --json, the command prints:

{
"name": "sysctl",
"yaml": "paths:\n /api/node/{hostname}/sysctl/{key}:\n put:\n operationId: PutNodeSysctl\n summary: Set a kernel parameter, manage it, and apply it\n tags:\n - sysctl_operations\n"
}

Flags​

FlagDescriptionDefault
--nameThe behavior, from osapi dsl behavior list (required)

Global flags​

FlagDescriptionDefault
-d, --debugEnable or disable debug mode
-j, --jsonEnable JSON output
-f, --osapi-filePath to config file; without one at the default path, osapi runs on the defaults/etc/osapi/osapi.yaml

Output tells how the result is printed, and what --json gives.