1 00:00:05,939 --> 00:00:13,380 Now we can use standard commands like show interface VLAN 100. 2 00:00:14,370 --> 00:00:20,670 And that shows us standard information like we would get on any other type of device so we can see as 3 00:00:20,670 --> 00:00:28,470 an example demo, please don't touch IP addresses this, but what we could do is we can send that to 4 00:00:28,470 --> 00:00:29,310 JSON. 5 00:00:29,610 --> 00:00:35,310 So let's just use JSON and we get to the Jason information like that. 6 00:00:35,400 --> 00:00:38,280 But it's not very easy to read. 7 00:00:38,280 --> 00:00:40,410 So let's use Jason pretty. 8 00:00:41,070 --> 00:00:42,870 So Jason pretty. 9 00:00:44,160 --> 00:00:45,270 There's our information. 10 00:00:45,270 --> 00:00:50,600 So show interface, VLAN 100, we see the JSON formatting. 11 00:00:50,610 --> 00:00:53,430 Notice the curly braces. 12 00:00:54,090 --> 00:00:57,450 We've got information about this interface. 13 00:00:57,630 --> 00:00:58,890 VLAN 100. 14 00:00:59,460 --> 00:01:12,630 Important to note key value separated by a colon, then a comma key value again comma at the end, double 15 00:01:12,630 --> 00:01:13,980 inverted commas. 16 00:01:14,250 --> 00:01:15,510 Very important. 17 00:01:15,540 --> 00:01:18,660 Lost entry doesn't have a comma at the end. 18 00:01:19,050 --> 00:01:22,500 Data is contained within curly braces. 19 00:01:22,500 --> 00:01:31,230 So this data has these curly braces, table interface has these curly braces, and then we've got the 20 00:01:31,230 --> 00:01:33,660 all encompassing curly braces. 21 00:01:33,990 --> 00:01:41,610 So that's an example practically of JSON formatting versus show interface. 22 00:01:41,640 --> 00:01:43,680 VLAN 100 Standard Command. 23 00:01:43,860 --> 00:01:47,430 This is a format that we as humans would understand. 24 00:01:48,390 --> 00:01:53,130 But this is a format that a machine will understand much better. 25 00:01:53,250 --> 00:01:57,630 So just remember, we want to have standard formatting for machines. 26 00:01:58,170 --> 00:02:03,990 As an example, show IP interface brief here gives us a list of interfaces on the device. 27 00:02:04,230 --> 00:02:06,450 That's human readable format. 28 00:02:06,450 --> 00:02:12,940 But if we say JSON pretty, this gives us the information in JSON formatting. 29 00:02:12,960 --> 00:02:16,080 Show IP interface brief pipe JSON pretty. 30 00:02:16,380 --> 00:02:18,530 Notice there's a big difference here. 31 00:02:18,540 --> 00:02:21,360 We have the square brackets. 32 00:02:21,360 --> 00:02:25,110 So row interface, square bracket scrolling down. 33 00:02:25,260 --> 00:02:27,240 Now the link may be quite slow here. 34 00:02:27,270 --> 00:02:30,360 My internet connection to the dev side is quite slow. 35 00:02:30,630 --> 00:02:33,780 But notice here is the next square bracket. 36 00:02:33,810 --> 00:02:37,650 Here we've got data within curly braces. 37 00:02:37,920 --> 00:02:44,790 Again, notice no comma at the end here, but this has curly braces. 38 00:02:45,480 --> 00:02:47,130 And a comma at the end. 39 00:02:47,520 --> 00:02:51,810 The data within here is key value comma. 40 00:02:52,080 --> 00:02:54,300 Now the reason why we have. 41 00:02:55,030 --> 00:02:57,880 Square brackets is because. 42 00:02:59,690 --> 00:03:02,030 We are using what's called an array. 43 00:03:02,900 --> 00:03:05,150 In this slide, I've kind of summarized it. 44 00:03:05,180 --> 00:03:12,530 Notice that curly braces here, we've got square brackets, and inside here we've got an ordered list 45 00:03:12,530 --> 00:03:13,820 of values. 46 00:03:14,750 --> 00:03:17,840 The reason why we want this is because we've got multiple interfaces. 47 00:03:17,840 --> 00:03:24,290 So we've got interface VLAN 100 and then here we've got interface VLAN 200 and information about those 48 00:03:24,290 --> 00:03:25,130 interfaces. 49 00:03:25,430 --> 00:03:31,760 So rather than just showing information about one interface, so a single object, we've now got an 50 00:03:31,760 --> 00:03:34,820 array of interfaces that we're looking at. 51 00:03:35,330 --> 00:03:40,160 So an array in JSON is an ordered list of values, uses square brackets. 52 00:03:40,250 --> 00:03:44,900 It can store all kinds of data, so it could store things such as strings. 53 00:03:44,960 --> 00:03:47,060 String is like a sentence. 54 00:03:47,060 --> 00:03:48,140 Hello or a word. 55 00:03:48,140 --> 00:03:48,740 Hello. 56 00:03:48,740 --> 00:03:54,710 Whereas a number is something like one or two or 2.1, two, three. 57 00:03:55,190 --> 00:04:01,160 We've also got booleans objects, nulls and it can even store another array with inside of it. 58 00:04:01,790 --> 00:04:04,790 Values must be separated by commas once again. 59 00:04:05,770 --> 00:04:11,080 So notice once again that an object doesn't have those square brackets. 60 00:04:12,010 --> 00:04:14,770 This is the output for show version json. 61 00:04:14,770 --> 00:04:17,680 Pretty important here comma. 62 00:04:18,600 --> 00:04:19,380 Comma. 63 00:04:19,649 --> 00:04:20,760 No comma. 64 00:04:21,700 --> 00:04:26,020 We've got the key value pair separated by a colon. 65 00:04:26,260 --> 00:04:28,510 Make sure that you know this formatting. 66 00:04:28,540 --> 00:04:30,580 I've said that enough times now, I think. 67 00:04:31,830 --> 00:04:35,430 So he has an example once again of show interface VLAN 100. 68 00:04:35,640 --> 00:04:38,970 Again, you can download this PowerPoint slides that you have all this information. 69 00:04:39,180 --> 00:04:47,340 I've given you a few examples of that, but again, it's much easier to see this practically. 70 00:04:47,340 --> 00:04:54,180 And I'm going to take this to the next level now by showing you how to run Python on this Nexus box 71 00:04:54,180 --> 00:04:55,830 and do stuff in Python. 72 00:04:55,830 --> 00:05:00,510 And then I'm going to show you how to access the box remotely using a Python script that I'm going to 73 00:05:00,510 --> 00:05:05,550 run on my local computer and then pull out similar JSON information. 74 00:05:06,520 --> 00:05:06,850 Now. 75 00:05:06,850 --> 00:05:12,020 Again, you don't need to learn the Python scripting for the exam, but it's well worth learning this 76 00:05:12,040 --> 00:05:13,180 for the real world.