Skip to content

cub link update

Update a link or multiple links

Synopsis

Update a link or multiple links using bulk operations.

Single link update:

  cub link update my-link from-unit to-unit [to-space]

Individual patch with --patch:

Update a single link using JSON merge patch. Requires --patch flag with link slug.

Examples:

  # Patch individual link with JSON
  echo '{"Labels": {"env": "prod"}}' | cub link update my-link --patch --from-stdin

  # Patch individual link with labels
  cub link update my-link --patch --label env=prod,team=backend

Bulk update with --patch:

Update multiple links at once based on search criteria. Requires --patch flag with no positional arguments.

Examples:

  # Update labels for multiple links using JSON patch
  echo '{"Labels": {"env": "prod"}}' | cub link update --patch --where "DisplayName LIKE 'app-%'" --from-stdin

  # Update labels for multiple links using --label flag
  cub link update --patch --where "DisplayName LIKE 'app-%'" --label env=prod,team=backend

  # Update links across all spaces (requires --space "*")
  cub link update --patch --space "*" --where "ToSpaceID = 'old-space-id'" --from-stdin

  # Update specific links by slug
  echo '{"Labels": {"updated": "true"}}' | cub link update --patch --link my-link,another-link --from-stdin
cub link update [<link slug or id> <from unit slug> <to unit slug> [<to space slug>]] [flags]

Options

      --annotation strings      annotations in key=value format; can separate by commas and/or use multiple instances of the flag
      --auto-update             enable automatic downstream unit updates when upstream changes
      --delete-gate strings     delete gates in key[=true] format; can separate by commas and/or use multiple instances of the flag
      --filename string         Read the ConfigHub entity JSON from file, URL (https://), or stdin (-); mutually exclusive with --from-stdin
      --filter string           Filter entity to apply to the list. Specify as 'space/filter' for cross-space filters or just 'filter' for current space. Supports both slugs and UUIDs. The filter will be combined with any --where clause using AND logic. Examples: "production-filters/security-check", "my-filter-uuid", "validation-rules"
      --from-stdin              Read the ConfigHub entity JSON (e.g., retrieved with cub <entity> get --quiet --json) from stdin; merged with command arguments on create, and merged with command arguments and existing entity on update
  -h, --help                    help for update
      --jq string               jq expression, suppressing default output
      --json                    JSON output, suppressing default output
      --label strings           labels in key=value format; can separate by commas and/or use multiple instances of the flag
      --link strings            target specific links by slug or UUID for bulk patch (can be repeated or comma-separated)
      --make-current            set link revision numbers to current unit revisions (skips initial merge)
      --no-auto-update          disable automatic downstream unit updates
      --no-use-live-state       use Data of upstream unit instead of LiveState
      --patch                   use patch API for individual or bulk operations
      --quiet                   No default output.
      --replace                 Replace entity instead of merging when using --from-stdin or --filename
      --timeout string          completion timeout as a duration with units, such as 10s or 2m (default "10m0s")
      --update-type string      link update type (NeedsProvides or MergeUnits)
      --use-live-state          use LiveState of upstream unit instead of Data
      --verbose                 Detailed output, additive with default output
      --wait                    wait for completion (default true)
      --where string            Filter expression using SQL-inspired syntax. Supports conjunctions with AND. String operators: =, !=, <, >, <=, >=, LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*. Pattern matching with LIKE/ILIKE uses % and _ wildcards. Regex operators (~, ~*, !~, !~*) support POSIX regular expressions. Examples: "Slug LIKE 'app-%'", "DisplayName ILIKE '%backend%'", "Slug ~ '^[a-z]+-[0-9]+$'"
      --where-mutation string   where expression to filter mutations during merge
      --where-resource string   where expression to select upstream resources for propagation
      --yaml                    YAML output, suppressing default output
      --yq string               yq expression, suppressing default output

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output
      --space string     space ID to perform command on

SEE ALSO