Skip to main content

HP Network automation framework

Project description

HPNAPY

HPNAPY is a Python3 library to access and interface with HP Network Automation's SOAP API.

This library has bee developed testing against HP Network Automation 2018.11 and greater.

More information on HP Network Automation can be found at (Micro Focus).

Requirements

This package requires Python 3.4+.

It depends on the following modules:

requests >= 1.0.0 zeep >= 3.0.0 urllib3 >= 1.0.0

Installing

This package is available through pypi and can be installed using pip.

pip install hpnapy

Usage

Here is an example of connecting through the API and retrieving a list of device groups.

from hpnapy import NAInterface

# Initialize our interface
hpna = NAInterface("https://foo.bar")
hpna.login('username', 'password')

# Retrieve and iterate a list of device groups
device_groups = hpna.list_device_group()
for entry in device_groups:
    print(entry)

We can globally disable SSL verification to prevent errors and messaging. This is not recommended as this is a potential security concern.

from hpnapy import NAInterface

# Initialize our interface
hpna = NAInterface("https://foo.bar", ssl_verify=False)

In order to filter results, we can pass filter keys as defined in the HPE Network Automation Software (NA) CLI/API Command Reference.

from hpnapy import NAInterface

# Initialize our interface
hpna = NAInterface("https://foo.bar")
hpna.login('username', 'password')

# Retrieve and iterate a list of device groups
filtered_devices = hpna.list_device(vendor="Cisco", group="My Cisco Switches Group")
for entry in filtered_devices:
    print(entry)

Exceptions

This library uses its own set of exceptions.

hpnapy.exceptions.HPNAConnectionError
hpnapy.exceptions.HPNAQueryParamError
hpnapy.exceptions.HPNAQueryError

Contributing

Spencer Ervin (spenceation) is the creator and current maintainers of the hpnapy library.

Pull requests are always welcome. Before submitting a pull request, please ensure that your coding style follows PEP 8.

Legal

Licensed under the GNU General Public License v3.0; you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.gnu.org/licenses/gpl-3.0.en.html

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

hpnapy-1.0.7.zip (24.6 kB view details)

Uploaded Source

File details

Details for the file hpnapy-1.0.7.zip.

File metadata

  • Download URL: hpnapy-1.0.7.zip
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.0

File hashes

Hashes for hpnapy-1.0.7.zip
Algorithm Hash digest
SHA256 34fc75e6ec06eeb60f2d3afdafe4bb79d8ebe5108351a94174922a7569355f0c
MD5 366d7303b725f96e801ebac96f6cec89
BLAKE2b-256 60d6848c6e69ec2c90eae3020219871567ad00e988bebc1e2b83bb8677620df8

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