msc-login

published

Script to obtain the session token when using the RESTAPI in conjunction with a Cisco ACI Multi-Site Controller

Install requirements

pip install -r requirements.txt

Import this module into other scripts and pass through the following:

  • Multi-Site Controller Hostname/IP Address
  • Multi-Site Username
  • Multi-Site Password

Usage Example:

token = msc.login("mschost.cisco.com", "admin", "cisco123")

Example of the generated token being inserted into the header:

headers = {
"Content-Type": "application/json",
"cache-control": "no-cache"
"Authorization": "Bearer " + token
}
View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.