Mental model
Cisco publishes a Python SDK for every major platform. An SDK is a wrapper that turns:
curl -H "X-Cisco-Meraki-API-Key: $KEY" \
https://api.meraki.com/api/v1/organizations
into:
dashboard.organizations.getOrganizations()
Shorter, auto-handles pagination, retries, auth, URL building. Cisco objective 3.1 says “Construct a Python script that uses a Cisco SDK given SDK documentation”.
The four SDKs you will see
| SDK (pip package) | Platform | GitHub |
|---|---|---|
meraki | Meraki Dashboard | cisco-en-programmability/meraki_sdk |
webexteamssdk | Webex Messaging | CiscoDevNet/webexteamssdk |
dnacentersdk | Catalyst Center (DNA Center) | cisco-en-programmability/dnacentersdk |
intersight | Intersight | CiscoDevNet/intersight-python-sdk |
Install any of them with pip install <name>.
The common 4-step pattern
Every Cisco SDK follows the same shape:
# 1. Install
# pip install meraki
# 2. Import
import meraki
# 3. Create a client with your creds (auth is handled internally)
dashboard = meraki.DashboardAPI(api_key="your-key-here", output_log=False)
# 4. Call a method; get a Python dict / list back
orgs = dashboard.organizations.getOrganizations()
for o in orgs:
print(o["id"], o["name"])
That is a working automation script. 7 lines.
How to read SDK docs
Every method’s docstring includes:
- The HTTP method and URL path it calls (so you can cross-reference the REST docs).
- Required and optional parameters.
- The shape of the returned data.
Example from the meraki SDK:
dashboard.organizations.getOrganizationNetworks(organizationId, **kwargs)
**GET** /organizations/{organizationId}/networks
Args:
organizationId (str): required
**kwargs: perPage (int), startingAfter (str), endingBefore (str), ...
Returns:
List[dict]: each dict has id, name, productTypes, tags, ...
Reading an SDK method = method name + HTTP line + Args + Returns. Four things. Done.
When to drop back to raw requests
Reach for requests directly when:
- The SDK is missing an endpoint (new APIs sometimes ship before the SDK catches up).
- You need very custom request handling (unusual retry logic, specific headers).
- You want to debug an SDK call by replaying the exact HTTP request.
Mixing is fine:
import meraki, requests
dashboard = meraki.DashboardAPI(api_key=KEY)
# SDK for the common stuff
orgs = dashboard.organizations.getOrganizations()
# Raw requests for a brand-new endpoint not yet in the SDK
r = requests.get("https://api.meraki.com/api/v1/newEndpoint",
headers={"X-Cisco-Meraki-API-Key": KEY})
SDK vs raw requests
| SDK | Raw requests | |
|---|---|---|
| Lines of boilerplate per call | ~1 | ~5 |
| Auth handling | Automatic | You add header each call |
| Pagination | Automatic (iterate through pages for you) | Manual |
| Retries on 429 | Automatic (polite backoff) | You code it |
| New or unusual endpoints | Sometimes missing | Always works |
| Transparent (easy to see what HTTP is going out) | Set output_log=True or logging_debug | Yes |
FAQ
Should I always use the SDK? For 90% of day-to-day scripts, yes. For “I need to see the exact HTTP request to debug a 400”, drop to requests.
Can I mix the SDK and requests? Yes. They share no state. Use SDK for most calls, requests for the one call the SDK does not cover.
Do SDKs cache my credentials somewhere? Most do not. The DashboardAPI object holds the key in memory for the life of your script. Nothing persisted to disk unless you write code to do it.
What if the SDK is behind the REST API in features? Cisco SDKs usually ship a release within a few weeks of a new API. If you need something today, use requests and move back to the SDK when it catches up.
