Skip to main content

A CLI tool to perform a pre-change validation on Nexus Dashboard Insights or Network Assurance Engine.

Project description

Tests Python Support

nexus-pcv

A CLI tool to perform a pre-change validation on Nexus Dashboard Insights. It can either work with provided JSON file(s) or a terraform plan output from a Nexus as Code project. It waits for the analysis to complete and evaluates the results.

$ nexus-pcv -h
Usage: nexus-pcv [OPTIONS]

  A CLI tool to perform a pre-change validation on Nexus Dashboard Insights.

Options:
  --version                  Show the version and exit.
  -v, --verbosity LVL        Either CRITICAL, ERROR, WARNING, INFO or DEBUG.
  -i, --hostname-ip TEXT     ND hostname or IP (required, env:
                             PCV_HOSTNAME_IP).
  -u, --username TEXT        ND username (required, env: PCV_USERNAME).
  -p, --password TEXT        ND password (required, env: PCV_PASSWORD).
  -d, --domain TEXT          ND login domain (optional, default: 'local', env:
                             PCV_DOMAIN).
  -g, --group TEXT           NDI insights group name (optional, default:
                             'default', env: PCV_GROUP).
  -s, --site TEXT            NDI site or fabric name (required, env:
                             PCV_SITE).
  -n, --name TEXT            NDI pre-change validation name (optional, env:
                             PCV_NAME).
  --suppress-events TEXT     NDI comma-separated list of events to suppress
                             (optional, default: 'APP_EPG_NOT_DEPLOYED,APP_EPG
                             _HAS_NO_CONTRACT_IN_ENFORCED_VRF', env:
                             PCV_SUPPRESS_EVENTS).
  --timeout INTEGER          NDI pre-change validation timeout in minutes
                             (optional, default: 15, env: PCV_TIMEOUT).
  -f, --file FILE            NDI proposed change JSON file (optional, env:
                             PCV_FILE).
  -t, --nac-tf-plan FILE     NDI proposed change Terraform plan output
                             (optional, env: PCV_NAC_TF_PLAN).
  -o, --output-summary FILE  NDI summary of new events/anomalies written to a
                             file (optional, env: PCV_OUTPUT_SUMMARY).
  -r, --output-url FILE      NDI link (URL) to pre-change validation results
                             written to a file (optional, env:
                             PCV_OUTPUT_URL).
  -h, --help                 Show this message and exit.

Installation

Python 3.7+ is required to install nexus-pcv. Don't have Python 3.7 or later? See Python 3 Installation & Setup Guide.

nexus-pcv can be installed in a virtual environment using pip:

pip install nexus-pcv

CI/CD Integration

The tool can easily be integrated with CI/CD workflows. Arguments can either be provided via command line or environment variables. The tool will exit with a non-zero exit code in case of an error or non-suppressed events being discovered during the pre-change analysis. The --output-summary and --output-url arguments can be used to write a summary and/or a link (URL) to a file, which can then be embedded into notifications (e.g., Webex).

Nexus as Code Integration

Nexus as Code allows users to instantiate network fabrics in minutes using an easy to use, opinionated data model. More information about Nexus as Code can be found here. A planned change can be validated before applying it to a production environment by running a terraform plan operation first and then providing the output to nexus-pcv to trigger a pre-change validation.

export PCV_HOSTNAME_IP=10.1.1.1
export PCV_USERNAME=admin
export PCV_PASSWORD=Cisco123
export PCV_GROUP=LAB
export PCV_SITE=LAB1
terraform plan -out=plan.tfplan
terraform show -json plan.tfplan > plan.json
nexus-pcv --name "PCV1" --nac-tf-plan plan.json

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

nexus_pcv-0.2.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

nexus_pcv-0.2.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file nexus_pcv-0.2.0.tar.gz.

File metadata

  • Download URL: nexus_pcv-0.2.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1021-azure

File hashes

Hashes for nexus_pcv-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2ed5417eea865da32a6d025947f7906c262f63df767505f82e3886ffa714d641
MD5 68826a008aa80570c69c058dd4ec5465
BLAKE2b-256 b7b595de267b023ecbfff01544f5cc6e6eb8a6e401c787cad5eab6d24ef45627

See more details on using hashes here.

File details

Details for the file nexus_pcv-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nexus_pcv-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1021-azure

File hashes

Hashes for nexus_pcv-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f25cbbc744be88c1416a7843193f6f02507e5c5143a69e099eb06a6989dc866
MD5 777accf67c21448c07636cc9fe1f2243
BLAKE2b-256 fe5eed4e44aaa3e20beab1d35f4e859ae3d81af267054d21354f7f7067dbb3e9

See more details on using hashes here.

Supported by

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