TechSupport CLI Tool
In version 6.10.5
of the ipfabric
Python SDK a new CLI tool was introduced to generate a tech support file.
After installing the package it can be run from the command line.
Requirements
Required environment variables exported (IPF_URL
and IPF_TOKEN
or IPF_USERNAME & IPF_PASSWORD
) or a
.env
file located in the current working directory or your home directory.
Installing rich
is required for this tool (pip install rich
or pip install ipfabric[cli]
).
Documentation
IPF TechSupport Help
# ipf_techsupport --help usage: ipf_techsupport [-h] [-s SNAPSHOT] [-b BASE_URL] [-t TOKEN] [-u USERNAME] [-p PASSWORD] [-uu UPLOAD_USERNAME] [-up UPLOAD_PASSWORD] [-ur {eu,us}] [-ut UPLOAD_TIMEOUT] [-dt DOWNLOAD_TIMEOUT] [-dr DOWNLOAD_RETRY] [-DR] Upload a techsupport file using IPFabric API. Environment variables can be exported or configured in the .env file. optional arguments: -h, --help show this help message and exit -s SNAPSHOT, --snapshot SNAPSHOT Snapshot to use which can be a UUID or one of ['last', 'prev', 'lastLocked']with or without `$` for *nix compatability. -b BASE_URL, --base-url BASE_URL Base URL for IPFabric API or IPF_URL env variable. -t TOKEN, --token TOKEN IP Fabric API Token or IPF_TOKEN env variable. -u USERNAME, --username USERNAME IP Fabric username (requires --password) or IPF_USERNAME env variable. -p PASSWORD, --password PASSWORD IP Fabric password or IPF_PASSWORD env variable. -uu UPLOAD_USERNAME, --upload-username UPLOAD_USERNAME Username for uploading the techsupport file or IPF_UPLOAD_USERNAME env variable. Default: techsupport -up UPLOAD_PASSWORD, --upload-password UPLOAD_PASSWORD Password for uploading the techsupport file or IPF_UPLOAD_PASSWORD env variable. -ur {eu,us}, --upload-region {eu,us} Server region for the upload or IPF_UPLOAD_REGION env variable. Default: eu -ut UPLOAD_TIMEOUT, --upload-timeout UPLOAD_TIMEOUT Timeout for the upload request in seconds. Default: 600 -dt DOWNLOAD_TIMEOUT, --download-timeout DOWNLOAD_TIMEOUT Timeout to wait for the download process in seconds. Default: 60 -dr DOWNLOAD_RETRY, --download-retry DOWNLOAD_RETRY How many times to wait --download-timeout before failing Default: 5 (5 Retries of 60 seconds each equals 5 minutes.) -DR, --dry-run Dry run the techsupport process without actually uploading the file.
TechSupport Generation Process
ipf_techsupport --upload-password {techsupport upload server} --dry-run [17:00:22] Initializing Techsupport API with base_url=https://demo1.us.ipfabric.io... [17:00:25] Dry run enabled. Skipping techsupport job creation...