Skip to main content

Shortcut functions for coding and working with PAN devices.

Project description

Shortcut functions for coding and working with PAN devices

Retrieve PAN API key from file in user home directory

Get API key from .panconfkeystore file in user home directory. Input file format has one entry per line.

<apikey>:<ip>

Code example

import retrievepankey
apikey = retrievepankey.read_key_file("192.168.1.1")    

Retrieve device info from file in user home directory

Use shortcut name in scripts to retrieve info about device.

Will return device 'ip' field by default

Input file format for 'fetch_deviceinfo_file()' is below. The function reads in a YAML format from .pandevice file, in user home directory, by default. All sub fields (serial, ip, type, etc) can be customized and returned. If there is no match, the input string to the function is returned.

DEMOFW1:
  serial: 09870100089
  ip: 192.168.50.100
  type: panos
  panorama: 192.168.100.100
  panorama2: 192.168.100.101
  hapair: 192.168.50.101
DEMOFW2:
  serial: 098001000597
  ip: 192.168.50.101
  type: panos
  panorama: 192.168.100.100
  panorama2: 192.168.100.101
  hapair: 192.168.50.101

Code example

import retrievepankey

firewallip = retrievepankey.fetch_deviceinfo_file("DEMO-FW")
panoip = retrievepankey.fetch_deviceinfo_file("DEMO-FW", field='panorama')

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

retrievepankey-0.1.11.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file retrievepankey-0.1.11.tar.gz.

File metadata

  • Download URL: retrievepankey-0.1.11.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for retrievepankey-0.1.11.tar.gz
Algorithm Hash digest
SHA256 8458047b65d18aeb57fb8163534cd0a2a600e7d3613330e8dcab9f48ba9f7826
MD5 69bf47d1a83925b8e439b38fb0a0f83f
BLAKE2b-256 5b60465460cd4e13ecc472bfab75e2a1e28840ae3e9bb4a82858bb4ea5608a5e

See more details on using hashes here.

Supported by

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