Trying to update a network application using a PUT request but gets an Invalid Applicationanswer. 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
Are you trying to create a custom application. Since unable to 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.
The reason why you didn't find the application with that id is because the server got rest and it started to generate new keys again.Created the custom application again and it had the id "ec1dab5c-1c10-487e-8183-dc4e9c7a88dd" now. Wanted to update that application but it always get Application(s) Update Failed as "progress" with Invalid Application as the "failure reason" when using the JSON provided in the question.
This is what worked . 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
}]
here is a PUT that worked.
[{
"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"
}]
Comments
0 comments
Please sign in to leave a comment.