CCNP REST APIs and Data Models • Complete Question Bank
Complete CCNP REST APIs and Data Models question bank — all 0 questions with answers and detailed explanations.
A network engineer writes the following Python script using the Requests library to retrieve interface information from a Cisco IOS-XE device via RESTCONF:
```python
import requests import json
url = "https://10.1.1.1:443/restconf/data/ietf-interfaces:interfaces" headers = {
"Accept": "application/yang-data+json",
"Content-Type": "application/yang-data+json"
}auth = ("admin", "password") response = requests.get(url, headers=headers, auth=auth, verify=False)
print(response.json())
```
What is the primary issue with this code?
An engineer uses the following Ansible playbook to configure an interface on a Cisco IOS-XE device using the cisco.ios.ios_interfaces module:
```yaml --- - name: Configure interface hosts: cisco-routers gather_facts: no tasks: - name: Set interface description cisco.ios.ios_interfaces: config: - name: GigabitEthernet0/1 description: "Uplink to Core"
enabled: true
state: replaced ```
What is the result of running this playbook?
A network engineer is using the Cisco DNA Center REST API to retrieve the list of devices. The API call returns the following JSON response:
```json
{
"response": [
{
"id": "device-123",
"hostname": "Router1",
"managementIpAddress": "10.10.20.1",
"softwareVersion": "17.3.3",
"platformId": "ISR4451-X/K9"
},
{
"id": "device-456",
"hostname": "Switch1",
"managementIpAddress": "10.10.20.2",
"softwareVersion": "16.12.5",
"platformId": "C9300-24P"
}
],
"version": "1.0"
}```
The engineer wants to filter the results to only show devices with software version 17.3.3. Which of the following API query parameters should be used?
A network engineer writes a Python script using NAPALM to retrieve the ARP table from a Cisco IOS-XE device:
```python
from napalm import get_network_driver
driver = get_network_driver('ios') connection = driver('10.1.1.1', 'admin', 'password') connection.open() arp_table = connection.get_arp_table()
for entry in arp_table:
print(f"IP: {entry['ip']} - MAC: {entry['mac']}")connection.close() ```
What is the issue with this code?
An engineer configures model-driven telemetry on a Cisco IOS-XE device with the following gRPC dial-out configuration:
``` telemetry ietf subscription 101 encoding encode-kvgpb filter xpath /interfaces/interface/state/counters source-address 10.1.1.1 stream yang-push update-policy periodic 500 receiver ip address 10.2.2.2 50001 protocol grpc-tcp ```
What is the purpose of the 'encoding encode-kvgpb' command?
A network engineer uses the following Python script with Netmiko to send a command to a Cisco IOS-XE device:
```python
from netmiko import ConnectHandler
device = { 'device_type': 'cisco_ios', 'ip': '10.1.1.1', 'username': 'admin', 'password': 'password', 'secret': 'enable_secret'
}
connection = ConnectHandler(**device) output = connection.send_command('show ip interface brief')
print(output)
connection.disconnect() ```
What is the purpose of the 'secret' parameter in the device dictionary?
An engineer is using the Cisco IOS-XE RESTCONF API to create a new loopback interface. The following JSON payload is sent in a POST request to '/restconf/data/ietf-interfaces:interfaces':
```json
{"ietf-interfaces:interface": [
{
"name": "Loopback100",
"description": "Management Loopback",
"type": "iana-if-type:softwareLoopback",
"enabled": true,"ietf-ip:ipv4": {
"address": [
{
"ip": "192.168.1.1",
"netmask": "255.255.255.0"
}
]
}
}
]
}```
What is the correct HTTP method and URL for this operation?
An Ansible playbook uses the cisco.ios.ios_l3_interfaces module to configure an IPv4 address on GigabitEthernet0/1:
```yaml --- - name: Configure IPv4 address hosts: cisco-routers gather_facts: no tasks: - name: Set IP address cisco.ios.ios_l3_interfaces: config: - name: GigabitEthernet0/1 ipv4: - address: 10.1.1.1/24 state: merged ```
What is the effect of the 'state: merged' parameter?
A network engineer is using the Cisco DNA Center API to initiate a network discovery. The API endpoint '/dna/intent/api/v1/discovery' is called with a POST request containing the following JSON payload:
```json
{
"discoveryType": "Range",
"ipAddressList": "10.10.20.1-10.10.20.254",
"protocolOrder": "SSH",
"timeout": 5,
"retryCount": 3
}```
The API returns a 202 Accepted status code. What does this indicate?
Examine the following configuration snippet applied to a Cisco IOS-XE device:
interface GigabitEthernet0/1 ip address 10.1.1.1 255.255.255.0 ip nat inside
!
interface GigabitEthernet0/2 ip address 192.168.1.1 255.255.255.0 ip nat outside
!
access-list 100 permit ip 10.1.1.0 0.0.0.255 any ip nat inside source list 100 interface GigabitEthernet0/2 overload
What is the effect of this configuration?
Given the following configuration on a Cisco IOS-XE device:
router ospf 1 network 10.0.0.0 0.255.255.255 area 0
!
interface GigabitEthernet0/0 ip address 10.1.1.1 255.255.255.0 ip ospf cost 10
!
interface GigabitEthernet0/1 ip address 10.2.2.1 255.255.255.0
!
Which statement is true about OSPF operation?
Consider the following configuration for a Cisco IOS-XE device:
interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.0 standby 1 ip 192.168.1.254 standby 1 priority 150 standby 1 preempt
!
interface GigabitEthernet0/1 ip address 192.168.2.1 255.255.255.0 standby 2 ip 192.168.2.254 standby 2 priority 100
What is the effect of this HSRP configuration?
Examine the following EIGRP configuration on a Cisco IOS-XE device:
router eigrp 100 network 10.0.0.0 0.255.255.255 passive-interface default no passive-interface GigabitEthernet0/0
!
interface GigabitEthernet0/0 ip address 10.1.1.1 255.255.255.0
!
interface GigabitEthernet0/1 ip address 10.2.2.1 255.255.255.0
Which statement is true?
Given the following BGP configuration on a Cisco IOS-XE device:
router bgp 65001
bgp router-id 1.1.1.1
neighbor 10.0.0.2 remote-as 65002 neighbor 10.0.0.2 update-source Loopback0 neighbor 10.0.0.2 ebgp-multihop 2
!
interface Loopback0 ip address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/0 ip address 10.0.0.1 255.255.255.252
What is the purpose of the 'ebgp-multihop 2' command?
Examine the following configuration for a Cisco IOS-XE device:
interface GigabitEthernet0/0 ip address 10.0.0.1 255.255.255.252
ipv6 address 2001:db8::1/64 ipv6 ospf 1 area 0 !
interface GigabitEthernet0/1 ip address 192.168.1.1 255.255.255.0
ipv6 address 2001:db8:1::1/64 ipv6 ospf 1 area 0 ! ipv6 router ospf 1 router-id 2.2.2.2
Which statement is true about OSPFv3 operation?