Get
Show one method of a local group: its command, flags, output, examples and refusals.
Each flag has the validate tag of its field. --json has the JSON Schema of the
output. osapi dsl behavior method get and osapi dsl endpoint method get show
a method of a behavior and of an endpoint group the same way.
osapi dsl command method get [flags]
Examples
osapi dsl command method get --name "controller token" --method generate
osapi dsl command method get --name "controller token" --method generate --json
Result
The command prints:
$ osapi dsl command method get --name "controller token" --method generate Method: Command: osapi controller token generate Method: generate Description: Generate a new token Process: no Output type: GenerateOutput 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) Output (3): FIELD TYPE token string subject string roles array Examples (1): FLAGS --subject user123 --roles=read
With --json, the command prints:
{
"command": "osapi controller token generate",
"method": "generate",
"doc": "Generate a new token",
"process": false,
"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)"
}
],
"output_type": "GenerateOutput",
"results": [
{
"field": "token",
"type": "string",
"description": ""
},
{
"field": "subject",
"type": "string",
"description": ""
},
{
"field": "roles",
"type": "array",
"description": ""
}
],
"examples": [
{
"flags": "--subject user123 --roles=read",
"doc": ""
}
],
"refuses": ["no roles", "no subject"]
}
Flags
| Flag | Description | Default |
|---|---|---|
--method | The method, such as list or roles get, from osapi dsl command get (required) | |
--name | The command path of the local group, such as controller token (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.