cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2572
Views
4
Helpful
5
Replies

Update application fails

andreizamfir16
Level 1
Level 1

Hello I want to update a network application using a PUT request but I always get an Invalid Applicationanswer. I'm using version 1.2 of the Sandbox and I tried updating with different JSONs, one of them being this one:

[

   {

      "trafficClass":"BULK_DATA",

      "category":"other",

      "appProtocol":"tcp",

      "tcpPorts":48766,

      "subCategory":"other",

      "categoryId":"04174897-f1cd-43d9-a148-f9a0117075a2",

      "pfrThresholdJitter":1,

      "pfrThresholdLossRate":50,

      "pfrThresholdOneWayDelay":500,

      "pfrThresholdLossRatePriority":2,

      "pfrThresholdOneWayDelayPriority":3,

      "id":"c664fa1c-f9e7-449c-a1af-daddc8c5ce5d",

      "name":"newApp",

      "ignoreConflict":true

   }

]


What attributes does the JSON need to have in order to update an application?

1 Accepted Solution

Accepted Solutions

Ok.. here is a PUT that worked for me

[{

  "id": "7cd4a434-89bc-413d-b5a9-900b782da32e",

    "instanceUuid": "7cd4a434-89bc-413d-b5a9-900b782da32e",

      "category": "other",

     "categoryId": "f1283ed8-14c2-420e-8d3f-8e9a48931a79",

    "engineId": "6",

      "selectorId": "20088",

      "popularity": 10,

      "status": "Active",

      "pfrThresholdJitter": 1,

      "pfrThresholdJitterPriority": 1,

      "pfrThresholdLossRate": 50,

      "pfrThresholdLossRatePriority": 2,

      "pfrThresholdOneWayDelay": 500,

      "pfrThresholdOneWayDelayPriority": 3,

      "trafficClass": "BULK_DATA",

      "rank": 1,

      "subCategory": "other",

      "name": "newApp",

      "appProtocol": "tcp",

      "tcpPorts": "48767",

      "transportIps": "0.0.0.0"

}]

View solution in original post

5 Replies 5

aradford
Cisco Employee
Cisco Employee

Hi Andrei,

are you trying to create a custom application?

I cannot find an application with that "id" on the sandbox controller.

https://{{apic}}:{{port}}/api/v1/application/c664fa1c-f9e7-449c-a1af-daddc8c5ce5d

{

  "response": {

    "errorCode": "ResourceNotFound",

    "message": "Unable to find ApicApplication with id c664fa1c-f9e7-449c-a1af-daddc8c5ce5d",

    "detail": "Unable to find ApicApplication with id c664fa1c-f9e7-449c-a1af-daddc8c5ce5d"

  },

  "version": "1.0"

}

If you want to create an application it should be a POST, not PUT.

This is what worked for me.  You also need an "transportIps", which is the IP address... in this case 0.0.0.0

POST https://sandboxapic.cisco.com/apic/api/v1/application

[{

            "trafficClass": "BULK_DATA",

            "helpString": "newApp",

            "name": "newApp",

            "appProtocol": "tcp",

            "tcpPorts": "48766",

            "transportIps": "0.0.0.0",

            "pfrThresholdJitter": 1,

            "pfrThresholdLossRate": 50,

            "pfrThresholdOneWayDelay": 500,

            "pfrThresholdJitterPriority": 1,

            "pfrThresholdLossRatePriority": 2,

            "pfrThresholdOneWayDelayPriority": 3,

            "category": "other",

            "subCategory": "other",

            "categoryId": "f1283ed8-14c2-420e-8d3f-8e9a48931a79",

            "engineId": 6,

            "rank": 1

}]

I tried to update a custom application that was already on the server. I used POST on 'https://sandboxapic.cisco.com/api/v1/application' with this body:

[{

        "trafficClass": "BULK_DATA",

        "name": "abcdef",

        "appProtocol": "tcp",

        "tcpPorts": 10101,

        "pfrThresholdJitter": 1,

        "pfrThresholdLossRate": 50,

        "pfrThresholdOneWayDelay": 500,

        "pfrThresholdJitterPriority": 1,

        "pfrThresholdLossRatePriority": 2,

        "pfrThresholdOneWayDelayPriority": 3,

        "category": "other",

        "subCategory": "other",

        "categoryId": "933a1df9-981c-4f66-a8c0-ba48645ce0be",

        "engineId": 9,

        "ignoreConflict": true

    }]

I guess why you didn't find the application with that id is because the server resetted, as I can see it started to generate new keys again. I created the custom application again and it has the id "ec1dab5c-1c10-487e-8183-dc4e9c7a88dd" now. I wanted to update that application but I always get Application(s) Update Failed as "progress" with Invalid Application as the "failure reason" using the JSON provided in the question.

Ok.. here is a PUT that worked for me

[{

  "id": "7cd4a434-89bc-413d-b5a9-900b782da32e",

    "instanceUuid": "7cd4a434-89bc-413d-b5a9-900b782da32e",

      "category": "other",

     "categoryId": "f1283ed8-14c2-420e-8d3f-8e9a48931a79",

    "engineId": "6",

      "selectorId": "20088",

      "popularity": 10,

      "status": "Active",

      "pfrThresholdJitter": 1,

      "pfrThresholdJitterPriority": 1,

      "pfrThresholdLossRate": 50,

      "pfrThresholdLossRatePriority": 2,

      "pfrThresholdOneWayDelay": 500,

      "pfrThresholdOneWayDelayPriority": 3,

      "trafficClass": "BULK_DATA",

      "rank": 1,

      "subCategory": "other",

      "name": "newApp",

      "appProtocol": "tcp",

      "tcpPorts": "48767",

      "transportIps": "0.0.0.0"

}]

That worked! Thank you very much!!

Thanks for letting me know Andrei.

Let us know if there is anything else you need help with..