In this recipe, we'll use Python's built-in standard library routines for HTTPS in order to access the Junos OS REST API. We'll build an example app, rest.py, that allows a user to make simple RPC calls. In order to control the operation of the application, we'll define some command-line arguments.
| Command line option | Description | 
| -t xml | json | text | Specify the output format | 
| -r rpc | Specify the actual RPC call | 
| -c certificate | Self-signed certificate from router | 
| -p port | HTTPS port number, default 8443 | 
| -u username | Username to authenticate with | 
 
                                             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
     
         
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                