• All Courses

      Categories

      • Cisco Certifications
      • Juniper Certifications

      Recommended Courses

      Juniper JNCIA-Junos – NEW JN0-104 Complete Course
      Juniper JNCIA-DevOps – JN0-222 – Network Automation
      Cisco CCNA – 200-301 Complete Course
      Cisco CCDA – 200-310 – Network Design Complete Course
  • More
    • Become a Teacher
    • About Us
    • FAQs
  • Blog
  • Contact
  • Have any question?
  • (+1) 410 635 0231
  • help@ciscolessons.com
RegisterLogin

Login with your site account

Lost your password?

Not a member yet? Register now

Register a new account

Are you a member? Login now

CiscoLessons
  • All Courses

      Categories

      • Cisco Certifications
      • Juniper Certifications

      Recommended Courses

      Cisco CCNA – 200-301 Complete Course
      Cisco CCDA – 200-310 – Network Design Complete Course
      Juniper JNCIA-DevOps – JN0-222 – Network Automation
      Juniper JNCIA-Junos – NEW JN0-104 Complete Course
  • More
    • Become a Teacher
    • About Us
    • FAQs
  • Blog
  • Contact

    JNCIA-DevOps

    • Home
    • Blog
    • JNCIA-DevOps
    • Junos XML API Overview

    Junos XML API Overview

    • Posted by Ben Jacobson
    • Categories JNCIA-DevOps, Lessons, XML and NETCONF
    • Date May 14, 2022
    • Comments 0 comment

    In this lesson we’ll be talking about the XML API in more depth and really going over how the Juniper infrastructure uses the XML API on the back end. We’ll see how we can get more visibility into what exactly is going on when we try and enter commands into the CLI, or when we’re actually doing some XML API work through a NETCONF. So, let’s go ahead and jump right on in!

    XML is used to communicate between the Junos CLI and infrastructure

    When we enter commands into our CLI Junos actually converts our commands into XML RPCs when we press enter. Then it submits that XML RPC into the XML API so that we can gather information or apply configuration changes to our Junos device.

    The responses that we receive to these XML RPCs are also in XML. They are converted back into plain text format by the CLI process when we receive that information.

    Example flow ‘show route table inet.0’ for the XML API

    When we enter our show route table inet.0 command, as above, to be able to get all of our routing information for the inet.0, our IPv4 routing table, the CLI process actually converts this into our <get-route-information> XML RPC.

    In order to get the table inet.0, it’s adding in the <table> element as an argument with inet.0 as the content of that element.

    This XML RPC is submitted into the XML API of our device and that’s actually what is acted upon, rather than the command that we see in plain text above.

    This conversion is done using the data description models, which we don’t really need to know about for the JNCIA-DevOps. However, if you go further into the JNCIS-DevOps certification, you’ll learn what these files look like so that you could actually create your own CLI commands. Creating your own operational mode command in that fashion would be going a step further than just an OpScript, where we run on-box scripts from operational mode commands and display the output.

    When we’re entering in the show route table inet.0 command if we were to give the display modifier | display xml rpc to that command, then we would see our XML request that is being submitted.

    Example XML response that is parsed for the ‘show route table inet.0’ command

    When we get information back from our infrastructure it is also in XML, so that information is going to flow upwards like this. We see here our XML reply, our <rpc-reply> tag starting at the top. We have our <route-information> opening tag, and opening the <route-table> for the table named inet.0, and our information here that corresponds to the information displayed in plain text up top.

    Check out the full lesson video below for a full lab demonstration of the XML API and gathering XML RPC commands!

    Tag:api, automation, devops, jncia, jncia-devops, juniper, junos, rpc, xml

    • Share:
    author avatar
    Ben Jacobson

    Previous post

    XML Concepts and Syntax
    May 14, 2022

    Next post

    Languages Supported by the Junos XML API
    May 14, 2022

    You may also like

    lab.png
    Using Ansible
    4 June, 2022
    example_playbook_run.png
    Ansible Playbooks
    4 June, 2022
    sample_usage.png
    Ansible Inventory
    4 June, 2022

    Leave A Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    Popular Courses

    Cisco CCNA – 200-301 Complete Course

    Cisco CCNA – 200-301 Complete Course

    $39.99 $29.99
    Juniper JNCIA-DevOps – JN0-222 – Network Automation

    Juniper JNCIA-DevOps – JN0-222 – Network Automation

    $39.99 $19.99
    Juniper JNCIA-Junos – NEW JN0-104 Complete Course

    Juniper JNCIA-Junos – NEW JN0-104 Complete Course

    $39.99 $19.99

    Categories

    • 410 635 0231
    • Owings Mills, MD USA
    • contact@ciscolessons.com

    Company

    • About Us
    • Blog
    • Contact
    • Become a Teacher

    Links

    • Courses
    • Events
    • FAQs

    Support

    • Documentation
    • Forums

    All rights reserved CiscoLessons®

    • Privacy
    • Terms
    • Sitemap
    • Purchase