MAQPNADocs

maqpna get

Display one or many resources (kubectl get for MAQPNA)

Observe-o json | yaml

Synopsis#

maqpna get TYPE[,TYPE...] [NAME...] | TYPE/NAME... | maqpna [-n NS | -A] [-l SELECTOR] [--field-selector F]
           [-o wide|json|yaml|name|jsonpath=...|go-template=...|custom-columns=...] [--sort-by JSONPATH]
           [-w | --watch-only] [--show-labels] [-L KEY]... [--no-headers] [--show-kind] [--ignore-not-found]
           [--since 1h] [--gateway URL]

Description#

TYPE is a kind, plural, singular or short name (maqpna api-resources lists them): ag, sess, snap, tp, mcp, tt, tn, bp, sp, ms, peer, ca, rev, and the gateway's runtime kinds approvals (apr), auditrecords (audit), runtimesessions (rsess), activerevocations (arv) and usage (costs). "maqpna" (or "all") is every maqpna.com kind. Columns are the CRDs' printer columns (the same as kubectl get); -o wide adds the priority columns.

-l is a server-side label selector (Kubernetes kinds); --field-selector is evaluated by the CLI on any field (spec.agentRef=coder,status.phase!=Failed) and works for the gateway kinds too. -w watches the Kubernetes kinds through the watch API and polls the gateway kinds (--interval).

Flags#

FlagTypeDescriptionDefault
-A, --all-namespacesswitchall namespacesnone
-L, --label-columnsstringadd a column with the value of this label (repeatable or comma-separated)none
--allow-gateway-mismatchswitchsend the context's login token to a gateway other than the one it was issued for (env MAQPNA_ALLOW_GATEWAY_MISMATCH=1)none
--field-selectorstringfield selector evaluated on any field (spec.agentRef=coder,status.phase!=Failed)none
--gatewaystringgateway base URL (env MAQPNA_GATEWAY_URL; default: the context's gateway)none
--ignore-not-foundswitcha missing named object is not an errornone
--intervaldurationpoll interval of -w for the gateway kinds2s
-l, --selectorstringlabel selector (e.g. app=coder,tier!=t0); Kubernetes kindsnone
-n, --namespacestringnamespacedefault
--no-headersswitchomit the header rownone
--oidc-token-filestringfile holding an OIDC access token for the admin API (env MAQPNA_OIDC_TOKEN_FILE); wins over --tokennone
--show-kindswitchprint the resource type with the namenone
--show-labelsswitchadd a LABELS columnnone
--sincestringaudit records: since this duration ago or RFC3339 time (default 1h)none
--sort-bystringsort by a JSONPath (e.g. .metadata.creationTimestamp)none
--tokenstringstatic admin token (env MAQPNA_ADMIN_TOKEN; dev/break-glass)none
-w, --watchswitchafter listing, watch for changesnone
--watch-onlyswitchwatch for changes without listing firstnone

The global flags (--context, -o, --no-color, ...) work with every command.

Examples#

maqpna get ag -n team-a
maqpna get sess -A -o wide --sort-by .metadata.creationTimestamp
maqpna get sess -n team-a --field-selector status.phase=Running -w
maqpna get ag/coder tp/coder-policy -n team-a -o yaml
maqpna get maqpna -n team-a
maqpna get approvals --field-selector status=pending -o custom-columns=ID:.id,TOOL:.tool

What happens when you run it#

  • Talks to the gateway: --gateway, else MAQPNA_GATEWAY_URL, else the current context's gateway (maqpna context).
  • Authenticates to the admin API with the token stored by maqpna login, --oidc-token-file, or a static --token (MAQPNA_ADMIN_TOKEN).
  • Prints a table by default; -o json or -o yaml print the data, and --jq EXPR filters the JSON.

Exit codes#

CodeMeaning
0success
1error (the message says what failed, with a hint when there is one)
2usage error: unknown flag, missing argument or bad value; the synopsis is printed
3a check failed, a change is blocked, or a result did not match (tamper, policy mismatch) (not used by this command)