Skip to main content

Get

Describe one group: its commands, and the flags and refusals of a local group.

--name is the command path of the group, such as controller token or agent: a local group, or the group of an endpoint or a behavior. A command of a local group also has its flags, each with the validate tag of its field, and the inputs that its .Fails declares, which TestRefusals runs.

osapi dsl command get [flags]

Examples​

osapi dsl command get --name "controller token"
osapi dsl command get --name agent --json

Result​

The command prints:

$ osapi dsl command get --name "controller token"
Group:
  Name:         controller token
  Description:  Generate and validate API tokens

osapi controller token generate:
  Method:       generate
  Description:  Generate a new token
  Refuses:      no roles, no subject

Flags (2):
  FLAG       SHORT  TYPE      VALIDATE  HELP
  --roles    r      []string  required  Roles for the token: built-in, or a custom role of the config
  --subject  u      string    required  Subject for the token (e.g., user ID or unique identifier)

osapi controller role list:
  Method:       roles list
  Description:  List the roles and the permissions each grants

With --json, the command prints:

{
"name": "controller token",
"doc": "Generate and validate API tokens",
"commands": [
{
"command": "osapi controller token generate",
"method": "generate",
"short": "Generate a new token",
"fails": ["no roles", "no subject"],
"flags": [
{
"flag": "--roles",
"short": "r",
"type": "[]string",
"validate": "required",
"doc": "Roles for the token: built-in, or a custom role of the config"
},
{
"flag": "--subject",
"short": "u",
"type": "string",
"validate": "required",
"doc": "Subject for the token (e.g., user ID or unique identifier)"
}
]
},
{
"command": "osapi controller role list",
"method": "roles list",
"short": "List the roles and the permissions each grants"
}
]
}

Flags​

FlagDescriptionDefault
--nameThe command path of the group, such as controller token or 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.