Get
Show a type with its values, or a service with its methods.
A name of a type, such as ContentType, shows its doc and its values. A name of a service, such as Hostname, shows each method with the permission that it needs, its route, its input and its result.
osapi sdk get [flags]
Examples
osapi sdk get --name Hostname
osapi sdk get --name ContentType --json
Result
The command prints:
$ osapi sdk get --name Hostname SDK: Service: Name: Hostname Doc: Read and set the hostname of each node. Area: system Node: yes Methods (1): NAME DOC PERMISSION HTTP INPUT RESULT EXAMPLES Update Set the hostname of the host hostname:write PUT /api/node/{hostname}/hostname HostnameUpdateInput Collection[HostnameResult] 2
With --json, the command prints:
{
"service": {
"name": "Hostname",
"doc": "Read and set the hostname of each node.",
"area": "system",
"node": true,
"methods": [
{
"name": "Update",
"doc": "Set the hostname of the host",
"permission": "hostname:write",
"http": "PUT /api/node/{hostname}/hostname",
"input": "HostnameUpdateInput",
"result": "Collection[HostnameResult]",
"examples": 2
}
]
}
}
Flags
| Flag | Description | Default |
|---|---|---|
--name | A type, such as ContentType, or a service, such as Hostname (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.