Network Programmability Foundation (10%)
ENAUTO · 30 questions
- A script polls 40 IOS XE switches and repeats the same request-and-retry block, error list included, in six places. Access-layer switches wait 5 seconds between retries while WAN edges wait 20, and a second scheduled script must import the same logic as-is instead of wrapping it in an object. Which Python structure should hold this shared network automation logic?
- A network engineer automates a controller job that takes several minutes to finish. The endpoint answers in under two seconds with HTTP 202 and a task identifier, but the office firewall drops idle connections after 30 seconds. How should the script retrieve the finished result from this asynchronous job?
- A platform team reviews a Python FastAPI service that fronts their network inventory. Clients POST /login first, the server then keeps a session object holding that client's device list, GET /devices returns the cached list, and a delete is triggered with GET /devices?action=delete. Which redesign would make the service follow REST resource naming and statelessness rules?
- Two contractors edit IOS XE backup scripts for a city network and overwrite each other's fixes, with no history or safe sharing. They need a repeatable team workflow for parallel edits and review. Which core git workflow implements clone, add, commit and push?
- A platform team keeps interface descriptions and shutdown state for 180 IOS XE switches in Git and wants one tool to enforce that code. Leadership also wants a saved plan showing pending changes before anything reaches the devices, plus a state file recording the last applied configuration for drift reports between scheduled runs. Which automation approach matches this desired-state, state-tracked workflow for IOS XE?
- You and a teammate both changed the same lines of the pipeline config file, so your feature branch and main have diverged. A reviewer asks you to merge main into your branch while both edits stay in the final file so CI passes. Which git conflict resolution preserves both changes in history?
- Your teammate says a branch only adds a feature to report.py. You stage inventory.py, then edit report.py and config.py locally, and git diff --cached prints one hunk for inventory.py with three plus-marked lines and one minus-marked line. Which change set does that output describe for the commit you are about to create?
- A team is building a service that triggers work on a device instead of reading stored data: a single request names the action, carries its parameters, and returns the result. The lead asks which API style the design follows and which network automation example matches it. Which API style and matching example belong in the design note?
- A platform team with 60 IOS XE switches must choose between Ansible and Terraform and wants an honest summary of how each tool's core pieces work. They care about listing targets, describing the desired configuration, and seeing drift before applying anything. Which statement correctly contrasts the Ansible inventory with the Terraform state file and plan?
- Two automation scripts on one jump host need different versions of the same Python library, and the system tools' packages must stay untouched. Which statement correctly describes what creating a virtual environment isolates?
- Two engineers share a Python automation repo where both edited the SD-WAN inventory parser on separate branches and Git blocks the merge with conflict markers in the same function. The main branch must stay deployable and history must show the fix. Which branching and merging workflow resolves the merge conflict?
- The nightly job that exports 5,000 device records from a paginated REST API often stalls or ends incomplete: the service returns 500 records per page, throttles bursts with 429 plus Retry-After, and occasionally returns an internal server error. Which change to request handling is most likely to improve completeness and accuracy?
- An automation client calls a controller endpoint that handles heavy jobs and replies with HTTP 202 plus a task link in the Location header instead of returning the final data. The controller documents that the task URL returns the current status immediately. The client still needs the finished report for its weekly compliance workbook. Which asynchronous consumption pattern should the client use to retrieve the completed result?
- A network team stores desired IOS XE interface descriptions, VLANs and SNMP settings in git and wants a nightly run that reports which supported tasks would change, changes nothing when devices already comply, and writes no separate state file. Which automation approach satisfies all three requirements?
- After cloning the team repository, you edited snmpcollector.py and README.md, but only the script change is ready to share with the team right now. The shared remote branch is where everyone pulls from. Which git command sequence records exactly that one file as a new commit and publishes it to the shared remote?
- During a change window you review a small Python snippet that summarizes show ip interface brief data across three switches, each returning Gi1/0/1 to Gi1/0/4, so twelve records share four repeated names. Nine state values are up, two are down, one is administratively down. The script appends r["int"] to up when r["state"] == "up" and to down otherwise. What does each list hold when the loop finishes?
- A campus network team is replacing a legacy NMS integration with a REST service covering 3,000 access switches. Clients must fetch a device by its ID, change only the description field, and keep working after a load-balancer failover with no sticky session. Which REST design for resources, methods and state handling best fits these requirements?
- A NetDevOps team reviews a pull request that automates QoS on Catalyst switches. The git diff shows hunks with + and - lines across two files, one staged change, and one unstaged edit. The reviewer must confirm only the intended policy-map change will commit. Which reading git diff output behavior should the reviewer use to see what changed accurately?
- A platform team is documenting two endpoints on the same router: one address triggers a reboot action for a device, and a second address returns that device's configuration object so it can be read or replaced. The architects want new engineers to see how the two call styles are actually shaped. Which statement correctly contrasts the action-style call with the REST resource call?
- A three-person team runs 60 IOS XE switches across two sites. The host list lives in a CSV file, and today every change means editing a one-off Python script for each switch. The lead wants reusable playbooks driven by that inventory so every switch converges on the same declared configuration. Which inventory-and-playbook design fits their IOS XE automation?
- A monitoring platform calls an on-premises controller that follows link-based paging, where each JSON body carries a links.next URL until the final page. The service also answers HTTP 429 with a Retry-After header containing a delay in seconds whenever a client sends requests faster than its stated limit. You need a loop that collects every record without tripping the throttle. Which request-handling pattern satisfies both the paging and rate-limit rules?
- In a monitoring script you are reviewing, the Device class defines a class-level vendor = "Cisco" attribute, and every instance stores its own name set in init. The script runs d1 = Device("core1"), d2 = Device("edge2"), then executes d1.vendor = "Arista". Which values do d1.vendor, d2.vendor and Device.vendor each show afterwards?
- Two engineers pushed changes to main and to a feature branch, and both edited the same lines of inventory.yaml. After git merge feature, Git stops and marks the file as conflicted. The lead wants both edits kept, the conflict settled in the working tree, and history to show a true merge. Which git command sequence keeps both edits and completes the merge?
- A developer built a small lab inventory API. Reading is GET /api/devices/101, deleting a device is GET /api/devices/101?delete=true, and the service stores each client's last filter so the next call can return the next page. The reviewer wants one change that matches REST principles. Which single revision best brings the lab inventory API in line with REST method and statelessness rules?
- A teammate sends the link to your team's IOS XE golden-config repository, and you have never cloned it on this laptop. Your local copy will also hold two unrelated scratch files that must stay out of this commit, so you need to stage only your file, commit with a short message, and push for review. Which git workflow completes your first contribution correctly?
- A team is designing a Python client for routers that support both NETCONF and RESTCONF. For actions like committing a candidate configuration, the engineer wants the client to name a specific operation, send parameters to it, and receive a reply produced by that operation. Which API style should the design use to model these action calls?
- You maintain automation scripts on a shared Linux jump host used by three engineers, and every script must keep using the host's Python installation. One teammate pinned an older library version for an IOS XE backup job while your new Meraki script needs a newer release, and a fresh pin should take effect as soon as pip installs it. Which approach isolates each project's pinned dependencies while keeping the host interpreter?
- You review a teammate's automation changes before merging. Running git diff main -- playbook.yml in the repo prints one hunk: @@ -40,6 +40,8 @@ followed by three - lines, five + lines, and three unchanged context lines. What does that hunk header report about how the file changed?
- An automation engineer reviews a Python inventory script that loops over a list of hostnames, looks each one up in a dictionary of assigned roles, and prints a hostname only when the role equals 'spine'. For inventory {'leaf1': 'leaf', 'spine1': 'spine', 'spine2': 'spine'} and hosts ['leaf1', 'spine1', 'spine2'], which output does the script produce?
- An engineer's Python service triggers a bulk rollout through a network controller that can run for several minutes per device. The controller accepts each request with HTTP 202 and returns a task identifier, and the script must report the final outcome while keeping worker processes free and submitting the job only once. Which API consumption pattern should the script use to follow the rollout to completion?