Package: dnac-pnp
dnac-pnpCisco DNA center device claim and delete automationFeaturesBehaviourGitalike commandline user interfaceDefine user credentials and host for DNACRead configurations from fileConfigurations file lookup in 3 default locationsChecksPre-checks user inputsPre-checks csv file for bulk import (add+claim)Pre-checks txt file for bulk deletePre-check templatesPre-check and warning messages for template variablesPre-checks for valid sitesPre-checks for device statusImportSingle import of deviceBulk import devices from csvSingle site creationBulk site creationDeleteSingle device deletion, more than one device deletionBulk device delete from txt fileSingle/Multiple Device delete even after provisionDecisionDecision based on site status and device statusRead day0 templateDecide on day0 template parameters are provided properly or notShows day0 template parametersDay0 configurationViewShows all pnp devicesShows details about a single device by serial numberShows all available templatesShows specific template body and variables by full template nameShows all available locationsExportExport all PnP devices to csvDependenciesThis package requires a configuration file in either.yamlorymlformat. The look up priority for
the configuration file is as following-<user_home_directory>/.<package_name>/configs/config.yaml (Window/Linux/MacOS)<current_working_directory>/.<package_name>/configs/config.yaml (Windows/Linux/MacOS)/etc/<package_name>/configs/config.yaml (Linux/MacOS)Ifconfig.yamldoesn’t exists in one of these locations, the program will NOT run. So, to create the configuration
file, please use -WindowsWindows system by default doesn’t allow creation of.prefixed directory from GUI, so use the following -Opencmdand change the directory to thehomefolder of the userRunmkdir .dnac_pnpRuncd .dnac_pnpRunmkdir configsNow that the.prefixed directory is created, use the GUI to add a file inconfigsdirectory namedconfig.yaml. Once the file is created, open the file and add the following lines according to your preference ----dnac:host:sandboxdnac.cisco.comusername:<username>password:<secret_password>Linux/MacOSOpen a terminal andcdinto the home directory or any other directory form the above dependency list.Runmkdir-p.dnac_pnp/{catalog,configs}Runcd .dnac_pnp/configs/Runnano config.yamlAdd the above lines into the file and save itBulk Import DependencyWhile importing in bulk, a device catalog file can be put inside thecatalogfolder under.dnac_pnpwithDeviceImport.csvname at the program will automatically read this file.Windows.dnac_pnp\catalog\DeviceImport.csvLinux/MacOS.dnac_pnp/catalog/DeviceImport.csvNoteSamples files are available, in thedatadirectory of this repo.
The location of the catalog file can be provided with-fflag alsoUsageInstalling Virtual EnvironmentIt is highly recommended to usevirtual environmentfor this package. To know how to setup
the virtual environment please visitthis page.Installing the packageOnce you have virtual environment installed, clone this repository and move into therootdirectory of the project.Now, crate a virtual environment.virtualenv--always-copy-ppython3venvactivate virtual environment -Linux/MacOSsourcevenv/bin/activateWindowsvenv\Scripts\activate.batOnce thevirtual environmentis active, run the following command -pipinstall.Once the installation is finished, check out all the available options with -dnac_pnp--helpThis should give an output like below -(venv)C:\Users\user.name\folder\dnac-pnp>dnac_pnp --help
Usage: dnac_pnp [OPTIONS] COMMAND [ARGS]...

Mission control module

Options:
  --debug    Turns on DEBUG mode.  [default: False]
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  acclaim-devices  Add and claim single or multiple devices.
  add-sites        Add one or more sites.
  delete-devices   Delete single or multiple devices.
  pkg-info         Shows package information.
  show             Shows DNA center component information.To see the individual options for any of thecommandsuse--helpflag after the command.(venv)C:\Users\user.name\folder\dnac-pnp>dnac_pnp acclaim-in-bulk --helpTo use this package without any errors/bugs please always activate the virtual environment firstTo deactivate virtual environment use -deactivateCreditsSeeAUTHORS.rstThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History1.0.2b1 (2019-10-25)Second release with package missing error fixes1.0.1b2 (2019-09-23)Beta release 21.0.1b1 (2019-09-23)First beta release0.4.5 (2019-09-23)Major CLI look and fell changesBug fixes0.4.4 (2019-09-20)Bug fixes as CISCO api changes0.4.3 (2019-09-19)IOS device reset functionality addedListing of all available sitesSample data modificationsBug fixesNew api references addedBulk site creation0.4.2 (2019-08-30)Fixed skipped serial number bugRemoved pagination dependency0.4.1 (2019-08-29)Documentation updates0.3.5 (2019-08-29)Fixed template version mismatchAdded csv export functionality0.3.4 (2019-08-26)Documentation updates0.3.3 (2019-08-26)Separated token generatorModulated template functionality0.3.2 (2019-08-24)Fixed bug for auto buildTokenize dependency for setupRemoved .gz artifact storageAdded usage instructionsUpdated documentation tutorialsAdded delete option for pnp devicesChanged package dependency and encodingFixed PnP flag for delete commandsUpdated delete instructionsIntroduced aliased groupAdded template handlerAdded template validation0.3.1 (2019-08-20)Fixed documentation bugs for note and warning0.2.5 (2019-08-19)Added api documentationIntroduced first draft of documentation0.2.4 (2019-08-19)Adding Jenkinsfile for auto buildAdding jfrog-spec.json for artifact management0.2.3 (2019-08-14)Updated issue #13Ready for testing0.2.2 (2019-08-13)Fixed device delete bug (Issue #15)Updated Readme0.2.1 (2019-08-08)Added CSV file read and json conversionAdded input validation for bulk importFixed Host not found BUGAdded extra info to screen messages0.1.5 (2019-08-07)Decoupled authentication process0.1.4 (2019-08-07)Fixed version upgrade bugRemoved device type in configurations0.1.3 (2019-08-06)Added bulk import feature0.1.2 (2019-08-06)Updated loggingUpdated syntax in source codeAdded API calls for importing devicesBug fix - Import devicesAdded device type in configurationsChanged all log level default to DEBUGAdded device claimFixed issues0.1.1 (2019-08-02)Added nested cli commandsAdded import handlersAdded context management0.1.0 (2019-07-31)Added functionality to login to DNACRead configurations from fileDefault config locations for looking for configurations0.1.0 (2019-07-30)First release on GitLab.Adding LICENSECreating setup and structure