The correct answer is A. The script retrieves device information by sending HTTP requests to the device ' s API endpoints.
The script uses the Python requests library:
response = requests . get( url )
http:// < device_ip > /api/device/info
Sends an HTTP GET request to the API
Checks if the response status code is 200 (OK)
If successful:
return response . json()
→ Converts the API response into a Python dictionary
It interacts with a REST API
It retrieves device information, not configuring anything
B. Configures device settings via secure connection ❌ No POST/PUT/PATCH methods are used ❌ No HTTPS or authentication shown
C. Establishes SSH connection ❌ No SSH libraries (like Paramiko or Netmiko) are used
D. Parses JSON into tabular structure ❌ It only returns and prints JSON ❌ No formatting (like pandas/table conversion) is performed
requests.post() / put() → Modify or create data
.json() → Converts API response into Python dictionary
Key takeaway:
REST API + GET request = data retrieval from device