cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2463
Views
12
Helpful
3
Replies

send JSON file to DNAC

Hello expert

I writing sample script  using SWIM API.

Authentication succeeded. DNAC failed to receive JSON file.

Does DNAC need something special? Could you give me advice.

DANC 1.1 (appliances)

------------------------------------------------------------------

(1)

curl -v -X GET

-H Content-Type: application/json

-H Authorization: Basic <BASE64_ID_PASSWORD>

-k https://<DNAC_IP>/api/system/v1/auth/login

------------------------------------------------------------------

(2)

curl -v -X POST

-H "Content-Type: application/json"

--cookie "X-JWT-ACCESS-TOKEN=<TOKEN>"

-k https://<DNAC_IP>/api/v1/image/distribution

-d "{ "distributeDTOList": [ { "imageUuid": "<IMAGE_UUID>", "deviceUuid": "<DEVICE_UUID>" } ] } "

------------------------------------------------------------------

{

  "response": {

    "errorCode": "InternalError",

    "message": "Could not read JSON: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: ; line: 1, column: 1]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: ; line: 1, column: 1]",

    "detail": "Could not read JSON: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: ; line: 1, column: 1]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: ; line: 1, column: 1]"

  },

  "version": "1.0"

}

------------------------------------------------------------------

<DEVICE_UUID> : from /api/v1/network-device

<IMAGE_UUID> : from /api/v1/image/importation

1 Accepted Solution

Accepted Solutions

aradford
Cisco Employee
Cisco Employee

payload should be

[
{
"deviceUuid": "<IMAGE_UUID>",
"imageUuid": "<DEVICE_UUID>"
}
]

View solution in original post

3 Replies 3

aradford
Cisco Employee
Cisco Employee

payload should be

[
{
"deviceUuid": "<IMAGE_UUID>",
"imageUuid": "<DEVICE_UUID>"
}
]

I was able to IOS Upgrade using SWIM API. Thanks for your advice.

aradford
Cisco Employee
Cisco Employee

great news.  thanks for letting us know