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 PHP application and client libraries to access the Center as a Platform REST APIs for the PHP 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 networkings 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

The following package must be installed prior to running the sample application:

The following package is required and can be installed with the included setup shell script:

Composer, when run, will automatically install a number of additional required PHP libraries.

Setting up with the included Setup Script

Once downloaded, run the included setup shell script.

> ./dnac_phpclient_setup.sh

Setting up Manually (Optional)

If you do not wish to use the included setup shell script, the following steps should be manually performed:

  • Download Composer
  • Run Composer Setup
     > php composer-setup.php
    
  • Run Composer to install required PHP libraries into the ./src directory
     > php ./composer.phar install -d ./src/
    

Configuring the Sample Script

Before you can run the included sample script (dnac_phpclient_test.php), you first must edit the file and specify the following variables specific to your DNA Center installation.

$DNACHost = ""; // IP Address or hostname of the DNA Center Cluster
$username = ""; // Administrator user name for DNA Center
$password = ""; // Administrator password for DNA Center

These variables allow the script to connect and authenticate with your DNA Center appliance.

Running the Sample Script

To run the sample script, execute the following command:

> php ./dnac_phpclient_test.php
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.