|
2 | 2 |
|
3 | 3 | Let's take a look at the Get Network Devices endpoint. A Network Device transports data to/from host devices or other network devices. A network device is typically a hub, switch or router and can be connected by an Ethernet cable or can have a wireless connection. Our goal here is to find the network devices and display information about them.
|
4 | 4 |
|
5 |
| -You can look at the details of the Get Network Device API from the -- <a href="http://devnetapic.cisco.com/" target="_blank">APIC-EM API Docs</a>. |
| 5 | +You can look at the details of the Get Network Device API from the [APIC-EM API Docs](http://devnetapic.cisco.com/). |
| 6 | + |
| 7 | +1. Set up the API Call in Postman: Use the service ticket to authorize a request to GET the network devices from the controller. |
6 | 8 |
|
7 |
| -1. Setting up the API Call in Postman |
8 |
| - * Now, let's use the service ticket to authorize a request to GET the network devices from the controller. <br/><br/> |
9 | 9 | <br/><br/>
|
10 |
| -2. Enter the information as shown below for our request to retrieve the list of network devices into the appropriate Postman fields: |
| 10 | +2. To retrieve the list of network devices, enter the information in the appropriate Postman fields, as shown here: |
11 | 11 | * **Method**
|
12 |
| - * `A.` Select **GET**. |
| 12 | + * **A.** Select **GET**. |
13 | 13 | * **URL**
|
14 |
| - * ``B.`` Enter `http://{APIC-EMController}/api/v1/ticket` |
15 |
| - * If you are not using your APIC-EM controller, use the Always-On APIC-EM Lab: <a href="https://devnetapi.cisco.com/sandbox/apic_em">https://devnetapi.cisco.com/sandbox/apic_em</a>. |
| 14 | + * **B.** Enter `http://{APIC-EMController}/api/v1/network-device` or, if you are not using your own APIC-EM Controller, enter the Always-On APIC-EM Lab controller`https[]()://devnetapi.cisco.com/sandbox/apic_em`. |
16 | 15 | * **Headers**
|
17 |
| - * `C.` Enter the 'Content-Type' and value 'application/json' |
18 |
| - * `C.` Enter the 'X-Auth-Token' and the service ticket created earlier. The 'X-Auth-Token' is required for all APIC-EM Controller API calls. |
| 16 | + * **C.** Enter the `Content-Type` and value `application/json`. |
| 17 | + * `C.` Enter `X-Auth-Token` and the value of the service ticket created earlier. |
19 | 18 | * **Authentication**
|
20 |
| - * Handled in the Headers |
| 19 | + * Is handled in the Headers. |
21 | 20 | * **Body**
|
22 |
| - * not required for this request |
| 21 | + * Not required for this request. |
23 | 22 | 3. Click **Send**.
|
24 |
| -4. Postman sends the request to the server and displays the **Response Code**, '200 OK', in **Status**. |
| 23 | +4. Postman sends the request to the server and displays the **Response Code**, `200 OK`, in **Status**. |
25 | 24 | * You can see that **JSON** contains the list of hosts that was returned.
|
26 | 25 |
|
27 | 26 | The output should look similar to the example. For display purposes, some records have been removed.
|
28 |
| -  |
| 27 | + |
| 28 | + |
29 | 29 |
|
30 | 30 | ### Things to Try
|
31 |
| -* In Postman append to '/1/2' to the call http://{APIC-EMController}/api/v1/network-device so reads as 'http://{APIC-EMController}/api/v1/network-device/1/2' . Click the **Send** button. How does the output differ? |
32 |
| -* Compare the change you just made in Get Network Devices API call versus the change you made in the Get Hosts call in the previous exercise of Step 7. How are they different and why? Hint: Check the API Reference Guide for each of these API calls. |
33 |
| -* In Postman change the API call 'http://{APIC-EMController}/api/v1/network-device/1/2' to 'http://{APIC-EMController}/api/v1/user'. Press the *Send* button. How is the returned data different and what does it represent? Hint: Check the API Reference Guide |
| 31 | +* In Postman, append `/1/2` so the call becomes `http://{APIC-EMController}/api/v1/network-device/1/2` and click **Send**. How does the output differ? |
| 32 | +* Compare the change you just made in *Get Network Devices API* call versus the change you made in the *Get Hosts* call in the previous exercise of Step 7. How are they different and why? Hint: Check the API Reference Guide for each of these API calls. |
| 33 | +* In Postman, change the API call `http://{APIC-EMController}/api/v1/network-device/1/2` to `http://{APIC-EMController}/api/v1/user` and click **Send**. How is the returned data different and what does it represent? Hint: Check the API Reference Guide |
34 | 34 |
|
35 | 35 | ### Congratulations! You've just completed lab Coding 101 - REST API Basics!
|
0 commit comments