Infrastructure Resources Skill
Use this skill to discover and inspect infrastructure resources — what exists, whether it
is healthy, and what its raw data contains.
CLI Commands
| Command |
Purpose |
Key flags |
cx infra resources types |
List available resource types (category/type pairs) |
- |
cx infra resources list |
List resources of one category/type |
--category, --type (required); --name-filter, --scope key=value, --start-row, --end-row |
cx infra resources health-history <resource-id> |
Daily health samples for one resource, oldest first |
- |
cx infra resources raw-data <resource-id> |
Raw resource document as JSON |
- |
- All commands are read-only and support
-o json / -o toon for
structured output.
- Multi-profile fan-out applies to
types and list only. Repeat
-p <profile> on those to compare fleets across accounts. health-history and
raw-data take a resource id, which is scoped to one team, so they reject
more than one -p — run them once per profile instead.
--scope is repeatable across different keys; allowed keys are service,
environment, team (e.g. --scope environment=prod --scope service=checkout).
Multiple keys combine with AND — a resource must match all of them. Each key
accepts a single value and may be given at most once; repeating one (e.g.
--scope service=a --scope service=b) is rejected. To cover several values for one key, run one query per
value and combine the results.
- Pagination:
--start-row / --end-row define a row window (--end-row is
exclusive); the default is the first 100 rows, and omitting only --end-row
gives 100 rows from --start-row. Page through large fleets in windows
(0-100, 100-200, …). list never pages for you — fleets can run to hundreds
of thousands of resources, so it returns one window and reports the total.
- The window cannot reach past row 10,000. The API rejects any request whose
start-row + rows exceeds 10,000, so paging cannot enumerate a fleet larger
than that even though total_count reports its true size. In any case,
narrow with --name-filter or --scope and page within each subset rather
than trying to walk the whole list.
list wraps its rows in an envelope (total_count, returned_count,
resources) — the other subcommands return bare arrays. total_count is the
fleet-wide match count, always present and independent of the window, so use it
as the stop condition: keep paging while start_row + returned_count < total_count, subject to the 10,000-row ceiling above.
- Pass resource IDs exactly as returned by
list (quote them — they contain
: and =); the CLI percent-encodes them for you.
Inspection Workflow
Three steps, and only because each one supplies an input the next one requires:
types gives the mandatory --category/--type, list gives the resource_id.
Answering "is web-server-1 healthy?" is these three calls — nothing more.
Discover what exists — categories and types are dynamic, so never guess:
cx infra resources types -o json
List resources of that category/type, narrowing with name and scope filters:
cx infra resources list --category Hosts --type EC2_Instances \
--name-filter web --scope environment=prod -o json
Inspect one resource using a resource_id from step 2. Statuses are
Healthy, Critical, or Unmonitored, one sample per day, oldest first:
cx infra resources health-history "1001234:host_id=i-abc123" -o json
raw-data is the alternative to this step, not a follow-on — use it
instead when you need source-specific detail rather than health.
Examples
Just the ids and names
# Rows live under .resources — `list` returns an envelope
cx infra resources list --category Hosts --type EC2_Instances -o json \
| jq '[.resources[] | {resource_id, name}]'
Check fleet size, and whether one window covered it
cx infra resources list --category Hosts --type EC2_Instances -o json \
| jq '{total_count, returned_count}'
# Next window, if there is one
cx infra resources list --category Hosts --type EC2_Instances \
--start-row 100 --end-row 200 -o json
Find when a resource went critical
# health-history returns a bare array, so no .resources here
cx infra resources health-history "1001234:host_id=i-abc123" -o json \
| jq '[.[] | select(.status == "Critical")]'
Read the raw resource document
# Source-specific detail: tags, instance metadata, configuration
cx infra resources raw-data "1001234:host_id=i-abc123" -o json
Key Principles
- Discover before listing —
--category and --type are required;
always start from cx infra resources types.
- Quote resource IDs and pass them verbatim — they embed
:, |, and =;
the CLI handles URL encoding.
- Scope keys are a fixed set (
service, environment, team) — unknown
keys are rejected client-side before any request is made.
- A missing raw document is not an error —
raw-data exits 0 and emits an
empty result on stdout: [] in json, [0]: in agents, and
No raw data found. in text. Only the note no raw data for this resource goes
to stderr. Parse the empty stdout result as a cleanly absent document, not a
failure — and do not expect stdout to be blank.
- Use
-o json with jq for filtering; use -o toon for token-efficient
output in agent contexts.
- Multi-profile fan-out is for
types and list only — repeating
-p <profile> tags each row with its profile so fleets can be compared across
accounts. The row window applies per profile, so list adds a
counts_by_profile breakdown — page each profile against its own total_count,
not the aggregate. health-history and raw-data error on a second -p.
- A resource id never crosses profiles — it embeds the team id
(
1001234:host_id=…), so an id from one account cannot resolve in another. When
a multi-profile list turns up something worth inspecting, note its profile
field and query that single profile for its health or raw data.
- Infra health is its own concept — the
Healthy/Critical/Unmonitored
statuses are computed by the infrastructure domain and are not the same as
Service Catalog health. Correlate them with telemetry signals;
do not treat them as interchangeable.
resource_id never leaves this skill — pass it only to health-history
and raw-data. For every other command, pivot on the resource name or the
service scope value.
Related Skills
Bridge to these skills using the resource name or the service scope
value — never the resource id, which only this skill understands:
cx-telemetry-querying — cx search-fields "<name>" -s value discovers
which log/span fields contain the resource name; cx logs "filter $l.subsystemname == '<service>'" queries the service's telemetry. Correlate a
Critical health day with error logs or CPU metrics.
cx-alerts — cx alerts list --name "<name-or-service>" finds alert
definitions matching the resource or its service by substring.
cx-dashboards — cx dashboards search "<name-or-service> ..." and
cx dashboards query-search --description "..." find dashboards semantically;
pair with search-fields -s value to then query-search --field the exact
field holding the resource name.
1---2name: cx-infra3description: >4 Query Coralogix infrastructure resources with the `cx infra` CLI — discover5 monitored resource types, list resources, check per-resource data. Use when the user asks6 to "show resource types", "list infrastructure resources", "what resources of this kind are monitored",7 "list resources of this kind", "is this resource healthy",8 "resource health history", "when did this resource go critical",9 "get raw resource data", "infrastructure inventory", "find resources by name",10 "filter resources by service or environment", or wants to explore11 infrastructure resources and their data.12metadata:13 source: https://skillmd.com/skills/coralogix/cx-infra14 version: "0.1.0"15---1617# Infrastructure Resources Skill1819Use this skill to discover and inspect **infrastructure resources** — what exists, whether it20is healthy, and what its raw data contains.2122## CLI Commands2324| Command | Purpose | Key flags |25|---|---|---|26| `cx infra resources types` | List available resource types (category/type pairs) | - |27| `cx infra resources list` | List resources of one category/type | `--category`, `--type` (required); `--name-filter`, `--scope key=value`, `--start-row`, `--end-row` |28| `cx infra resources health-history <resource-id>` | Daily health samples for one resource, oldest first | - |29| `cx infra resources raw-data <resource-id>` | Raw resource document as JSON | - |3031- All commands are **read-only** and support `-o json` / `-o toon` for32 structured output.33- **Multi-profile fan-out applies to `types` and `list` only.** Repeat34 `-p <profile>` on those to compare fleets across accounts. `health-history` and35 `raw-data` take a resource id, which is scoped to one team, so they **reject**36 more than one `-p` — run them once per profile instead.37- `--scope` is repeatable across **different** keys; allowed keys are `service`,38 `environment`, `team` (e.g. `--scope environment=prod --scope service=checkout`).39 Multiple keys combine with **AND** — a resource must match all of them. Each key40 accepts a single value and may be given **at most once**; repeating one (e.g.41 `--scope service=a --scope service=b`) is rejected. To cover several values for one key, run one query per42 value and combine the results.43- Pagination: `--start-row` / `--end-row` define a row window (`--end-row` is44 **exclusive**); the default is the first 100 rows, and omitting only `--end-row`45 gives 100 rows from `--start-row`. Page through large fleets in windows46 (0-100, 100-200, …). **`list` never pages for you** — fleets can run to hundreds47 of thousands of resources, so it returns one window and reports the total.48- **The window cannot reach past row 10,000.** The API rejects any request whose49 `start-row + rows` exceeds 10,000, so paging cannot enumerate a fleet larger50 than that even though `total_count` reports its true size. In any case,51 narrow with `--name-filter` or `--scope` and page within each subset rather52 than trying to walk the whole list.53- `list` wraps its rows in an envelope (`total_count`, `returned_count`,54 `resources`) — the other subcommands return bare arrays. `total_count` is the55 fleet-wide match count, always present and independent of the window, so use it56 as the stop condition: keep paging while `start_row + returned_count <57 total_count`, subject to the 10,000-row ceiling above.58- Pass resource IDs **exactly as returned by `list`** (quote them — they contain59 `:` and `=`); the CLI percent-encodes them for you.6061## Inspection Workflow6263Three steps, and only because each one supplies an input the next one requires:64`types` gives the mandatory `--category`/`--type`, `list` gives the `resource_id`.65Answering "is `web-server-1` healthy?" is these three calls — nothing more.66671. **Discover what exists** — categories and types are dynamic, so never guess:6869 ```bash70 cx infra resources types -o json71 ```72732. **List resources** of that category/type, narrowing with name and scope filters:7475 ```bash76 cx infra resources list --category Hosts --type EC2_Instances \77 --name-filter web --scope environment=prod -o json78 ```79803. **Inspect one resource** using a `resource_id` from step 2. Statuses are81 `Healthy`, `Critical`, or `Unmonitored`, one sample per day, oldest first:8283 ```bash84 cx infra resources health-history "1001234:host_id=i-abc123" -o json85 ```8687 `raw-data` is the **alternative** to this step, not a follow-on — use it88 instead when you need source-specific detail rather than health.8990## Examples9192### Just the ids and names9394```bash95# Rows live under .resources — `list` returns an envelope96cx infra resources list --category Hosts --type EC2_Instances -o json \97 | jq '[.resources[] | {resource_id, name}]'98```99100### Check fleet size, and whether one window covered it101102```bash103cx infra resources list --category Hosts --type EC2_Instances -o json \104 | jq '{total_count, returned_count}'105106# Next window, if there is one107cx infra resources list --category Hosts --type EC2_Instances \108 --start-row 100 --end-row 200 -o json109```110111### Find when a resource went critical112113```bash114# health-history returns a bare array, so no .resources here115cx infra resources health-history "1001234:host_id=i-abc123" -o json \116 | jq '[.[] | select(.status == "Critical")]'117```118119### Read the raw resource document120121```bash122# Source-specific detail: tags, instance metadata, configuration123cx infra resources raw-data "1001234:host_id=i-abc123" -o json124```125126## Key Principles127128- **Discover before listing** — `--category` and `--type` are required;129 always start from `cx infra resources types`.130- **Quote resource IDs and pass them verbatim** — they embed `:`, `|`, and `=`;131 the CLI handles URL encoding.132- **Scope keys are a fixed set** (`service`, `environment`, `team`) — unknown133 keys are rejected client-side before any request is made.134- **A missing raw document is not an error** — `raw-data` exits 0 and emits an135 *empty result* on **stdout**: `[]` in `json`, `[0]:` in `agents`, and136 `No raw data found.` in text. Only the note `no raw data for this resource` goes137 to stderr. Parse the empty stdout result as a cleanly absent document, not a138 failure — and do not expect stdout to be blank.139- **Use `-o json` with `jq`** for filtering; use `-o toon` for token-efficient140 output in agent contexts.141- **Multi-profile fan-out is for `types` and `list` only** — repeating142 `-p <profile>` tags each row with its profile so fleets can be compared across143 accounts. The row window applies per profile, so `list` adds a144 `counts_by_profile` breakdown — page each profile against its own `total_count`,145 not the aggregate. `health-history` and `raw-data` error on a second `-p`.146- **A resource id never crosses profiles** — it embeds the team id147 (`1001234:host_id=…`), so an id from one account cannot resolve in another. When148 a multi-profile `list` turns up something worth inspecting, note its `profile`149 field and query that single profile for its health or raw data.150- **Infra health is its own concept** — the `Healthy`/`Critical`/`Unmonitored`151 statuses are computed by the infrastructure domain and are not the same as152 Service Catalog health. Correlate them with telemetry signals;153 do not treat them as interchangeable.154- **`resource_id` never leaves this skill** — pass it only to `health-history`155 and `raw-data`. For every other command, pivot on the resource `name` or the156 `service` scope value.157158## Related Skills159160Bridge to these skills using the resource **name** or the **service** scope161value — never the resource id, which only this skill understands:162163- **`cx-telemetry-querying`** — `cx search-fields "<name>" -s value` discovers164 which log/span fields contain the resource name; `cx logs "filter165 $l.subsystemname == '<service>'"` queries the service's telemetry. Correlate a166 `Critical` health day with error logs or CPU metrics.167- **`cx-alerts`** — `cx alerts list --name "<name-or-service>"` finds alert168 definitions matching the resource or its service by substring.169- **`cx-dashboards`** — `cx dashboards search "<name-or-service> ..."` and170 `cx dashboards query-search --description "..."` find dashboards semantically;171 pair with `search-fields -s value` to then `query-search --field` the exact172 field holding the resource name.