ETExamTower
Q3Controller-Based Network Automation

An engineer must list every network for a specific Meraki organization. The engineer must call the organization’s network endpoint and save the returned JSON inventory to disk. Drag the code snippets from the bottom into the boxes in the code to construct the artifact. Not all options are used. <DragDrop items={["x-cisco-meraki-api-key","networks","tenants","X-Auth-Token","organizations","projects","get"]} slots={[{"answer":"x-cisco-meraki-api-key","id":"header"},{"answer":"get","id":"method"},{"answer":"organizations","id":"collection"},{"answer":"networks","id":"resource"}]} template={"import requests, json\n\nbase = \"https://api.meraki.com/api/v1\"\norg_id = \"123456\"\napi_key = \"abcd1234\"\nheaders = {\n \"{{header}}\": api_key,\n \"Accept\": \"application/json\"\n}\n\nresp = requests.{{method}}(\n f\"{base}/{{collection}}/{org_id}/{{resource}}\",\n headers=headers,\n timeout=30\n)\nresp.raise_for_status()\n\nwith open(\"org_networks.json\", \"w\") as f:\n json.dump(resp.json(), f, indent=2)"} explanation={"The Meraki Dashboard API network-inventory operation is `GET /organizations/{organizationId}/networks`. A GET request retrieves the collection without changing it, and the response can be serialized with `json.dump`. The supplied `x-cisco-meraki-api-key` token is the API-key header option for this artifact; `tenants`, `projects`, and `X-Auth-Token` do not form the required Meraki organization-networks request.\n\n**Learn more:** [Cisco Meraki Dashboard API v1 API Index](https://developer.cisco.com/meraki/api-v1/api-index/) · [Cisco Meraki Dashboard API v1 documentation](https://developer.cisco.com/meraki/api-v1/)"} reuse={false} />

← → navigate · a answer
Discussion · 0
No comments yet. Be the first.