QuestionQ40
Controller-Based Network AutomationAn engineer must create a site-level health snapshot from Cisco Catalyst Center for an executive dashboard. The engineer must authenticate and query the Site Health resource by using the token header and a millisecond timestamp query parameter. Drag the code snippets into the boxes to construct the artifact. Not every option is used.
Drag & Drop
import requests, time base = "https://dnac.example.local" user, pwd = ("apiuser", "apipass") # token t = requests.post(f"{base}/", auth=(user, pwd), verify=False) t.raise_for_status() token = t.json()["Token"] # site-health ts = int(time.time() * 1000) headers = {"": token} r = requests.get(f"{base}/dna/intent/api/v1/?={ts}", headers=headers, verify=False, timeout=15) r.raise_for_status() site_data = r.json() print("Sites reported:", len(site_data.get("response", [])))
Community Discussion