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

Get APIs for various core classes #29

Open
kevin-w-du opened this issue Jul 21, 2021 · 2 comments
Open

Get APIs for various core classes #29

kevin-w-du opened this issue Jul 21, 2021 · 2 comments

Comments

@kevin-w-du
Copy link
Member

It will be great if we can provide the APIs in each class to allow users to enumerate its direct internal elements. I do see some classes already have such APIs, but not all. These APIs will be very helpful for others to build on top of an existing base-layer component.

  • For IX: provide getASes()
  • For AS: provide getNetworks(): this one already exists. I do see several other useful get APIs in this class.
  • For AS: provide getPeers(): get the peering relationship and the location (IX) of the peering.
  • For Network: provide getHosts() and getRouters()
  • For Router: provide getNetworks(): get the list of the networks it is attached to
  • for Hosts: provide getServices(): not sure whether this is doable after the binding. If not, it is better to leave it out.
@magicnat
Copy link
Member

The problem with these is that a lot of the information are not in the class themself. These API will not be possible unless you want them to available only after render.

Problem with the InternetExchange and AutonomousSystem class is that they do not know what ASes are connected to them (at least not before the emulator is rendered, as all peering are stored in the Ebgp layer)

Networks, too, do not know what hosts/routers are connected before rendered. There is a getAssociations to get a list of connected nodes after the render.

Router do know a list of names of the networks they have connected to before render, but those are just names, not the actual Network object.

The reason for using names instead of the actual object is to allow connecting to a network that does not exist yet - which can happen when using a component.

Host also cannot do getServices before render, but should be possible to add after render.

@kevin-w-du
Copy link
Member Author

kevin-w-du commented Jul 21, 2021

Returning names is fine.

It seems that adding these APIs is difficult. We will keep this issue open, and see whether we can come up with ideas to do it (maybe in other ways). The goal is to help users get an instance of an object without knowing names.

For example, after loading a base component, I would like to add a host to a network within an AS, but I don't want to be bothered with the name of the network (this name is supposed to be an internal name).

amdfxlucas added a commit to amdfxlucas/seed-emulator that referenced this issue Jan 29, 2025
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