12-01-2017 09:33 AM - edited 03-01-2019 05:23 AM
Hi,
I have been trying to figure how to construct an API query which gives me a response including fvAEPg, fvCEp, fvIp and fvRsCEpToPathEp.
I have tried this URI and it kind of gives me the result I want but it is missing fvRsCEpToPathEp:
"api/class/fvAEPg.json?rsp-subtree=full&rsp-subtree-filter=eq(fvIp.addr,\"10.10.10.10\")&rsp-subtree-include=required".
Anyone have any ideas?
Thanks in advance.
Solved! Go to Solution.
12-06-2017 10:44 AM
andreaswall,
So is your end goal to search on an IP and be able to discern what EPG it is existing under? If so, here is a method that will get you everything except for the fvAEPg mo. However, you can discern the EPG from the DN of the fvCEp:
GET https://a.p.i.c/api/class/fvCEp.json?query-target-filter=eq(fvCEp.ip,"10.0.128.70")&rsp-subtree=full
of course this assumes that your fvIp.addr value has been written to fvCEp.ip.
I will keep digging to see if what you ask is possible. As a pointer for testing, we also have the following option:
target-subtree-class=fvAEPg,fvCEp,fvIp ,fvRsCEpToPathEp
Although I have yet to get it to respond in the manner you are requesting.
-Gabriel
02-22-2019 06:50 AM
12-01-2017 10:00 AM
andreaswall,
I tried the following api query and did see all 4 classes within the response:
GET https://a.p.i.c/api/node/class/fvAEPg.json?rsp-subtree=full
If you run your query without the filter and rsp-subtree-include, are you still not seeing any fvRsCEpToPathEp?
-Gabriel
12-03-2017 11:59 PM
No, then I can see it. It is a child object under fvCEp.
Since fvCEp can contain several fvIp child objects i want to run the query on just fvIp.
But I want the result to contain fvAEPg, fvCEp, fvIp and fvRsCEpToPathEp.
Maybe this is not possible or I do not understand the API correctly.
12-06-2017 10:24 AM
maybe I am confusing things.
It's not that I am not seeing fvRsCEpToPathEp under fvCEp.
If I run my query without "rsp-subtree-include=required" I get all fvAEPg objects. The one which contains my fvIp.addr will have the subtree down to the children included in fvIp. But no other child objects under that particular fvAEPg.
If I run it with rsp-subtree-include=required" the response will be only that fgvAEPg which contains the fvIp.addr I searched for.
Butmy dilemma is that I want the response to either be the entire fvAEPg object in which the fvIp.addr query matches or just the fvAEPG, the fvCEp child and the fvIp, fvRsCEpToPathEp child objects under that.
It's hard to explain but maybe it's clear to someone :)
12-06-2017 10:44 AM
andreaswall,
So is your end goal to search on an IP and be able to discern what EPG it is existing under? If so, here is a method that will get you everything except for the fvAEPg mo. However, you can discern the EPG from the DN of the fvCEp:
GET https://a.p.i.c/api/class/fvCEp.json?query-target-filter=eq(fvCEp.ip,"10.0.128.70")&rsp-subtree=full
of course this assumes that your fvIp.addr value has been written to fvCEp.ip.
I will keep digging to see if what you ask is possible. As a pointer for testing, we also have the following option:
target-subtree-class=fvAEPg,fvCEp,fvIp ,fvRsCEpToPathEp
Although I have yet to get it to respond in the manner you are requesting.
-Gabriel
12-07-2017 05:30 AM
yes, since a fvCEp can contain several fvIp childs I would like to query those.
And yes, I would like to get the whole fvAEPg in which it is contained. Or just the child classes I need.
Thanks for your time on this!
02-22-2019 06:50 AM
03-12-2024 07:39 PM
I am using this to find out BD, vrf, and epg information for a specific endpoint's IP. It's taking so long like 50s.
Is there a way to speed this query up? I tried to modify the query parameters, etc. But not working.
GET https://a.p.i.c/api/class/fvCEp.json?query-target-filter=eq(fvCEp.ip,"10.0.128.70")&rsp-subtree=full
03-13-2024 12:51 AM
Class "fvCEp" does not have an attribute called "ip". Maybe it did in an earlier version. But not in 5.2(5e) at least.
In my installation this works instead:
api/class/fvCEp.json?rsp-subtree=full&query-target=children&query-target-filter=eq(fvIp.addr,"x.x.x.x")
If your query works but takes long time I have no direct answer to why at the moment. Are you sure that it is the query that takes long time?
03-13-2024 01:42 PM
Another example of why this post is so relevant
03-13-2024 02:06 PM
Yes, it's taking a while. We have APIC version 5.2(5c).
03-14-2024 11:41 AM - edited 03-14-2024 12:11 PM
So, I just came to realize that api endpoint is 3x faster for another site (we have multi-site, using NDO). That site that responds much faster has less # of MO's (bd/vrf/endpoints, etc) compared to the slower site.
Could the higher # of MO's be the reason of slow response, since APIC now has many more objects to search through to get the required information?
If there is another api endpoint that I can use to get the epg details (BD, app profile, vrf), please share.
03-14-2024 11:47 PM
I think this is going a bit off topic now. Perhaps you should start a new thread that will be more aligned with your specific problem.
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