Skip to main content

aciClient

PyPi

A python wrapper to the Cisco ACI REST-API.

Python Version

We support Python 3.10 and up.

Installation

With pip:

pip install aciClient

With uv:

uv add aciClient

Installation for Developing

git clone https://github.com/netcloud/aciClient.git
uv sync --group dev

Usage

Initialisation

Username/password

import aciClient
import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

proxies = {
    'http': 'socks5://127.0.0.1:1080',
    'https': 'socks5://127.0.0.1:1080'
}

aciclient = aciClient.ACI(apic_hostname, apic_username, apic_password, refresh=False, proxies=proxies)
try:
    aciclient.login()
    
    aciclient.getJson(uri)
    aciclient.postJson(config)
    aciclient.deleteMo(dn)
    
    aciclient.logout()
except Exception as e:
    logger.exception("Stack Trace")

For automatic authentication token refresh you can set variable refresh to True

aciclient = aciClient.ACI(apic_hostname, apic_username, apic_password, refresh=True)    

Certificate/signature

import aciClient
import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

aciclient = aciClient.ACICert(apic_hostname, path_to_privatekey_file, certificate_dn)

try:
    aciclient.getJson(uri)
    aciclient.postJson(config)
    aciclient.deleteMo(dn)
except Exception as e:
    logger.exception("Stack Trace")

Examples

get config

tenants = aciclient.getJson('class/fvTenant.json?order-by=fvTenant.dn|asc')

for mo in tenants:
    print(f'tenant DN: {mo["fvTenant"]["attributes"]["dn"]}')

post config

config = {
 "fvTenant": {
  "attributes": {
   "dn": "uni/tn-XYZ"
  }
 }
}

aciclient.postJson(config)

delete MOs

aciclient.deleteMo('uni/tn-XYZ')

create snapshot

You can specify a tenant in variable target_dn or not provide any to do a fabric-wide snapshot.

aci.snapshot(description='test', target_dn='/uni/tn-test')

Subscriptions

You can subscribe to an ACI object with websocket and get near-instant updates on-change.
To use the subscriptions you have to:

  • Login to ACI
  • Open websocket to ACI
  • Subscribe to an ACI object via aciClient.subscribe
  • Refresh subscription to an ACI object via aciClient.subscription_refresh
  • Handle messages sent from ACI through websocket

You can find example code here: examples/subscription.py

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to this project.

Authors

  • Marcel Zehnder - Initial work
  • Andreas Graber - Migration to open source
  • Richard Strnad - Paginagtion for large requests, various small stuff
  • Dario Kaelin - Added snapshot creation

License

This project is licensed under MIT - see the LICENSE.md file for details.

Metadata

Release files for aciClient 1.9.0

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

Source distribution (sdist)

Source distribution for aciClient 1.9.0
File Size Uploaded Provenance Actions
aciclient-1.9.0.tar.gz 9.6 kB With provenance Details for aciclient-1.9.0.tar.gz

Built distribution (wheel)

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

Total release size: 17.6 kB

Release files / aciclient-1.9.0.tar.gz

Download URL aciclient-1.9.0.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
95363673108b0fffd367f3ee42112e64c84bc7d0eb1d78b3c9a3bf270817ef04
BLAKE2b-256 checksum
How to use checksums
ab923f279386addd671f1e0d50e4bf46cdf779910b1aebe815b0723f5ac534a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

Release files / aciclient-1.9.0-py3-none-any.whl

Download URL aciclient-1.9.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c29accfdb39bfa36947660ccd24e5fbce74e6491c8bb880e2c43f4c79fa6bd7
BLAKE2b-256 checksum
How to use checksums
01c2428d54e99e317e3569ebf2b0691a236a7f6dbe842a30f7f6bfb689922024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

Security for aciClient 1.9.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aciclient-1.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

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