Get Resource Types
Description
The px pxb get resourcetypes command retrieves the list of Kubernetes resource types that are supported by Portworx Backup for a specific cluster. This command helps you discover which resource types can be included in backup operations for a given cluster, enabling you to understand the backup capabilities and plan your backup strategies accordingly.
Usage
Get Resource Types
px pxb get resourcetypes --cluster-name <cluster-name> [--cluster-uid <uid>] [flags]
Examples
Basic Resource Types Operations
Get resource types for a cluster
# Get resource types for a specific cluster (table output)
px pxb get resourcetypes --cluster-name prod-cluster
# JSON output
px pxb get resourcetypes --cluster-name prod-cluster --output json
# YAML output
px pxb get resourcetypes --cluster-name prod-cluster --output yaml
# Names only (useful for scripting)
px pxb get resourcetypes --cluster-name prod-cluster --output name
Get resource types with cluster UID
# Specify both cluster name and UID for additional identification
px pxb get resourcetypes --cluster-name prod-cluster --cluster-uid cluster-12345
Using configuration file
# Get resource types using JSON configuration file
px pxb get resourcetypes --file /path/to/resourcetypes-config.json
Example /path/to/resourcetypes-config.json:
{
"org_id": "my-org",
"cluster_ref": {
"name": "prod-cluster",
"uid": "cluster-12345"
}
}
Dry-run to preview request
# Preview the request without executing
px pxb get resourcetypes --cluster-name prod-cluster --dry-run
Flags for commands and sub-commands
Get Resource Types Flags
Required Flags
| Flag | Short | Type | Description |
|---|---|---|---|
--cluster-name | -n | string | Name of the cluster to get resource types for (required, optional with --file) |
Optional Flags
| Flag | Short | Type | Description |
|---|---|---|---|
--cluster-uid | -u | string | UID of the cluster (optional, for additional identification) |
File Input
| Flag | Short | Type | Description |
|---|---|---|---|
--file | -f | string | JSON/YAML file containing resource types request configuration |
Notes
Resource Types Discovery
- The command queries the specified cluster to discover which Kubernetes resource types are available and supported by Portworx Backup.
- Resource types include standard Kubernetes resources (pods, services, deployments, etc.) and custom resources that may be present in the cluster.
- The response includes the complete list of resource types that can be included in backup operations.
File vs CLI Flag Precedence
- When using
--file, the cluster name and UID can be specified in the JSON configuration. - CLI flags override file values when both are provided.
- Organization ID is automatically taken from the current context.
Validation and Error Handling
- All validation is performed server-side to ensure accurate cluster connectivity and resource discovery.
- Server errors are preserved and displayed to provide detailed troubleshooting information.
Output Format Support
--output table(default) - Displays resource types in a formatted table--output json- JSON format for programmatic processing--output yaml- YAML format for configuration management--output name- Simple list of resource type names, one per line
Authentication and Context
- Organization ID from context
- Authentication token from context
- Cluster access permissions are validated server-side
Dry-Run Support
- Use
--dry-runto preview the request that would be sent to the server - Helpful for validating configuration before execution
- Shows the exact JSON request structure