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

Issues with Cisco DNA Center SDK -dnac.device_onboarding_pnp

Joshua Head
Beginner
Beginner

Hi All,

I have been working on an automation script, I had no issues just using the API's but the dnacentersdk has proven a bit more challenging. Specifically the dnac.device_onboarding_pnp.claim_a_device_to_a_site api call. I am trying to claim a device to site and also passing template parameters for Day-0 claim but I can't get it to work.

I keep hitting the following:
Response:

Params:
{}
Body:
{
"deviceId": "648d2e79eb9e0b000bca4751",
"type": "Default",
"imageInfo": {
"imageId": "016c6ba2-4630-45f7-9bad-eb9913bf0636",
"skip": true
},
"configInfo": [
{
"configId": "71cc2dea-3283-4d18-b699-87c512b66dd6",
"configParameters": [
{
"key": "Uplink_Interfaces",
"value": "Te1/1/3"
},
{
"key": "Port_Channel_1",
"value": "Te1/1/1,Te1/1/2"
},
{
"key": "Port_Channel_1_Number",
"value": "1"
},
{
"key": "Port_Channel_2",
"value": "Te2/1/1,Te2/1/2"
},
{
"key": "Port_Channel_2_Number",
"value": "2"
},
{
"key": "Hostname",
"value": "TEST"
},
{
"key": "Management_VLAN",
"value": "110"
},
{
"key": "ManagementIP",
"value": "10.1.50.212"
},
{
"key": "Subnet_mask",
"value": "255.255.255.192"
},
{
"key": "Default_Gateway",
"value": "10.1.50.193"
}
]
}
],
"rfProfile": "",
"staticIP": "",
"subnetMask": "",
"gateway": "",
"vlanID": "",
"interfaceName": "",
"sensorProfile": ""
}
2023-06-17 13:54:43,622 - urllib3.connectionpool - DEBUG - https://10.X.X.X:443 "POST /dna/intent/api/v1/onboarding/pnp-device/site-claim HTTP/1.1" 500 None
DEBUG:urllib3.connectionpool:https://10..X.X.X:443 "POST /dna/intent/api/v1/onboarding/pnp-device/site-claim HTTP/1.1" 500 None

Response
Status: 500 - Server Error
Headers:
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Date: Sat, 17 Jun 2023 03:54:43 GMT
Server: webserver
x-request-id: efb0d9e76f75d0d5343fe86d4cd714ef
Vary: Origin
Access-Control-Allow-Origin: infra-gsudna000.bslmns.bluescopesteel.net
Via: api-gateway
Cache-Control: no-store
Pragma: no-cache
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data:
X-Content-Type-Options: nosniff
X-XSS-Protection: 1
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Frame-Options: SAMEORIGIN
Body:
{
"response": {
"errorCode": "ERROR_CODE_N/A",
"message": "JSON parse error: Cannot deserialize instance of `com.cisco.pnp.api.model.ConfigTask$ConfigInfo` out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `com.cisco.pnp.api.model.ConfigTask$ConfigInfo` out of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 155] (through reference chain: com.cisco.pnp.api.model.DefaultProvisionRequest[\"configInfo\"])",
"detail": "Cannot deserialize instance of `com.cisco.pnp.api.model.ConfigTask$ConfigInfo` out of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 155] (through reference chain: com.cisco.pnp.api.model.DefaultProvisionRequest[\"configInfo\"])",
"href": "/onboarding/pnp-device/site-claim"
},
"version": "1.0"

I am really starting to bang my head against a wall with this one....

1 Accepted Solution

Accepted Solutions

Joshua Head
Beginner
Beginner

Okay for anyone else who runs into this issue I eventually fixed it by using a custom api call wrapper, you can find it in the link below:
https://dnacentersdk.readthedocs.io/en/latest/api/quickstart.html

Search - Adding API call definitions

View solution in original post

1 Reply 1

Joshua Head
Beginner
Beginner

Okay for anyone else who runs into this issue I eventually fixed it by using a custom api call wrapper, you can find it in the link below:
https://dnacentersdk.readthedocs.io/en/latest/api/quickstart.html

Search - Adding API call definitions

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: