Skip to main content

PrimeAPIClient

Cisco Prime Infrastructure API
REST API Resources


PyPI - Status PyPI - Format GitHub GitHub release (latest by date) PyPI - Python Version

An API Client for Prime to be able to easily use the API in a more standard way.

How to install

$ pip install PrimeAPIClient

Usage

the argument "method" must be specify every time. Look at authentication validation for an example.

Default arguments and attributes

import PrimeAPIClient

client = PrimeAPIClient.Client(verify=False, warnings=False, api_version='v1')

client.get(url=None, method='', data=None, auth = None)

# client.headers
# client.url_base
# client.token

The first query

import PrimeAPIClient
import json

client = PrimeAPIClient.Client()
client.connect(url='https://Prime-server.local', username='admin', password='Admin123')

response = client.get(method='/data/Alarms.json')
print(json.dumps(response.json(), indent=4))

client.disconnect()

Getting detailed information

import PrimeAPIClient
import json

client = PrimeAPIClient.Client()
client.connect(url='https://Prime-server.local', username='admin', password='Admin123')

query_string = {'.full': 'true'}
response = client.get(method='/data/Alarms.json', **query_string)
print(json.dumps(response.json(), indent=4))

client.disconnect()

Sorting

import PrimeAPIClient
import json

client = PrimeAPIClient.Client()
client.connect(url='https://Prime-server.local', username='admin', password='Admin123')

query_string = {'.full': 'true', '.sort': 'severity'}
response = client.get(method='/data/Alarms.json', **query_string)
print(json.dumps(response.json(), indent=4))

client.disconnect()

Filtering

import PrimeAPIClient
import json

client = PrimeAPIClient.Client()
client.connect(url='https://Prime-server.local', username='admin', password='Admin123')

query_string = {'.full': 'true', '.sort': 'severity', 'category.value': 'AP',
                    'message': 'contains("interface")'}
response = client.get(method='/data/Alarms.json', **query_string)
print(json.dumps(response.json(), indent=4))

client.disconnect()

Paging

import PrimeAPIClient
import json

client = PrimeAPIClient.Client()
client.connect(url='https://Prime-server.local', username='admin', password='Admin123')

query_string = {'.full': 'true', '.sort': 'severity', 'category.value': 'AP',
                    'message': 'contains("interface")', '.maxResults': '5'}
response = client.get(method='/data/Alarms.json', **query_string)
print(json.dumps(response.json(), indent=4))

client.disconnect()

Metadata

Release files for PrimeAPIClient 0.0.1

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

Source distribution (sdist)

Source distribution for PrimeAPIClient 0.0.1
File Size Uploaded Provenance Actions
PrimeAPIClient-0.0.1.tar.gz 5.2 kB Without provenance Details for PrimeAPIClient-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PrimeAPIClient 0.0.1
File Interpreter ABI Platform Actions
PrimeAPIClient-0.0.1-py3-none-any.whl Python 3 none any Details for PrimeAPIClient-0.0.1-py3-none-any.whl

Total release size: 10.1 kB

Release files / PrimeAPIClient-0.0.1.tar.gz

Download URL PrimeAPIClient-0.0.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
976a565f171bfffb8f23dd42d1af9175bac3f32e55e541bc0d73ce5cd59d1c91
BLAKE2b-256 checksum
How to use checksums
432fd3ea41156a59d4533a67ed1f29668e7397110069d4a0ead04b3fb9e26852
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.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release files / PrimeAPIClient-0.0.1-py3-none-any.whl

Download URL PrimeAPIClient-0.0.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31fa18999bae79e9d5d8bd9d88ff8243fdd3f727aa9a8840317e00c51935b5f7
BLAKE2b-256 checksum
How to use checksums
9eab22eb26da205202a97cb7abc6561a059a278cf461387d982f0bdd3a7cf9b0
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.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Security for PrimeAPIClient 0.0.1

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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

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