Junos REST API setup
In this recipe, we'll prepare a Junos OS router for accessing the REST API in order to allow a software client to make RPC calls using convenient HTTP/HTTPS access methods.
Getting ready
In order to complete this recipe, you'll need access to a Junos OS router device running at least Junos 14.2 or later because the REST feature is relatively new. At the time of writing, it is available on T, M, MX, and SRX-series Juniper router devices.
How to do it...
The steps for the following recipe are as follows:
- Generate a private/public key-pair for a certificate using the Junos OS command line. Give the certificate a convenient name. In this case, we use the name
AUTO
:
adamc@router> request security pki generate-key-pair certificate- id AUTO Generated key pair AUTO, key size 1024 bits
- Use the key-pair to create a local self-signed certificate, specifying the domain name, the IP address and the general host name as the subject:
adamc@router> request security pki...