cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
299
Views
0
Helpful
3
Replies

ANC EndPoint GetAll Functioning As Designed

paul
Level 10
Level 10

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. 

1 Accepted Solution

Accepted Solutions

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.

View solution in original post

3 Replies 3

hslai
Cisco Employee
Cisco Employee

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?

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

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.