Skip to main content

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.

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

Metadata

Release files for hpnapy 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hpnapy 1.0.7
File Size Uploaded Provenance Actions
hpnapy-1.0.7.zip 24.6 kB Without provenance Details for hpnapy-1.0.7.zip

Release files / hpnapy-1.0.7.zip

Download URL hpnapy-1.0.7.zip
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
34fc75e6ec06eeb60f2d3afdafe4bb79d8ebe5108351a94174922a7569355f0c
BLAKE2b-256 checksum
How to use checksums
60d6848c6e69ec2c90eae3020219871567ad00e988bebc1e2b83bb8677620df8
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for hpnapy 1.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page