Automation and Programmability Flashcards

1
Q

What does REST stand for?

A

Representational State Transfer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the 6 guidelines of a REST API? (The top 3 are most important to network developers)

A

1.) Client/Server Separation
2.) Stateless
3.) Cacheable
4.) Uniform Interface
5.) Layered System (separation of concerns)
6.) Code On Demand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Given the following URL, identify the Protocol, the Server, the Resource and the Parameter: https://domain.com/api/v1/servers?=windows

A

protocol = “https”
server = “domain.com”
resource = “/api/v1/servers”
parameter = “?=windows”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the HTTP verbs to Create, Read, Update, and Delete (CRUD)?

A

Create - POST
Read - GET
Update - PATCH (or PUT)
Delete - DELETE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the meaning of the following HTTP response codes:
- 1xx (100)
- 2xx (200)
- 3xx (300)
- 4xx (400)
- 5xx (500)

A

1xx - Informational
2xx - Successful
3xx - Redirect
4xx - Client error
5xx - Server Error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the difference between HTTP 401 and 403 codes?

A

401 (Unauthorized) - Not authenticated

403 (Forbidden) - Authenticated, but not permitted to access the resource

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the HTTP response code of 201?

A

Created (Success) - Note the response BODY may not include any content

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the three most popular data serialization languages?

A

XML
JSON
YAML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is one security issue related to a well documented API?

A

Reverse Engineering

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are some common methods to secure a REST API?

A
  • Use SSL for connection
  • Maintain Statelessness (do not keep sessions open)
  • Use authentication
  • Use authorization
  • Rate limits (Brute Force Protection)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the most common methods to authenticate to an API?

A
  • Basic Authentication (Username : Password)
  • API Key
  • Token-Based (token refresh)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is YANG?

A

Industry Standard for how data models are structured in Netconf payloads - a data modeling Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the 4 primary elements to a YANG model?

A

Module > Container > List > Leaf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the URL to fetch capabilities from a Cisco IOS-XE device using RESTconf?

A

https://DEVICENAME/restconf/data/netconf-state/capabilities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is it called when a network vendor creates their own YANG data models for their hardware?

A

Native (Data Models)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Using Python, define a string called name with the value of Bob.

A

name = “bob”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Using Python, define an integer named quantity with the value of 100

A

quantity = 100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Using Python, define a boolean called isEnabled with the value of true.

A

isEnabled = True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Using Python, define a list called ip_addresses with any three IP addresses in the list.

A

ip_addresses = [“10.10.10.1”, “192.168,44,12”, “172.16.21.9”]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Using Python, define a tuple called ip_addresses with any three IP addresses in the tuple.

A

