Skip to content

Moodswing9/networker-ppdm

Repository files navigation

🛡️ NetWorker / PPDM

Python REST API clients, unified CLI, automation scripts, and a Claude Code skill for Dell EMC NetWorker, PowerProtect Data Manager, and Data Domain

Version License CI Python Tests Claude Code Plugin Claude AI


Overview

A complete automation and expert-guidance toolkit for Dell EMC backup infrastructure. Covers backup/restore operations, Kubernetes protection, DDBoost, database agents, SLA reporting, and cloud tier management across PPDM, NetWorker, and Data Domain.


Python Library

pip install -r requirements.txt
cp .env.example .env   # fill in your host / user / pass

Both clients implement automatic retry with exponential backoff — transient failures (HTTP 429, 500, 502, 503, 504, connection errors) are retried up to 3 times with randomised jitter before raising. Non-retryable responses (4xx) surface immediately.

PPDMClient

from ppdm import PPDMClient

with PPDMClient.from_env() as ppdm:
    # List all failed Kubernetes backup jobs
    for job in ppdm.failed_activities(asset_type="KUBERNETES"):
        print(job["name"], job["startTime"])

    # Trigger on-demand backup
    policy = ppdm.get_policy_by_name("k8s-daily")
    result = ppdm.trigger_backup(policy["id"])

    # Restore a namespace to a new location
    copy = ppdm.latest_copy(asset_id)
    ppdm.restore_kubernetes_to_new_namespace(
        copy["id"], target_namespace="ns-restored", target_cluster_id="..."
    )

Available methods: list_assets · get_asset · list_copies · latest_copy · list_activities · failed_activities · running_activities · cancel_activity · list_policies · get_policy_by_name · create_policy · assign_assets · trigger_backup · create_protection_rule · list_inventory_sources · discover_inventory_source · list_storage_systems · restore · restore_kubernetes_to_new_namespace

NWClient

from networker import NWClient

with NWClient.from_env() as nw:
    savesets = nw.list_savesets_for_client("web01.example.com")
    latest   = nw.latest_full_backup("web01.example.com")
    nw.trigger_group_backup("Linux-Clients")

Available methods: list_clients · get_client · list_savesets · list_savesets_for_client · latest_full_backup · list_policies · list_workflows · list_protection_groups · trigger_group_backup · start_recover

DDClient

from datadomain import DDClient

with DDClient.from_env() as dd:
    dd.enable_ddboost()
    dd.create_storage_unit("ppdm-su-01", "ddboost-user", soft_limit_tib=10.0)
    print(dd.filesystem_stats())

Available methods: ddboost_status · enable_ddboost · disable_ddboost · list_storage_units · create_storage_unit · assign_user_to_storage_unit · system_info · filesystem_stats · list_users · create_user


Automation Scripts

Ready-to-run scripts — require .env with credentials set.

# Report all failed backup activities (exit 1 if failures found — CI-friendly)
python scripts/check_failed_jobs.py
python scripts/check_failed_jobs.py --asset-type KUBERNETES
python scripts/check_failed_jobs.py --json

# SLA compliance report
python scripts/sla_report.py
python scripts/sla_report.py --non-compliant-only

# Trigger on-demand backup (optionally poll until completion)
python scripts/ondemand_backup.py --asset "prod-namespace" --policy "k8s-daily"
python scripts/ondemand_backup.py --asset "prod-namespace" --policy "k8s-daily" --wait

Unified CLI

backupctl is a single operator-friendly entry point across PPDM, NetWorker, and Data Domain.

pip install -e .
backupctl doctor
backupctl inventory --format json
backupctl protect ppdm --target k8s-daily
backupctl protect networker --target Linux-Clients
backupctl dd status

# AI commands — require ANTHROPIC_API_KEY
backupctl ask "How do I restore a Kubernetes namespace from a PPDM copy?"
backupctl generate "Python script that lists all PPDM policies older than 30 days"
Command Description
backupctl doctor Cross-platform health check for PPDM, NetWorker, and Data Domain
backupctl inventory Combined PPDM + NetWorker inventory output
backupctl protect Trigger a PPDM policy or NetWorker protection group backup
backupctl dd status Inspect Data Domain status and filesystem details
backupctl ask Plain-English Q&A over SKILL.md — RAG-powered, answered by Claude Opus 4.7
backupctl generate Generate NetWorker/PPDM automation scripts with Claude Opus 4.7

AI Features

Powered by Claude Opus 4.7 (adaptive thinking) for Q&A and script generation. Embeddings use NVIDIA NIM NemoRetriever for vector search.

backupctl ask — RAG over SKILL.md

Asks NetWorker/PPDM questions in plain English. The pipeline:

  1. Chunks SKILL.md by H2 heading (rag/chunker.py)
  2. Embeds each chunk with nvidia/llama-3.2-nemoretriever-300m-embed-v1 (rag/embedder.py)
  3. Stores vectors in an in-memory cosine-similarity index, cached as .rag_index.json (rag/retriever.py)
  4. Retrieves the top-K chunks for the user's question, then asks claude-opus-4-7 (adaptive thinking) to answer using only that context (rag/pipeline.py)
export ANTHROPIC_API_KEY=sk-ant-...
export NVIDIA_API_KEY=nvapi-...   # required for embeddings only
backupctl ask "What's the safest way to cancel a stuck PPDM activity?"
backupctl ask "Show me the REST call to list failed Kubernetes jobs" --top-k 8
backupctl ask "..." --rebuild   # force rebuild of vector index

