VOL-670: Implement OF port_mod handling for logical devices.
Change-Id: I882790f7d70ec812ba6adc0d01e128ed6a98cbbf
diff --git a/ofagent/grpc_client.py b/ofagent/grpc_client.py
index ccdb98b..1214507 100644
--- a/ofagent/grpc_client.py
+++ b/ofagent/grpc_client.py
@@ -28,7 +28,7 @@
from twisted.internet.defer import inlineCallbacks, returnValue, DeferredQueue
from protos.voltha_pb2 import ID, VolthaLocalServiceStub, FlowTableUpdate, \
- FlowGroupTableUpdate, PacketOut
+ FlowGroupTableUpdate, PacketOut, LogicalPortId
from google.protobuf import empty_pb2
@@ -148,6 +148,13 @@
self.packet_out_queue.put(packet_out)
@inlineCallbacks
+ def get_port(self, device_id, port_id):
+ req = LogicalPortId(id=device_id, port_id=port_id)
+ res = yield threads.deferToThread(
+ self.local_stub.GetLogicalDevicePort, req)
+ returnValue(res)
+
+ @inlineCallbacks
def get_port_list(self, device_id):
req = ID(id=device_id)
res = yield threads.deferToThread(
@@ -155,6 +162,26 @@
returnValue(res.items)
@inlineCallbacks
+ def enable_port(self, device_id, port_id):
+ req = LogicalPortId(
+ id=device_id,
+ port_id=port_id
+ )
+ res = yield threads.deferToThread(
+ self.local_stub.EnableLogicalDevicePort, req)
+ returnValue(res)
+
+ @inlineCallbacks
+ def disable_port(self, device_id, port_id):
+ req = LogicalPortId(
+ id=device_id,
+ port_id=port_id
+ )
+ res = yield threads.deferToThread(
+ self.local_stub.DisableLogicalDevicePort, req)
+ returnValue(res)
+
+ @inlineCallbacks
def get_device_info(self, device_id):
req = ID(id=device_id)
res = yield threads.deferToThread(