Reputation: 1
I am trying to automate dnac device addition from python. But it require manual adding dnac device details including user credential. Can this step be automated? Please tell
from dnac documentation I am able to create script but not finding any way to how to automate
from dnacentersdk import DNACenterAPI
def dnacadd():
dnac = DNACenterAPI(username='xxxxxx', password='XXXXXX', base_url='xxxxxxx', version='xxxxxxx', verify=False)
device_info = {
"hostname": "XXXXXX",
"ipAddress": ["xx.xx.xx.xx"],
"snmpVersion": "xx",
"snmpROCommunity": "xxxxx",
"cliTransport": "xxx",
"userName": "xxxx",
"password": "xxxxxx"
}
response = dnac.devices.add_device(**device_info)
task_id = response['response']['taskId']
task_status = dnac.task.get_task_by_id(task_id)
print(task_status)
if __name__=="__main__":
dnacadd()
Upvotes: -2
Views: 30