Hello,
I'm having trouble adding devices to DNA with the API. I've read the documentation (Cisco DevNet: APIs, SDKs, Sandbox, and Community for Cisco Developers), but can't tell what's wrong. When I try my python method I get this non descript error:
'errorCode': 'Bad request', 'message': 'Invalid input request', 'detail': 'There was an error processing the input arguments.'
Is there anywhere I can look to find a better error message? Here is my python method:
def add_dna_device(token, device):
url = f'https://{server}/dna/intent/api/v1/network-device'
headers = {
"Content-Type": "application/json",
"X-Auth-Token": f"{token}"
}
payload = {
"type": "NETWORK_DEVICE",
"cliTransport": "ssh2",
"ipAddress": [ f"{device}" ],
"snmpVersion": "2c",
"snmpROCommunity": "test",
"snmpRWCommunity": "test",
"snmpRetry": 3,
"snmpTimeout": 5,
"userName": "test",
"password": "test",
"enablePassword": "test"
}
response = requests.post(url, headers=headers, data=payload, verify=False)
return response.json()['response']
I've tried using more of the variables in the payload, but can't find a combination that works.
Thanks for your time!