def foo(): keys = [''] for i in keys: key = vswitch_interface_pb2.req_interface_key() key.uuid_type = 2 key.uuid = i yield key
def rpc_client_unregister_vswitch_interface(stub, uuid): key = vswitch_interface_pb2.req_interface_key() key.uuid = uuid stub.rpc_unregister_vswitch_interface(key)
def _key_generator2(lanzone_list): for lanzone in lanzone_list: key = vswitch_interface_pb2.req_interface_key() key.uuid_type = 2 key.uuid = lanzone yield key
def _key_generator1(host_list): for host in host_list: key = vswitch_interface_pb2.req_interface_key() key.uuid_type = 1 key.uuid = host yield key
def _key_generator0(uuid_list): for uuid in uuid_list: key = vswitch_interface_pb2.req_interface_key() key.uuid_type = 0 key.uuid = uuid yield key
def rpc_client_get_vswitch_interface(stub, uuid): key = vswitch_interface_pb2.req_interface_key() key.uuid = uuid return stub.rpc_get_vswitch_interface(key)
ifaces = rpc_client_list_vswitch_interfaces_for_hosts( stub, ['bf2e1bfe-1e85-4205-b9db-0b234e920017']) ifaces = rpc_client_list_vswitch_interfaces_for_lanzone( stub, ['763cfbf2-f014-479e-a522-5ceb9926de4f']) for iface in ifaces: print(iface) iface = rpc_client_register_vswitch_interface( stub, 'a8c07386-d5d1-43cc-bcd1-06e2a37c225e', '00.0.2', '4e8d1fca-6398-416a-aa78-2e0d50270338') rpc_client_update_vswitch_interface(stub, iface.id, interface_type='exclusive') print(rpc_client_get_vswitch_interface(stub, iface.id)) rpc_client_unregister_vswitch_interface(stub, iface.id) sys.exit() key = vswitch_interface_pb2.req_interface_key() key.uuid = 'aef0a53a-b90c-4a51-afa9-ee3b3db77a6b' print(stub.rpc_get_vswitch_interface(key)) def foo(): keys = [''] for i in keys: key = vswitch_interface_pb2.req_interface_key() key.uuid_type = 2 key.uuid = i yield key ifaces = stub.rpc_list_vswitch_interfaces(foo()) for iface in ifaces: print(iface) iface = vswitch_interface_pb2.res_vswitch_interface()