Skip to main content

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​

FlagDescriptionDefault
--nameA type, such as ContentType, or a service, such as Hostname (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.