cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
129
Views
0
Helpful
1
Replies

DNAC: configuration of Network Settings by python API

alikhtin77
Level 1
Level 1

Hello, 

I am looking for a working python script to change DNAC Network Settings. I need to disable "Network"
and "Client/Endpoint" AAA feature. Please share your config.

I used https://developer.cisco.com/docs/dna-center/#!create-network-v2 link as a source of information. I could be wrong, but python code provided there is wrong. 

The code from the link

 

response = requests.request('POST', url, headers=headers, data = payload)

 

generates the following error:

 

b'{"response":{"errorCode":"NCND00067","message":"NCND00067: The request body is invalid","detail":"JSON parse error: Unrecognized token \'settings\': was expecting (\'true\', \'false\' or \'null\')"},"version":"1.0"}'

 

 the solution to solve this error is to replace "data" with "json" in the request.  

 

response = requests.request('POST', url, headers=headers, json = payload)

 

But it's not a topic of my question.

Please share the script how to disable network_aaa and clientAndEndpoint_aaa values by the script properly.

Thank you in advance.

1 Reply 1

alikhtin77
Level 1
Level 1

I am using this request

 

{
    "settings": {
        "network_aaa": { }
    }
}

 

 and get back this error:

 

{
    "response": {
        "errorCode": "NCND00001",
        "message": "NCND00001: The Common Settings request has validation errors",
        "detail": "[\"NCND01153: If None or a PAN IP is selected for any set of aaa servers, a primary server must also be selected for that set\"]"
    },
    "version": "1.0"
}

Please help me to delete/disable aaa setting.