This repository is deprecated; please follow the main search page or use the ‘Related code repos’ widget on the right side of the current page.

Background

Cisco's DNA Center is a centralized network control and management dashboard for Cisco DNA, an intent-based networking solution.

This project provides a sample Java application and client libraries to access the Center as a Platform REST APIs for the Java language. The included sample application performs the following functions:

  • Authenticates with DNA Center
  • Retrieves a count of the number of networking devices listed in the inventory
  • Displays a high level summary of the networking devices listed in the inventory

By default the sample application has disabled SSL certificate checking when connecting to DNA Center, but this can be re-enabled if desired.

Requirements

This Java sample application is a Maven project, the following is also required:

Java Dna Client API is required to run this sample, it should be included in the download package zip file.

Setup

To run using an IDE

  • Install Java.
  • Install Eclipse.
  • Clone or download ZIP file.
  • Unzip the downloaded ZIP file.
  • Open Eclipse and specify the DNAC_JAVA-SDK-master directory created by unzip as your workspace.
  • If prompted with a popup called "Discover m2e connectors", just click the "Finish" button, then follow the prompts to install the connectors, including the unsigned driver install. An Eclipse restart may be required.
  • In Eclipse File -> Import -> Existing Maven Projects, Browse for and select DnacAppApi directory, Click Finish.
  • In Eclipse File -> Import -> Existing Maven Projects, Browse for and select ClientApiTester directory, Click Finish.
  • Edit the Application.java file in the ClientApiTester project and set username, password and basePath (DNAC server Ipaddress).
  • You can then run the ClientApiTester by opening up the Application.java file, right click on the open window and select "Run As" and select "Java Application".

To run using command line

  • Edit the Application.java file in the ClientApiTester project and set username, password and basePath (DNAC server Ipaddress).
  • Change into the DnacAppApi directory and run the command:
mvn clean install
  • Change into the ClientApiTester directory and run the command:
mvn clean install
  • To run the sample program, from the ClientApiTester/target directory run the following command:
java -cp ClientApiTester-1.0.1-SNAPSHOT-jar-with-dependencies.jar com.cisco.dna.ClientApiTester.Application
View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.