GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python_code_samples_network/NC-get-config-xpath at master · CiscoDevNet/python_code_samples_network

Expand file tree

/

NC-get-config-xpath

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

NC-get-config-xpath

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
NC-get-config-xpath.py
NC-get-config-xpath.py
 
 
README.md
README.md
 
 

README.md

Outline

NETCONF get-config with XPATH

This is an example Python script that utilizes get-config. It also takes advantage of XPATH filtering for NETCONF available in IOS-XE.

The script calls the get-config verb in NETCONF, and then filters the request to the native model, and also asks for just the data in the hostname container. The data you get back should be the hostname (or more specifically the configured hostname).

For a human, this is roughly equivalent to 'show running-config | include hostname'

requirements

-- ncclient

-- IOS-XE running >/= 16.3.1 also enabled for NETCONF

running

-- Can run on-box or off-box.

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.