01-25-2018 12:39 PM
In playing around with ANC APIs it appears to me the ANC Endpoint GetAll API isn't working correctly.
When I ask to fetch all endpoints that have ANC policy applied I get this:
{
"SearchResult": {
"total": 1,
"resources": [
{
"id": "5a3d227a-c5b4-49f4-96d1-6f983eef249d",
"link": {
"rel": "self",
"href": "https://10.201.9.1:9060/ers/config/ancendpoint/5a3d227a-c5b4-49f4-96d1-6f983eef249d",
"type": "application/xml"
}
}
]
}
}
So basically it is just a list of IDs/HREFs with no useful information. I have to then query the HREF to find the endpoint I want.
{
"ErsAncEndpoint": {
"id": "5a3d227a-c5b4-49f4-96d1-6f983eef249d",
"macAddress": "11:11:11:11:11:11",
"policyName": "Quarantine",
"link": {
"rel": "self",
"href": "https://10.201.9.1:9060/ers/config/ancendpoint/5a3d227a-c5b4-49f4-96d1-6f983eef249d",
"type": "application/xml"
}
}
}
So if was searching a larger list of ANC endpoints I would have to call the GetAll, parse out the IDs, then call the IDs one by one to find the device I want. Unfortunately the ANC IDs are different the Endpoint IDs so there is no correlation there.
Is this how the API is supposed to function? Also when you apply an ANC policy via API it would be nice if the ANC ID was sent back in the response.
Solved! Go to Solution.
01-26-2018 06:08 AM
Yes, this is similar to a number of the endpoint operations, but recent versions have started to add get by name option to help reduce the need for iterative queries.
01-25-2018 07:12 PM
Yes, that is how it is or at least for now.
Is it you want the ANC ID returned after apply so you may perform a Get-By-Id to verify it?
01-25-2018 07:37 PM
That would be nice, but maybe it is not that important to verify the policy. I guess you can always just try to reapply the ANC policy. It gives back a 500 error saying that the policy is already applied.
Paul Haferman
Office- 920.996.3011
Cell- 920.284.9250
01-26-2018 06:08 AM
Yes, this is similar to a number of the endpoint operations, but recent versions have started to add get by name option to help reduce the need for iterative queries.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide