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

Topology files changed their name #45

Open
maxdevyatov opened this issue Dec 12, 2020 · 4 comments
Open

Topology files changed their name #45

maxdevyatov opened this issue Dec 12, 2020 · 4 comments

Comments

@maxdevyatov
Copy link

Any reason why files here were renamed with some kind of hash at the end?
https://github.com/OpenIxia/ixnetwork_restpy/tree/master/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology

For instance
bgpipv4peer_9dd9eddcf2bd784d82d8a016e392f035.py

Is it a permanent change or an error?

@ajbalogh
Copy link
Collaborator

Its a permanent change due to the recursive /topology/... hierarchy, reuse of object names within that hierarchy and long pathnames not supported in 2.7.
The Bgpipv4peer class instance should be retrieved via dot notation from parent objects using the .find() method.
Is the nested dot notation sufficient for your use cases?

@maxdevyatov
Copy link
Author

maxdevyatov commented Dec 18, 2020

Thank you for your reply.

The Bgpipv4peer class instance should be retrieved via dot notation from parent objects using the .find() method.
Is the nested dot notation sufficient for your use cases?

I don't think it will work. We use these classes mostly for type hinting.

@ajbalogh
Copy link
Collaborator

Hi Max,

If you have time would you provide a sample of how you use the class for type hinting?

@maxdevyatov
Copy link
Author

maxdevyatov commented Dec 18, 2020

how you use the class for type hinting?

Just to show an idea. Something like

from ixnetwork_restpy.testplatform.sessions.ixnetwork.ixnetwork import Ixnetwork
from ixnetwork_restpy.testplatform.sessions.ixnetwork.topology.topology import Topology
from ixnetwork_restpy.testplatform.sessions.ixnetwork.vport.vport import Vport

def add_topology(vport: Vport, ixnet: Ixnetwork ) -> Topology:
    topology: "Topology" = ixnet.ixnetwork.Topology.add(
        Name="name", Ports=vport
    )
    return topology

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