Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestPy:Class based queries #56

Closed
muthvar1 opened this issue Apr 24, 2019 · 1 comment
Closed

RestPy:Class based queries #56

muthvar1 opened this issue Apr 24, 2019 · 1 comment
Assignees

Comments

@muthvar1
Copy link

Hi Folks,
I remember in one of the deep dive sessions provided to us we went through an example that describes my query below. But I can't seem to recollect the solution. Would someone be able to provide the answer or point to an implementation.

What I basically need is a class based query for a specific class that is the input to the function, without having to derive the tree of parent Objects.

What works now:

ipV4Object = ethernetObject.Ipv4.find(Name='1/11/13_ethernet_t0:ctx0_b5_sepg4_ 1')

What I need to work: IxNetwork.Topology.DeviceGroup.Ethernet.Ipv4.find(Name='1/7/11_ethernet_t0:ctx1_b4_sepg5_ 1')

Right now the above command typed as is results in the following error.

IxNetwork.Topology.DeviceGroup.Ethernet.Ipv4.find(Name='1/7/11_ethernet_t0:ctx1_b4_sepg5_ 1')
Traceback (most recent call last):
File "", line 1, in
File "/local/vamuthal/Ixia_RestPy/RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/ipv4.py", line 690, in find
return self._select(locals())
File "/local/vamuthal/Ixia_RestPy/RestPy/ixnetwork_restpy/base.py", line 342, in _select
end = len(self._parent.href)
File "/local/vamuthal/Ixia_RestPy/RestPy/ixnetwork_restpy/base.py", line 102, in href
return self._get_attribute('href')
File "/local/vamuthal/Ixia_RestPy/RestPy/ixnetwork_restpy/base.py", line 122, in _get_attribute
raise NotFoundError('The attribute %s is not in the internal list of object dicts. (%s)' % (name, e))
NotFoundError: The attribute href is not in the internal list of object dicts. (list index out of range)

@ajbalogh ajbalogh self-assigned this Apr 24, 2019
@ajbalogh
Copy link

We currently do not support this methodology for finding instances as parent instances are required at this time.
We are looking at implementing a solution that does not require parent instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants