Get
Show a chain: its tree, and what each call of each example sends and gets.
It runs each example of the behavior on the fake host that go test uses, and
records each behavior.Call: the behavior, the method, the input, and the
output or the error. The table cuts each input and output; --json has them in
full, under runs. An input field tagged secret shows as [redacted].
osapi dsl chain get [flags]
Examples
osapi dsl chain get --name dns
osapi dsl chain get --name dns --json
Result
The command prints:
$ osapi dsl chain get --name dns Chain: Behavior: dns Chain: dns → netplan → managedfile Calls: netplan Used by: none Set the servers of an interface (update): CALL SENDS GETS dns update interface_name=osapi0 servers=[9.9.9.9] changed=true interface_name=osapi0 └─ netplan get name=osapi0 id=osapi0 name=osapi0 section=ethernets type=ethernet └─ netplan update content=<9 lines> path=/etc/netplan/osapi-dns-osapi0.yaml changed=true path=/etc/netplan/osapi-dns-osapi0.yaml · └─ managedfile update content=<9 lines> path=/etc/netplan/osapi-dns-osapi0.yaml changed=true path=/etc/netplan/osapi-dns-osapi0.yaml
With --json, the command prints:
{
"behavior": "dns",
"chain": "dns → netplan → managedfile",
"calls": ["netplan"],
"used_by": [],
"examples": [
{
"example": "Set the servers of an interface (update)",
"calls": [
{
"call": "dns update",
"sends": "interface_name=osapi0 servers=[9.9.9.9]",
"gets": "changed=true interface_name=osapi0"
},
{
"call": "└─ netplan get",
"sends": "name=osapi0",
"gets": "id=osapi0 name=osapi0 section=ethernets type=ethernet"
},
{
"call": "└─ netplan update",
"sends": "content=\u003c9 lines\u003e path=/etc/netplan/osapi-dns-osapi0.yaml",
"gets": "changed=true path=/etc/netplan/osapi-dns-osapi0.yaml"
},
{
"call": "· └─ managedfile update",
"sends": "content=\u003c9 lines\u003e path=/etc/netplan/osapi-dns-osapi0.yaml",
"gets": "changed=true path=/etc/netplan/osapi-dns-osapi0.yaml"
}
]
}
],
"runs": null
}
Flags
| Flag | Description | Default |
|---|---|---|
--name | The behavior, from osapi dsl chain list (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.