ip_addresses = (“10.10.10.1”, “192.168,44,12”, “172.16.21.9”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the difference between a tuple and a list?

A

Tuple is immutable meaning that the values cannot be changed.

22
Q

Using Python, define a dictionary with any three IP addresses that use the names R1, R2, and R3 as the keys for the IP addresses.

A

ip_addresses = {“R1”: “10.10.10.1”, “R2”: “192.168,44,12”, “R3”: “172.16.21.9”}

23
Q

Using Python, define an If/Else statement that looks to see if variables named r1, r2, or r3 has an IP address of “10.1.1.1”?

A

if r1 == “10.1.1.1”:
print(“Yes!)
elif r2 == “10.1.1.1”:
print(“Yes!)
elif r3 == “10.1.1.1”:
print(“Yes!”)
else:
print(“No!”)

24
Q

Using Python, define a loop that continues to execute as long as the value for isEnabled is true

A

while isEnabled == true:
print(“Still enabled…”)

25
Using Python, define a for loop that prints all the IP addresses in a list called ip_addresses
for ip_add in ip_addresses: print(ip_add)
26
Using Python, define a loop using the range keyword that prints the numbers 0 to 19
for x in range(20): print(x)
27
Using Python, define a function that takes an IP address as an argument and adds it to a list of ip_addresses. Then call the function and pass a value.
def append_ip(ip_address): ip_addresses.append(ip_address) print(ip_address + " added to the list") append_ip("10.1.1.1")
28
Using Python, define a class named Server with attributes of ip_address and os_version with a function called boot that just prints a simple message.
class Server(): ip_address = "10.10.10.1" os_version = "Windows 2016" def boot(self): print("The server is booting!")
29
How does SD-WAN vManage use REST APIs?
For admins to program vManage policies using scripts.
30
How does SD-WAN vManage use NETCONF?
To push policy from vManage to vSmart
31
In DNA Center, what are the Northbound, Southbond, Westbound, and Eastbound APIs used for?
Northbound - Intent API; DNA Center Config Southbound - Multivendor SDKs for underlay (NETconf) Eastbound - Events and Notifications (Webhooks) Westbound - Integrations (ITSM, Monitoring, Assurance)
32
What are the commands to enable RESTCONF and NETCONF on a Cisco device?
R1(config)# ip http secure-server R1(config)# restconf
33
What is the URL to access RESTCONF IETF Interface data on a Cisco Device?
https://{ip-address}/restconf/data/ietf-interfaces:interfaces
34
What is the basic command to begin creating an EEM applet on a Cisco device?
R1(config)# event manager applet NAME
35
What are some events an EEM applet can use to trigger an action?
- CLI pattern via regex - Syslog event pattern - SNMP OID - Timer (CRON Job)
36
What is the command to create an EEM event?
R1(config-applet)# event {{type}} {{options}}
37
What is the command to create an EEM action?
R1(config-applet)# action WORD {{type}} {{options}}
38
What is the best practice for an EEM action WORD?
To use incremental numbers, often times incrementing by 0.5 such as: "action 1.0", "action 1.5", "action 2.0", etc.
39
What are the common types of EEM actions that could be executed?
- Commit a CLI command (or series of commands) - Enter a Syslog message - Use programmatical logic (loops, if-else, etc) - SNMP events - Reload
40
What is the command to fire a EEM event on demand?
R1# event manager run NAME
41
What command will show all valid EEM applets?
R1# show event manager policy registered
42
When using ansible, what is the command to invoke the ping module?
ansible device_group_name -m ping
43
When using ansible, what is the command to run a playbook?
ansible-playbook my_playbook.yaml
44
What does it mean that Ansible uses "Idempotency"?
It only commits a change when it sees a change is needed.
45
In ansible, what are the three tiers of configuration you will find in a playbook?
Playbook > Plays > Tasks
46
What are a couple major differences between Ansible and Puppet?
- Ansible pushes configuration, while Puppet uses a "pull" model - Ansible is Agentless while Puppet uses Agents NOTE: Puppet Bolt is Agentless - Ansible only pushes changes while Puppet holds full configurations - Ansible is Python-based, Puppet is Ruby-based - Ansible uses playbooks while Puppet uses a Database - Puppet is preferred for Configuration Management (DevOps)
47
When using Puppet, what are the Tiers of configuration elements called?
Module > Manifest(s) > Classes > Resources
48
What are some key characteristics of Chef?
- Ruby-based - Agent-Based - Configuration uses "pull" model - Admin client is called a "Knife"
49
When using Chef, what are the Tiers of configuration elements called?
Bookshelf > Cookbook > Recipes > Resources
50
What are some key characteristics of SaltStack?
- Python-based (can interact with Master using Python) - Agent-based - uses Zero MQ (very fast messaging platform) - Instructions sent in YAML - Event Driven
51
Which of these Automation Tools are Agent-Based and which are Agentless? (Puppet, Puppet Bolt, Chef, Ansible, SaltStack, SaltStack SSH
Agent-Based: Puppet, Chef, SaltStack Agentless: Ansible, Puppet Bolt, SaltStack SSH
52
Which two Automation Tools use YAML?
Ansible and SaltStack