core
core copied to clipboard
distributed-how to config node's services with gprc?only should use python's example?
Describe follow examples: https://github.com/coreemu/core/blob/master/package/examples/grpc/distributed_switch.py https://github.com/coreemu/core/blob/master/package/examples/configservices/switch.py
seems not support options in core.api.grpc.wrappers.Session.add_node
Traceback (most recent call last):
File "/home/demo/n.py", line 340, in createNode
node_obj = self.session.add_node(_id=_id, name=_name, model=_model, position=_position, server=_server, options=options)
TypeError: Session.add_node() got an unexpected keyword argument 'options
the add_node function on the wrapper object here is just a convenience that takes a few of the typical parameters. You can manually set anything on a node after creation when returned. I am not sure what you are trying to do.
You cannot mix usage of gRPC and direct python together. That will never work.
the
add_nodefunction on thewrapperobject here is just a convenience that takes a few of the typical parameters. You can manually set anything on a node after creation when returned. I am not sure what you are trying to do.You cannot mix usage of gRPC and direct python together. That will never work.
1.You can manually set anything on a node after creation when returned. How to set config_services with gRPC, any example? Haven't found yet.
Already tried this, but it will become nothing happen:
node_obj = self.session.add_node(_id=_id, name=_name, model="router", position=_position, server=_server)
node_obj.config_services = ["zebra","OSFPv2", "IPForward"] #["OSFPv2", "IPForward"]
session.add_link
coreemu.start_session(session)
2.You cannot mix usage of gRPC and direct python together, just use gRPC, but as compare found python example support "options" parameter.
https://github.com/coreemu/core/blob/master/package/examples/python/distributed_switch.py
node2 = session.add_node(CoreNode, options=options)