Created
January 22, 2021 04:13
-
-
Save codyroche/62c82715bed6d4501eba866b4e4429c8 to your computer and use it in GitHub Desktop.
Cisco CDO API - Device Status Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
headers = {"Authorization": "Bearer <BEARER_TOKEN_HERE>"} | |
query = """query { | |
devices(limit: 50, sortField: NAME, deviceType: [FIREPOWER, ASA, FTD]) { | |
metadata { | |
count | |
} | |
items { | |
softwareVersion | |
name | |
uid | |
isModel | |
conflictDetectionState | |
ipv4 | |
deviceType | |
serial | |
configurationStatus | |
interfaces | |
connectivityState | |
highAvailability | |
specificDevice { | |
namespace | |
... on FtdSpecificDevice { | |
uid | |
} | |
... on AsaSpecificDevice { | |
uid | |
type | |
vpnId | |
} | |
... on MerakiSpecificDevice { | |
uid | |
type | |
} | |
... on AwsSpecificDevice { | |
vpcId | |
region | |
} | |
} | |
} | |
} | |
}""" | |
url = "https://edge.us.cdo.cisco.com/api/public" | |
r = requests.post(url, headers=headers, json={"query": query}) | |
print(r.status_code) | |
print(r.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment