Skip to main content

Command line interface to talk to pulpcore's REST API. (Console plugin commands)

Project description

Pulp CLI Console

A command-line interface for Pulp, providing console administrative functionality.

Table of Contents

Overview

The Pulp CLI Console provides a set of commands to manage Pulp resources from the command line. It extends the base Pulp CLI functionality with console-specific administrative tools for system operators and administrators.

The console offers capabilities for task management, vulnerability scanning, system monitoring, and more, all through a unified command-line interface.

Requirements

  • Python 3.8 or higher
  • Access to a Pulp 3.x server
  • Network connectivity to your Pulp server
  • Appropriate user permissions on the Pulp server

Installation

You can install the Pulp CLI Console using pip:

pip install pulp-cli-console

For development or the latest features, you can install directly from the repository:

pip install git+https://github.com/pulp/pulp-cli-console.git

Configuration

Basic Configuration

The Pulp CLI Console requires configuration to connect to your Pulp server. Create a configuration file at ~/.config/pulp/cli.toml:

[cli]
base_url = "https://pulp.example.com"
verify_ssl = true
format = "json"
timeout = 30
username = "admin"
password = "password"  # Consider using environment variables instead

Advanced Options

You can customize various aspects of the CLI behavior:

[cli]
base_url = "https://pulp.example.com"
verify_ssl = true
cert = "/path/to/client/cert.pem"  # Optional client certificate
key = "/path/to/client/key.pem"    # Optional client key
ca_cert = "/path/to/ca/cert.pem"   # Custom CA certificate
format = "json"                    # Output format: json, yaml, or none
timeout = 60                       # Request timeout in seconds
limit = 100                        # Default pagination limit
interactive = true                 # Enable interactive prompts
quiet = false                      # Suppress non-error output
verbose = 0                        # Verbosity level (0-3)
# Use one of the following authentication methods
username = "admin"
password = "password"
token = "your-api-token"           # API token authentication
refresh_token = "refresh-token"    # For OAuth2 refresh token flow

Environment Variables

You can also use environment variables for configuration, which is recommended for sensitive information:

# Base configuration
export PULP_BASE_URL="https://pulp.example.com"
export PULP_VERIFY_SSL="true"

# Authentication
export PULP_USERNAME="admin"
export PULP_PASSWORD="password"

# Alternative authentication
export PULP_TOKEN="your-api-token"

Usage

Task Management

The CLI provides commands for managing administrative tasks:

# List all tasks
pulp console task list

# Filter tasks by state
pulp console task list --state=completed

# List tasks with pagination
pulp console task list --limit=10 --offset=20

# Filter tasks by name
pulp console task list --name="sync" --name-contains="content"

# Filter tasks by time
pulp console task list --started-at-gte="2023-01-01T00:00:00Z"

# Show detailed information for a specific task
pulp console task show --href=/pulp/api/v3/tasks/1234abcd/

# Cancel a running task
pulp console task cancel --href=/pulp/api/v3/tasks/1234abcd/

Available Filters for Tasks

  • --limit: Limit the number of tasks shown
  • --offset: Skip a number of tasks
  • --name: Filter by task name
  • --name-contains: Filter tasks containing this name
  • --logging-cid-contains: Filter by logging correlation ID
  • --state: Filter by task state
  • --state-in: Filter by multiple states (comma-separated)
  • --task-group: Filter by task group
  • --parent-task: Filter by parent task
  • --worker: Filter by worker
  • --created-resources: Filter by created resources
  • --started-at-gte/--started-at-lte: Filter by start time
  • --finished-at-gte/--finished-at-lte: Filter by finish time
  • --reserved-resource/--reserved-resource-in: Filter by reserved resources
  • --exclusive-resource/--exclusive-resource-in: Filter by exclusive resources
  • --shared-resource/--shared-resource-in: Filter by shared resources

Vulnerability Management

The CLI provides commands for managing vulnerability reports:

# List vulnerability reports
pulp console vulnerability list

# Show a specific vulnerability report
pulp console vulnerability show --href=/api/pulp/vulnerability-reports/123/

# Create a vulnerability report
pulp console vulnerability create --file=/path/to/packages.json

Vulnerability Commands

  • list: List all vulnerability reports
  • show: Display details of a specific vulnerability report
  • create: Create a new vulnerability report from a JSON file

Options for Vulnerability Commands

  • --href: Reference to a specific vulnerability report (for show command)
  • --file: JSON file containing npm packages (required for create command)
  • --chunk-size: Size of chunks for uploading files (for create command)
  • --severity: Filter by vulnerability severity (critical, high, medium, low)
  • --status: Filter by status (open, in-progress, resolved, false-positive)

Performance Monitoring

# Get system performance metrics
pulp console monitor performance

# View resource utilization
pulp console monitor resources

# Check Pulp server health
pulp console monitor health

Troubleshooting

Common Issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulp-cli-console-0.1.5.dev0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pulp_cli_console-0.1.5.dev0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file pulp-cli-console-0.1.5.dev0.tar.gz.

File metadata

  • Download URL: pulp-cli-console-0.1.5.dev0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pulp-cli-console-0.1.5.dev0.tar.gz
Algorithm Hash digest
SHA256 fa3b237001fe9d393fade93143b1ba5da07735e29611256976aa250fe4cd72de
MD5 0254f271be2e18fba7e69d11625e4c32
BLAKE2b-256 67ef40040b957db8e5d3cd1b647c2e85be899f0e12ba43e1b2023174da379ccf

See more details on using hashes here.

File details

Details for the file pulp_cli_console-0.1.5.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for pulp_cli_console-0.1.5.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 27a0fca071c3e2ad370c6fc0e14b7b26542cef13d972c42a557619b0281f0d08
MD5 ac987936e5c4a29420ad4cc25c96fe14
BLAKE2b-256 317f527fec8c1a5892d5d9bfcc34a196e67f97543555732e782682c1bd736b81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page