CLICommandsl4 tags

l4 tags resources

l4 tags resources lists the resources that carry a key, one page at a time. Each row shows the value the resource holds, which step of the evaluation assigned it, and its spend over the last 30 complete days.

l4 tags resources <key> [flags]

It reads GET /api/v1/tags/keys/{key_id}/resources. <key> is an ID or a name, as Naming a key describes.

Flags

FlagDescription
--value <name>Only resources holding this value
--provider <p>aws or gcp. Omit for both
--search <text>Filter resources by text. The API runs the search, so it covers every page
--page <n> / --page-size <n>Pagination

Global flags apply. See CLI overview.

Examples

l4 tags resources Teams
l4 tags resources Teams --value data
l4 tags resources Teams --provider gcp --search bigquery
l4 tags resources Teams --page 2 --page-size 50
l4 tags resources Teams --jq '.data.items[] | select(.ratio < 1) | [.name, .value_name, .ratio]'

Output

Default output is a table with one row per resource and value. With --json the whole API envelope is printed. The fields it carries:

.data.items[].resource_id
.data.items[].name              # the Name tag when present, otherwise the resource ID
.data.items[].type
.data.items[].provider
.data.items[].account_id
.data.items[].value_id
.data.items[].value_name
.data.items[].value_source      # see below
.data.items[].ratio             # share of the resource's cost this value takes
.data.items[].spend
.data.pagination.total_pages
.data.pagination.has_next

value_source names the step that assigned the value:

value_sourceAssigned by
providerThe provider's own value, kept or used as the Can Override fallback
collapsedA collapsed key
configA config with one value
allocationA split or cost-based config

A resource that a split divides appears once per value, and each row's ratio gives that value's share. How LevelFour picks a value has the steps in order.

Errors

ExitSymptomCause
4Authentication requiredNo token resolvable; run l4 auth login or set LEVELFOUR_TOKEN
1401 authentication failedToken revoked, expired, or from the wrong environment
1no tag key named ...A name nobody holds, resolved locally against the key list
1... has no value named ...The key holds no value by that name. l4 tags show lists them
1404 tag_not_foundA vtk_ or ptk_ ID nobody holds