Skip to content

Lab 21.2 - Exploring Arista eAPI with Postman

This lab uses the Postman API Development Environment for your to explore Arista's eAPI.

Task 1 - Access the Arista eAPI through Postman

This task will focus on issuing "show" commands with Postman.

Note: For these tasks, use the eos-spine1 device.

Step 1-0

Remote Desktop into your Jump Host and open the Postman application on the Desktop.

On your first run of the application you may get a prompt to create an account. Please select Skip and go to the app, you do NOT need to create an account for this lab.

Postman

Step 1-1

Create a new "HTTP Request" by using the New button or pressing the + sign on the central bar.

Postman

Note: The Postman application will look similar to the screenshot in this lab - but, due to the fact that the application layout changes over time, the screenshots may not be exactly the same in your lab environment.

Step 1-2

We are now going to construct our first HTTP Request to get configuration data from the EOS device.

First, set the HTTP request type to POST.

Type

Step 1-3

In the Authorization tab, select Basic Auth for the Type and use ntc and ntc123 as the username and password, respectively.

Authentication

Step 1-4

In the Headers tab, add two header options: * Accept * Content-Type

Set both to application/json.

Headers

Step 1-5

Add the following URL in the text box next to the POST drop down:

https://eos-spine1/command-api

Step 1-6

Move to the Body pane and paste the following content:

{
    "jsonrpc": "2.0",
    "method": "runCmds",
    "params": {
        "format": "json",
        "timestamps": false,
        "cmds": [
            "show version"
        ],
        "version": 1
        },
    "id": "EapiExplorer-1"
}

Response

Step 1-7

Click the Send button to make the HTTP request.

Step 1-8

If it fails, check the prompt in the bottom pane - it's most likely telling you the SSL verification has failed due to self-signed certificates. Click the Disable SSL Verification button - you can always toggle this On/Off later from the global Postman settings.

Step 1-9

Re-click the Send button.

Step 1-10

You should see the JSON response in the bottom pane.

Scroll through the response object and take a deeper look.

Note that Status code is 200. This is a standard HTTP Response code and tells us that everything worked.

Response

Step 1-11

Change the command to show interfaces to get information about available interfaces.

Interfaces

Step 1-12

Re-click the Send button.

Step 1-13

Scroll through the response object.

IntfResponse

Task 2 - Make Configuration Changes

In this task we want to manage the configuration of a loopback interface.

Step 2-1

Modify the cmds field from the body by adding these commands:

  • enable
  • configure
  • interface lo200
  • ip address 10.200.200.1 255.255.255.0

Loopback

Step 2-2

Click the Send button to make the HTTP request.

LoopbackResponse

Step 2-3

Retrieve the Loopback configuration using the show interfaces lo200 command - try creating a new request (or duplicate the existing one):

LoopbackCmd

Step 2-4

Click the Send button to make the HTTP request.

LoopbackConfig