MerakiAPI

This is the main class that should be called to initialize the module, since it stands as the root of the api. All further actions are called from an instance of this class.

class meraki_api.MerakiAPI(key)

You must instantiate a new object from this class, setting you profile authentication token to access the API.:

from meraki_api import MerakiAPI

# Meraki Dashboard API profile authentication token.
KEY = "MY_AUTHENTICATION_KEY"
# API root.
meraki = MerakiAPI(KEY)

The networks, organizations, and devices endpoints all work in a similar manner. They all inherit from :meraki_api_resource , so they have all the command REST actions: index, create, show, update, and delete. Some of them have other special functions to execute more specific actions. They also reference other endpoint creators.:

# All organizations.
organizations = meraki.organizations()
# List.
organizations.index()
# Create new organization.
organizations.create({"name": "New organization"})

# To access an individual organization we must pass its ID.
ORGANIZATION_ID = "MY_ORGANIZATION_ID"
organization = meraki.organizations(ORGANIZATION_ID)
# Organization details.
organization.show()
# Update organization.
organization.update({"name": "Updated organization name"})
# Delete organization.
organization.delete()

We would use the same action to interact with the networks or devices endpoints

Note

Each index, create, show, update, and delete function, returns a requests response object. If you just want the body we should run response.json() to get it.

devices(serial=None)

Returns the API Devices Resource.

networks(network_id=None)

Returns the API Networks Resource.

organizations(organization_id=None)

Returns the API Organizations Resource.

class meraki_api.Organizations(key, prefix=None, resource_id=None)

Meraki API Organizations resource.

admins(admin_id=None)

Returns the Organization Admins API Resource.

claim(data)

Claim order, license key, or order into an organization.

clone(data)

Create a new organization by cloning.

config_templates(config_template_id=None)

Returns the Organization Config Templates API Resource.

inventory()

Return the license state.

license_state()

Return the license state.

networks(network_id=None)

Returns the Organization Networks API Resource.

saml_roles(saml_role_id=None)

Returns the Organization SAML Roles API Resource.

snmp()

Return the SNMP settings.

third_party_vpn_peers()

Return the third party VPN peers.

update_third_party_vpn_peers(data)

Return the third party VPN peers.

class meraki_api.Networks(key, prefix=None, resource_id=None)

Meraki API Networks resource.

access_policies()

List the access policies (MS).

air_marshal(query)

Air marshal scan results from a network.

available_phone_numbers()

List all the available phone numbers in a network.

bind(data)

Binds template to network.

check_timespan(query)

Checks if the query object has the timespan value configured.

devices(serial=None)

Returns the Networks Devices API Resource.

phone_contacts(phone_contact_id=None)

List the phone contacts in a network.

phone_numbers()

List all the phone numbers in a network.

site_to_site_vpn(site_to_site_vpn_id=None)

Returns site-to-site VPN settings API Resource.

sm()

Returns Network SM API Resource.

ssids(ssid_id=None)

Returns the Network SSIDs API Resource.

static_routes(static_route_id=None)

Returns the Networks Static Routes API Resource.

traffic(query)

The traffic analysis data for this network. Traffic Analysis with Hostname Visibility must be enabled on the network.

unbind()

Unbind template from network.

vlans(vlan_id=None)

Returns VLANs VPN settings API Resource.

class meraki_api.Devices(key, prefix=None, resource_id=None)

Meraki API Devices resource.

claim(query)

Claim a device.

clients(query)

List the clients of a device, up to a maximum of a month ago. The usage of each client is returned in kilobytes. If the device is a switch, the switchport is returned; otherwise the switchport field is null.

remove()

Remove a single device.

switch_ports(switch_port_id=None)

Returns a Device Switch Ports API Resource.

Return uplink status.

class meraki_api.Admins(key, prefix, resource_id=None)

Meraki API Organization Admins resource.

class meraki_api.ConfigTemplates(key, prefix=None, resource_id=None)

Meraki Config Templates API Resource.

class meraki_api.L3FirewallRules(key, prefix, resource_id=None)

Meraki API L3 Firewall Rules resource.

class meraki_api.PhoneContacts(key, prefix, resource_id=None)

Meraki API Phone Contacts resource.

class meraki_api.SAMLRoles(key, prefix, resource_id=None)

Meraki API Organization SAML Roles resource.

class meraki_api.SiteToSiteVPN(key, prefix, resource_id=None)

Meraki API Organization Admins resource.

class meraki_api.SM(key, prefix, resource_id=None)

Meraki API Network SM resource.

check_in(data)

Force check-in a set of devices.

devices(query=None)

Returns the Networks SM Devices API Resource.

lock_devices(data)

Lock a set of devices.

modify_device_fields(data)

Modify the fields of a device.

modify_devices_tags(data)

Add, delete, or update the tags of a set of devices.

move_devices(data)

Move a set of devices to a new network.

wipe_device(data)

Wipe a device.

class meraki_api.SSIDs(key, prefix, resource_id=None)

Meraki API Organization Admins resource.

l3_firewall_rules(l3_firewall_rule_id=None)

Returns the L3 Firewall Rules API Resource.

class meraki_api.StaticRoutes(key, prefix, resource_id=None)

Meraki API Network Staic Routes resource.

class meraki_api.SwitchPorts(key, prefix, resource_id=None)

Meraki API Devices SwitchPorts resource.

class meraki_api.VLANs(key, prefix, resource_id=None)

Meraki API Organization VLANs resource.