Skip to content

Instantly share code, notes, and snippets.

View illumine's full-sized avatar

Illumine IT Consulting illumine

View GitHub Profile
@NWMichl
NWMichl / apic_query.py
Created February 15, 2021 09:15
Query the Cisco ACI APIC API using Python & requests
import requests, json
apic_url = 'sandboxapicdc.cisco.com'
apic_username = 'admin'
apic_password = 'ciscopsdt'
def apic_login(apic: str, username: str, password: str) -> dict:
""" APIC login and return session cookie """
apic_cookie = {}
credentials = {'aaaUser': {'attributes': {'name': apic_username, 'pwd': apic_password }}}