Get
Print the NATS subjects that one osapi process needs.
It prints the least that the role can publish and subscribe to, with the streams
and buckets of the config and the namespace of controller.nats. Give these to
the NATS user of the role on a NATS server that osapi does not run. nsc is the
flags of nsc add user or nsc edit user, for a server in operator mode. The
embedded server applies them itself to a user with a role in
nats.server.auth.users.
osapi nats permissions get [flags]
Examples
osapi nats permissions get --role agent
osapi nats permissions get --role controller --json
Result
The command prints:
$ osapi nats permissions get --role agent NATS permissions: Role: agent Namespace: osapi Publish: $JS.API.INFO, $KV.osapi-agent-registry.>, osapi.enroll.request Subscribe: _INBOX.>, osapi.enroll.response.> Answers requests: no nsc: --allow-pub "$JS.API.INFO,$KV.osapi-agent-registry.>,osapi.enroll.request" --allow-sub "_INBOX.>,osapi.enroll.response.>"
With --json, the command prints:
{
"role": "agent",
"namespace": "osapi",
"publish": [
"$JS.API.INFO",
"$KV.osapi-agent-registry.\u003e",
"osapi.enroll.request"
],
"subscribe": ["_INBOX.\u003e", "osapi.enroll.response.\u003e"],
"responses": false,
"nsc": "--allow-pub \"$JS.API.INFO,$KV.osapi-agent-registry.\u003e,osapi.enroll.request\" --allow-sub \"_INBOX.\u003e,osapi.enroll.response.\u003e\""
}
Flags
| Flag | Description | Default |
|---|---|---|
--role | The osapi process: controller, agent, setup or join (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.