The JUNOScript and JUNOS XML APIs are primarily intended for use by client applications; however, for testing you can establish an interactive JUNOScript session and type commands in a shell window. To connect to the JUNOScript server from CLI operational mode, issue the junoscript interactive command (the interactive option causes the JUNOScript server to echo what you type):
- user@host> junoscript interactive
To begin a JUNOScript session over the connection, emit the initialization PI and tag that are described in Emitting the Initialization PI and Tag. You can then type sequences of tag elements that represent operational and configuration operations, which are described in Requesting Information, Changing Configuration Information, and Committing a Configuration. To eliminate typing errors, save complete tag element sequences in a file and use a cut-and-paste utility to copy the sequences to the shell window.
![]() |
Note: When you close the connection to the JUNOScript server (for example, by emitting the <request-end-session/> and </junoscript> tags), the routing platform completely closes your connection instead of returning you to the CLI operational mode prompt. For more information about ending a JUNOScript session, see Ending a JUNOScript Session and Closing the Connection. |