cub revision mutation-sources
cub revision mutation-sources
Show what set each value in a revision's config data
Synopsis
Display a revision's MutationSources: for each resource and each path within it, what set the value that is there as of that revision.
MutationSources is not part of the Revision entity, so 'cub revision get -o json' does not include it. Use -o json / -o yaml / -o jq= to shape the output; with a unit and a revision number, the payload is the list of resources, so a path is addressed as '.[0].PathMutationMap'.
For one revision, 'cub revision get -o mutations' shows the same information as a table.
With a unit and no revision number, reads every revision of the unit, newest first, in one request rather than one per revision; --where narrows them. Each row carries the revision it belongs to, so the payload is addressed as '.[0].MutationSources' rather than '.[0]'.
With --where and no unit, reads the revisions the clause selects across units. By default that is at most one revision per unit, the newest that matches; --distinct-on Off reads every one. Scoped to --space when it is given.
The clause can select on MutationSources itself. Its PathMutationMap is keyed by path, and a * there iterates the paths. A dot in a path is written ~1 when naming one.
Examples:
# What set each value in revision 3 of a unit
cub revision mutation-sources --space my-space my-deployment 3
# Every revision of a unit, with the revision each row belongs to
cub revision mutation-sources --space my-space my-deployment -o jq='.[].RevisionNum'
# The revisions of a unit in which spec.replicas was protected
cub revision mutation-sources --space my-space my-deployment \
--where "MutationSources.*.PathMutationMap.spec~1replicas.Protected = true"
# For each unit in a space, the newest revision a change set made
cub revision mutation-sources --space my-space --where "ChangeSetID = '<changeset-id>'"
# Every revision in the organization with a protected path, not only the newest per unit
cub revision mutation-sources --distinct-on Off \
--where "MutationSources.*.PathMutationMap.*.Protected = true"
cub revision mutation-sources [<unit> [<revision-num>]] [flags]
Options
--distinct-on string without a unit, what to return at most one revision per: Unit, the default, or Off for every revision that matches
-h, --help help for mutation-sources
--include-hidden string[="*"] Also select hidden entities, to list or to act on: those hidden for the given HiddenReasons, comma-separated, as in --include-hidden=BackingUnit, or for any reason when given no value or "*". ConfigHub/YAML Units, which hold the configuration of other entities, are hidden with the reason BackingUnit. A --where naming entities by Slug or ID selects them whether hidden or not
--limit int Return at most this many entities; 0 returns all of them. They are read from the server in pages of at most 1000
--order-by string Order the entities by these fields, as comma-separated 'ASC:Field', 'DESC:Field' or 'Field' terms, such as "DESC:CreatedAt". Entities with equal values are ordered by ID. With --limit, this decides which entities are returned
-o, --output string Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
--quiet No default output.
--select string Comma-separated list of fields to retrieve and display. Entity IDs and Slug are always included. Example: "DisplayName,CreatedAt,Labels"
--verbose Detailed output, additive with default output
--where string Filter expression using SQL-inspired syntax. Supports conjunctions with AND. String operators: =, !=, <, >, <=, >=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*. Pattern matching with LIKE/ILIKE uses % and _ wildcards. Regex operators (~, ~*, !~, !~*) support POSIX regular expressions. A related entity is referenced by prefix, as in "UpstreamUnit.Slug = 'base'"; when the reference names a list, a * segment matches any element, as in "FromLink.*.Slug = 'upgrade-app'". Examples: "Slug LIKE 'app-%'", "DisplayName ILIKE '%backend%'", "Slug ~ '^[a-z]+-[0-9]+$'". 'cub <entity> explain --where' lists the attributes an entity's expressions can name
Options inherited from parent commands
--component string the Component of --variant, when that names the variant alone; --variant <component>/<variant> says the same in one flag
--context string The context to use for this command
--debug Debug output
--space string space to operate in, by slug or UUID. Omitted, a list or bulk operation spans the organization and a single entity is named as <space>/<slug>; "*" means the same as omitting it
--variant string variant to operate in, as <component>/<variant>, or as <variant> with --component: the space naming that Component whose Variant label is <variant>. The same scope as --space, named by what it is rather than by the space's slug; the two cannot be combined
SEE ALSO
- cub revision - Revision commands