The JUNOScript API (application programming interface) is an Extensible Markup Language (XML) application that client applications use to request and change configuration information on routing platforms that run the JUNOS software. The operations defined in the API are equivalent to configuration mode commands in the JUNOS command-line interface (CLI). Applications use the API to display, edit, and commit configuration statements (among other operations), just as administrators use CLI configuration mode commands such as show, set, and commit to perform those operations.
The JUNOS XML API is an XML representation of JUNOS configuration statements and operational mode commands. JUNOS XML configuration tag elements are the content to which the operations in the JUNOScript API apply. JUNOS XML operational tag elements are equivalent in function to operational mode commands in the CLI, which administrators use to retrieve status information for a routing platform. The JUNOS XML API also includes tag elements that are the counterpart to JUNOS configuration statements.
Client applications request or change information on a routing platform by encoding the request with tag elements from the JUNOScript and JUNOS XML APIs and sending it to the JUNOScript server on the routing platform. (The JUNOScript server is integrated into the JUNOS software and does not appear as a separate entry in process listings.) The JUNOScript server directs the request to the appropriate software modules within the routing platform, encodes the response in JUNOScript and JUNOS XML tag elements, and returns the result to the client application. For example, to request information about the status of a routing platform’s interfaces, a client application sends the <get-interface-information> tag element from the JUNOS XML API. The JUNOScript server gathers the information from the interface process and returns it in the <interface-information> tag element.
This manual explains how to use the JUNOScript and JUNOS XML APIs to configure Juniper Networks routing platforms or request information about configuration or operation. The main focus is on writing client applications to interact with the JUNOScript server, but you can also use the JUNOScript API to build custom end-user interfaces for configuration and information retrieval and display, such as a Web browser–based interface.
This chapter discusses the following topics: