Skip to main content

Dry Run

Description

Use the global --dry-run flag to validate inputs and view the request payload without making any server changes. px pxb performs schema and business-logic checks, validates any --file YAML/JSON, prints a human-readable summary (Checks Passed / Warnings / Errors), and shows the effective request body that would be sent. No network calls are made in dry-run mode.

Usage

Global usage

# Append --dry-run to any create/update/delete/activate/connect or supported get/retry command
px pxb <verb> <resource> [flags] --dry-run

Examples (resource-agnostic)

# Validate a backup creation
px pxb create backup --name app-backup --cluster prod --backup-location-name s3 --dry-run

# Validate backup update from file (CLI flags override file values in actual runs)
px pxb update backup --file ./backup-update.json --dry-run

# Validate cloud credential creation
px pxb create cloudcredential --name aws --type s3 --access-key AKIA... --secret-key ... --dry-run

# Validate role deletion
px pxb delete role --name readonly-role --dry-run

# Validate a schedule creation
px pxb create backupschedule --name daily --policy-name daily-policy --dry-run

# Validate license activation (from file or flags)
px pxb activate license --from-file ./license-activate.json --dry-run

# Validate cluster connect
px pxb connect cluster --name my-cluster --kubeconfig ~/.kube/config --dry-run

# Validate backup retrieval semantics (inspect or enumerate)
px pxb get backup --name app-backup --dry-run
px pxb get backup --max-objects 10 --dry-run

# Validate restore filtering and enumeration
px pxb get restore --name-filter "prod-" --status Success,Failed --dry-run
px pxb get restore --cluster-name-filter "production" --labels env=prod --dry-run
px pxb get restore --start-time "2024-01-01T00:00:00Z" --end-time "2024-12-31T23:59:59Z" --dry-run

# Validate version information retrieval
px pxb version --dry-run
px pxb version --client-only --dry-run

Flags for commands and sub-commands

Global Flag (applies to all commands)

FlagShortTypeDescription
--dry-runboolSimulate the operation without making any changes; performs comprehensive validation and prints a summary

Notes

  • When --dry-run is set, pxb:
    • Skips establishing a gRPC connection; no server state is modified
    • Validates YAML/JSON provided via --file and reports syntax issues with helpful messages
    • Runs resource-specific validators (required fields, allowed values, common pitfalls)
    • Prints a summary block with Checks Passed, Warnings, and Errors
    • Prints the effective request body when validation succeeds
  • File vs CLI flag precedence (for non-dry-run execution):
    • px pxb supports file input (YAML/JSON). CLI flags override file values when executing for real. Dry-run displays the merged request that would be sent.
  • Supported operations
    • ALL main commands support dry-run: activate, connect, create, delete, get, resume, retry, share, suspend, unshare, update, validate, version
    • Create/Update/Delete/Activate/Connect support dry-run across resources (e.g., backup, restore, backuplocation, backupschedule, cloudcredential, role, rule, license, cluster)
    • Selected read-paths (e.g., get backup, version) support a dry-run that validates required/optional parameters and mode (inspect vs enumerate)
  • Endpoint and authentication
    • Dry-run does not require a reachable endpoint or a valid auth token (no network calls are made)
  • Output
    • Dry-run output is human-readable validation text plus an optional request body; it does not follow the --output table/json/yaml formats

Output Format Support

  • Not applicable: dry-run prints human-readable validation details; --output is ignored.

Authentication and Context

  • Organization/context is still loaded to validate request bodies when applicable, but no token is required to perform dry-run.
  • To learn about authentication and config, see: