cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Who Me Too'd this topic

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

Who Me Too'd this topic