Get
Describe one endpoint group: its routes, permissions and operation IDs.
osapi dsl endpoint openapi get prints the group's part of the OpenAPI spec.
osapi dsl endpoint get [flags]
Examples
osapi dsl endpoint get --name agent
osapi dsl endpoint get --name agent --json
Result
The command prints:
$ osapi dsl endpoint get --name agent Endpoint group: Name: agent Description: Manage the agents in the fleet: discovery, drain and PKI enrollment Area: fleet Methods (2): NAME VERB PATH PERMISSION OPERATION ID list GET /api/agent agent:read GetAgents drain POST /api/agent/{hostname}/drain agent:write DrainAgent Types (2): NAME INPUT OUTPUT list ListInput ListAgentsResponse { items, total_items } drain DrainInput { hostname* }
With --json, the command prints:
{
"name": "agent",
"doc": "Manage the agents in the fleet: discovery, drain and PKI enrollment",
"area": "fleet",
"methods": [
{
"name": "list",
"verb": "GET",
"path": "/api/agent",
"permission": "agent:read",
"operation_id": "GetAgents"
},
{
"name": "drain",
"verb": "POST",
"path": "/api/agent/{hostname}/drain",
"permission": "agent:write",
"operation_id": "DrainAgent"
}
],
"types": [
{
"name": "list",
"input": "ListInput",
"output": "ListAgentsResponse { items, total_items }"
},
{
"name": "drain",
"input": "DrainInput { hostname* }",
"output": ""
}
]
}
Flags
| Flag | Description | Default |
|---|---|---|
--name | The endpoint group, such as agent (required) |
Global flags
| Flag | Description | Default |
|---|---|---|
-d, --debug | Enable or disable debug mode | |
-j, --json | Enable JSON output | |
-f, --osapi-file | Path 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.