Skip to main content

Python Library to use Juniper-Mist APIs

Project description

Mist System Python Library

Unofficial Juniper-Mist library

How to use this library

Install

pip install mistsystems

With API Token

>>> from mistsystems import api

>>> mist = api.MistSystems(host="api.mist.com", apitoken="mysecretapitoken")

With Login/password

>>> from mistsystems import api

>>> mist = api.MistSystems(host="api.mist.com", email="user@mycorp.com", password="mysecretpassword")

Display account privileges

>>> print(mist.privileges)
scope    role    name                   site_id    org_name    org_id                                msp_name       msp_id
-------  ------  ---------------------  ---------  ----------  ------------------------------------  -------------  ------------------------------------
org      admin   Demo Test                                     39ce2088-xxxx-xxxx-xxxx-1a5a88bab5ee
org      admin   Demo 1                                        e338cdf2-xxxx-xxxx-xxxx-2996d983d8bc  MSP Demo  1e7002ba-xxxx-xxxx-xxxx-eb6a8151b731
org      write   Demo 2                                        995f5d60-xxxx-xxxx-xxxx-4313da26e1c3
org      read    Demo 3                                        3440ed64-xxxx-xxxx-xxxx-d62ac4586fd1

Find an organization

>>> mist.privileges.find_org(name="test")
[{'scope': 'org', 'org_id': '9ce2088-xxxx-xxxx-xxxx-1a5a88bab5ee', 'org_name': '', 'msp_id': '', 'msp_name': '', 'orggroup_ids': '', 'name': 'Demo Test', 'role': 'admin', 'site_id': '', 'sitegroup_ids': ''}, ]

Request the Mist Cloud

>>> mist.orgs.sites.get(org_id="ca7e9350-xxxx-xxxx-xxxx-db350863a910")
{'result': [{'timezone': 'Europe/Paris', 'country_code': 'FR', 'latlng': {'lat': 48.889036, 'lng': 2.280529}, 'address': '41 Rue de Villiers, 92200 Neuilly-sur-Seine, France', 'lat': 48.889036, 'lng': 2.280529, 'id': '42ee034a-xxxx-xxxx-xxxx-8499d934eff1', 'name': 'Primary Site', 'org_id': 'ca7e9350-xxxx-xxxx-xxxx-db350863a910', 'created_time': 1591344677, 'modified_time': 1598866388, 'rftemplate_id': None, 'secpolicy_id': None, 'alarmtemplate_id': None, 'networktemplate_id': None, 'tzoffset': 60}], 'status_code': 200, 'error': '', 'uri': '/api/v1/orgs/ca7e9350-xxxx-xxxx-xxxx-db350863a910/sites'}

>>> mist.sites.wlans.get(site_id="42ee034a-xxxx-xxxx-xxxx-8499d934eff1")
{'result': [{'ssid': 'test', 'enabled': False, 'hide_ssid': False, 'no_static_ip': False, 'no_static_dns': False, 'band': 'both', 'band_steer': False, 'airwatch': {'enabled': False, 'console_url': '', 'api_key': '', 'username': '', 'password': ''}, 'disable_wmm': False, 'disable_uapsd': False, 'use_eapol_v1': False, 'roam_mode': 'NONE', 'auth_servers_nas_id': '', 'auth_servers_nas_ip': '', 'auth_server_selection': 'ordered', 'disable_11ax': False, 'vlan_enabled': False, 'apply_to': 'site', 'id': '8b65474b-xxxx-xxxx-xxxx-b2e2456650fe', 'for_site': True, 'template_id': None, 'site_id': '42ee034a-xxxx-xxxx-xxxx-8499d934eff1', 'org_id': 'ca7e9350-xxxx-xxxx-xxxx-db350863a910', 'created_time': 1599767311, 'modified_time': 1599767311, 'mxtunnel_id': None, 'wxtunnel_id': None, 'interface': 'all'}], 'status_code': 200, 'error': '', 'uri': '/api/v1/sites/42ee034a-xxxx-xxxx-xxxx-8499d934eff1/wlans'}
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mistsystems-0.2.9.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

mistsystems-0.2.9-py3-none-any.whl (81.3 kB view details)

Uploaded Python 3

File details

Details for the file mistsystems-0.2.9.tar.gz.

File metadata

  • Download URL: mistsystems-0.2.9.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for mistsystems-0.2.9.tar.gz
Algorithm Hash digest
SHA256 0ebd8708838c513a777db9397b352b876523ac02b0955facc2bb28e918826689
MD5 4e91ead94c256c2521abc29c0dd8d2f1
BLAKE2b-256 d71bb42507ae0d893808f2600319e942d871c6fc9363099b5448298c1c608e53

See more details on using hashes here.

File details

Details for the file mistsystems-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: mistsystems-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 81.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for mistsystems-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 16a0bdf9782d277376a94f5938372384f2696ca05842c7ed70cc880d4294a691
MD5 7b34ec0fa58030d18a10f1ad36402569
BLAKE2b-256 585f74f82e9427145abb903b519e1e8d805eac35e2ef705c57221c97228d348a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page