Skip to main content

Get

Print the group's part of the OpenAPI spec, as YAML.

It prints the spec as the definition makes it. Read it beside the hand-written spec of the group to compare the prose. TestEndpointParity compares the rest.

osapi dsl endpoint openapi get [flags]

Examples​

osapi dsl endpoint openapi get --name agent

Result​

The command prints:

$ osapi dsl endpoint openapi get --name agent
paths:
  /api/agent/{hostname}/drain:
    post:
      operationId: DrainAgent
      summary: Drain an agent
      tags:
        - agent_operations

With --json, the command prints:

{
"name": "agent",
"yaml": "paths:\n /api/agent/{hostname}/drain:\n post:\n operationId: DrainAgent\n summary: Drain an agent\n tags:\n - agent_operations\n"
}

Flags​

FlagDescriptionDefault
--nameThe endpoint group, such as agent (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.