DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
#Get a list of all the organizations for the
Cisco DevNet account
ORGS = MERAKI.organizations.get_organizations()
for ORG in ORGS:
print("Org ID: {} and Org Name:
{}".format(ORG['id'], ORG['name']))
PARAMS = {}
PARAMS["organization_id"] = "549236" # Demo
Organization "DevNet Sandbox"
#Get a list of all the networks for the Cisco
DevNet organization
NETS =
MERAKI.networks.get_organization_networks(PARAMS)
for NET in NETS:
print("Network ID: {0:20s}, Name:
{1:45s},Tags: {2:<10s}".format(\
NET['id'], NET['name'],
str(NET['tags'])))
#Get a list of all the devices that are part of
the Always On Network
DEVICES =
MERAKI.devices.get_network_devices("L_646829496
481099586")
for DEVICE in DEVICES:
print("Device Model: {0:9s},Serial:
{1:14s},MAC: {2:17}, Firmware:{3:12s}"\
.format(DEVICE['model'],
DEVICE['serial'], DEVICE['mac'], \
DEVICE['firmware']))

After you instantiate the MerakiSdkClient class, you get
an API client object that provides access to all the
methods of the class. You can find the documentation for
the Python SDK at
https://developer.cisco.com/meraki/api/#/python/guid
es/python-sdk-quick-start. This documentation covers
all the classes and methods, their parameters, and input
and output values for the Python SDK implementation.
Unlike with the curl and Postman examples earlier in
this chapter, you do not need to determine the exact API
resource that will return the information you are
interested in; however, you do need to know how the
MerakiSdkClient API class is organized and what

Free download pdf