backupctl generate — Domain-Aware Script Generation

Generates production-ready Python or bash scripts targeting the NetWorker/PPDM REST APIs. Uses claude-opus-4-7 (adaptive thinking) with a system prompt that constrains output to clean, error-handled, log-aware code (orchestrator/generate.py).

backupctl generate "Bash script that nightly reports DD storage units over 80% full"
backupctl generate "Python script that triggers PPDM backups for all K8s namespaces" -o backup_all_ns.py

Requirements for AI features: pip install anthropic>=0.40 and ANTHROPIC_API_KEY set in the environment. NVIDIA_API_KEY is still required for the NemoRetriever embedding step in backupctl ask.


Claude Code Plugin

Install as a plugin to get the skill, four slash commands, and a specialist agent inline in Claude Code:

npx skills add Moodswing9/networker-ppdm -g

Once installed, you get:

Component What it does
networker-ppdm skill Auto-activates when you ask about NetWorker, PPDM, Data Domain, or backup/restore operations.
/networker-ask Ask any NetWorker/PPDM question — answered by Claude Opus 4.7 using the domain knowledge base.
/ppdm-doctor Cross-product health check across PPDM + NetWorker + Data Domain.
/ppdm-failed-jobs Reports failed PPDM activities with root-cause hints. CI-friendly exit code.
/ppdm-sla SLA compliance report — surfaces non-compliant assets with remediation suggestions.
/ppdm-backup Trigger on-demand PPDM backup, optionally polling until completion.
backup-engineer agent Senior-level deep-dive agent for complex multi-product troubleshooting. Use via the Agent tool with subagent_type: "backup-engineer".

Requirements: Claude Code 1.0.33+. Python 3.10+ on the machine running the slash commands (for the underlying scripts).

Coverage

Product Areas
PPDM REST API Assets · policies · protection rules · activities · restores · SLA compliance · alerts · credentials · RBAC · LDAP/AD · cloud tier · replication · copies · NAS · VMware · Kubernetes · database agents (Oracle / SQL Server / SAP HANA) · vProxy · diagnostics · upgrade
NetWorker REST API + CLI Clients · savesets · backup/restore · policy/workflow/actions · clone · storage nodes · devices · volumes · directives · notifications · NDMP · bootstrap/DR · lockbox
Data Domain REST API + CLI DDBoost · storage units · VTL · cloud tier · NFS/CIFS · encryption at rest · replication · dedup metrics · filesystem maintenance
CloudBoost Appliance registration · AWS S3 / Azure Blob profiles · NetWorker device integration
Kubernetes Full 10-step PPDM protection guide — CDI · VolumeSnapshot · RBAC · policy · restore · monitoring

Tests

Two suites — one for the Python library, one for the Claude Code skill.

Unit Tests

pip install -e ".[dev]"
python -m pytest tests/unit/          # 43 tests, fully mocked

Skill Validation Tests

pip install -r tests/requirements.txt
export ANTHROPIC_API_KEY=sk-ant-...

python tests/run_tests.py                          # all 105 tests
python tests/run_tests.py --category "Kubernetes"
python tests/run_tests.py --id ppdm_oracle_policy
python tests/run_tests.py --fail-fast
python tests/run_tests.py --verbose
python tests/run_tests.py --output results.json

Test Coverage — 105 cases across 44 categories

Area Tests
PPDM Core · Policies · Credentials · SLA · Alerts · System · RBAC · LDAP · App Host 19
PPDM Database (Oracle · SQL Server · SAP HANA) 5
PPDM Replication · Cloud Tier · Copies · NAS · VMware · Reports · Config · Diagnostics 18
PPDM Tags · vProxy · DDBoost 4
Kubernetes 7
NetWorker Core · Policy · Clone · Directives · Storage · Client · NDMP 19
DDBoost · Data Domain · VTL · Cloud Tier · Encryption · Users · SNMP · Syslog · NFS · CIFS · Dedup 20
CloudBoost · Cross-Product · Troubleshooting · Best Practices 10
Total 105

Sample output

networker-ppdm skill test runner
Model  : claude-haiku-4-5-20251001
Tests  : 105

  ✓ [ppdm_auth]         How do I authenticate to the PPDM REST API...
  ✓ [ppdm_list_assets]  Show me the PPDM REST API call to list all assets...
  ✓ [k8s_prerequisites] What are the prerequisites before registering a Kubernetes cluster...

────────────────────────────────────────────────────────────
  Total  : 105  ·  Passed : 104  ·  Failed : 1  ·  Score : 99.0%
────────────────────────────────────────────────────────────

Adding tests

# tests/test_cases.yaml
- id: my_new_test
  category: PPDM Core
  prompt: "How do I do X in PPDM?"
  assertions:
    - "keyword1"
    - "endpoint/path"

License

This project is licensed under the MIT License — see LICENSE for details.


Built by Moodswing9 · Portfolio

About

Dell EMC NetWorker, PPDM & Data Domain — Python REST API clients, unified backupctl CLI, and a Claude Code plugin (skill + 12 slash commands + 2 agents) for backup/restore, DR orchestration, anomaly detection, and DDBoost automation.

Topics

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages