maqpna get
Display one or many resources (kubectl get for MAQPNA)
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#
| Flag | Type | Description | Default |
|---|---|---|---|
-A, --all-namespaces | switch | all namespaces | none |
-L, --label-columns | string | add a column with the value of this label (repeatable or comma-separated) | none |
--allow-gateway-mismatch | switch | send the context's login token to a gateway other than the one it was issued for (env MAQPNA_ALLOW_GATEWAY_MISMATCH=1) | none |
--field-selector | string | field selector evaluated on any field (spec.agentRef=coder,status.phase!=Failed) | none |
--gateway | string | gateway base URL (env MAQPNA_GATEWAY_URL; default: the context's gateway) | none |
--ignore-not-found | switch | a missing named object is not an error | none |
--interval | duration | poll interval of -w for the gateway kinds | 2s |
-l, --selector | string | label selector (e.g. app=coder,tier!=t0); Kubernetes kinds | none |
-n, --namespace | string | namespace | default |
--no-headers | switch | omit the header row | none |
--oidc-token-file | string | file holding an OIDC access token for the admin API (env MAQPNA_OIDC_TOKEN_FILE); wins over --token | none |
--show-kind | switch | print the resource type with the name | none |
--show-labels | switch | add a LABELS column | none |
--since | string | audit records: since this duration ago or RFC3339 time (default 1h) | none |
--sort-by | string | sort by a JSONPath (e.g. .metadata.creationTimestamp) | none |
--token | string | static admin token (env MAQPNA_ADMIN_TOKEN; dev/break-glass) | none |
-w, --watch | switch | after listing, watch for changes | none |
--watch-only | switch | watch for changes without listing first | none |
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:.toolWhat happens when you run it#
- Talks to the gateway:
--gateway, elseMAQPNA_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 jsonor-o yamlprint the data, and--jq EXPRfilters the JSON.
Exit codes#
| Code | Meaning |
|---|---|
0 | success |
1 | error (the message says what failed, with a hint when there is one) |
2 | usage error: unknown flag, missing argument or bad value; the synopsis is printed |
3 | a check failed, a change is blocked, or a result did not match (tamper, policy mismatch) (not used by this command) |