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:Fastest way to get ipv4 object associated with a specific Ip? #55

Closed
muthvar1 opened this issue Apr 23, 2019 · 7 comments
Closed
Assignees

Comments

@muthvar1
Copy link

Hi Folks,
Is there a short and fast way to get the ipv4 object associated with an ipv4 or ipv6 address if we have the address?
I am looking to see if you have something below.
IxNetwork.Topology.DeviceGroup.Ethernet.Ipv4.find(Value = '2.2.2.2')

Note: there could be an iterator so it could be a list of ips also and not a single value.

@whandjr
Copy link
Contributor

whandjr commented Apr 24, 2019 via email

@muthvar1
Copy link
Author

Hi Wes,
The use case in my scenario is that I within our test scripts for certain triggers, we would need to find the object(s) associated with an ip(s) to start or stop that specific device or send an arp/ns etc. Thsi is basically mimicking what we have available and perform routinely on the IxNetwork GUI client.

Secondly,
You do have the Values under the iterator(multivalue Object) assigned to a specific attribute under the Address reference Object right? So should'nt there be a way to get this implemented then?

ipObject.href
u'/api/v1/sessions/11/ixnetwork/topology/5/deviceGroup/2/ethernet/1/ipv4/1'
ipObject.Address.Values
[u'56.28.0.12', u'56.28.0.13', u'56.28.0.14', u'56.28.0.15', u'56.28.0.16', u'56.28.0.17', u'56.28.0.18', u'56.28.0.19', u'56.28.0.20', u'56.28.0.21']

@whandjr
Copy link
Contributor

whandjr commented Apr 24, 2019 via email

@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.

@muthvar1
Copy link
Author

Thanks Wes,Andy.
Is there a way we can document and track this request? This is something that we were really looking forward to in the RestPy SDK since it is an operation that was lacking in the earlier HLT sdk.
This meant that we had to store numerous handles for every single ip we configured in some global data structure and maintain this through our tests.
I was hoping with the query(find) functionality in the RestPy SDK that this would have been solved. At least this was my assumption.

Secondly. Is there any other way we can get this object? Seems like without having a reference parent object stored in some data structure that is maintained throughout the script life cycle, we can't query individual objects?
Would the only way to retrieve this object (assuming we only use list patterns) is to retrieve all topologies, all devices under topologies, all ethernet devices under topologies and then do a nested search within that to get the related ipv4Object?

@ajbalogh
Copy link

You can get this object by specifying the find for all parent objects.
A, B, C, D below would be replaced with the names of those objects.

ipv4 = Topology.find(Name='A'),DeviceGroup.find(Name='B').Ethernet.find(Name='C').Ipv4.find(Name='D')

@muthvar1
Copy link
Author

Hi Andy,
The issue is that I would'nt know the name of the parent objects here. All that the consumer for this function would have is the ip address.

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

3 participants