diff options
Diffstat (limited to 'framework/src/onos/incubator/rpc-grpc/src/main/proto')
-rw-r--r-- | framework/src/onos/incubator/rpc-grpc/src/main/proto/Device.proto | 131 | ||||
-rw-r--r-- | framework/src/onos/incubator/rpc-grpc/src/main/proto/Port.proto | 40 |
2 files changed, 171 insertions, 0 deletions
diff --git a/framework/src/onos/incubator/rpc-grpc/src/main/proto/Device.proto b/framework/src/onos/incubator/rpc-grpc/src/main/proto/Device.proto new file mode 100644 index 00000000..aae46d96 --- /dev/null +++ b/framework/src/onos/incubator/rpc-grpc/src/main/proto/Device.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; +option java_package = "org.onosproject.grpc"; + +import "Port.proto"; +package Device; + +enum DeviceType { + OTHER = 0; + SWITCH = 1; + ROUTER = 2; + ROADM = 3; + OTN = 4; + ROADM_OTN = 5; + FIREWALL = 6; + BALANCER = 7; + IPS = 8; + IDS = 9; + CONTROLLER = 10; + VIRTUAL = 11; + FIBER_SWITCH = 12; + MICROWAVE = 13; +} + +message DeviceDescription { + string device_Uri = 1; + DeviceType type = 2; + string manufacturer = 3; + string hw_version = 4; + string sw_version = 5; + string serial_number = 6; + string chassis_id = 7; + map<string, string> annotations = 8; +} + +enum MastershipRole { + NONE = 0; + MASTER = 1; + STANDBY = 2; +} + +message DeviceConnected { + // DeviceID as String DeviceId#toString + string device_id = 1; + DeviceDescription device_description = 2; +} + +message DeviceDisconnected { + // DeviceID as String DeviceId#toString + string device_id = 1; +} + +message UpdatePorts { + // DeviceID as String DeviceId#toString + string device_id = 1; + repeated Port.PortDescription port_descriptions= 2; +} + +message PortStatusChanged { + // DeviceID as String DeviceId#toString + string device_id = 1; + Port.PortDescription port_description= 2; +} + +message ReceivedRoleReply { + // DeviceID as String DeviceId#toString + string device_id = 1; + MastershipRole requested = 2; + MastershipRole response = 3; +} + +message UpdatePortStatistics { + // DeviceID as String DeviceId#toString + string device_id = 1; + repeated Port.PortStatistics port_statistics = 2; +} + +message RegisterProvider { + // DeviceProvider's ProviderId scheme + string provider_scheme = 1; +} + +message DeviceProviderServiceMsg { + oneof method { + DeviceConnected device_connected= 1; + DeviceDisconnected device_disconnected = 2; + UpdatePorts update_ports= 3; + PortStatusChanged port_status_changed = 4; + ReceivedRoleReply received_role_reply = 5; + UpdatePortStatistics update_port_statistics = 6; + + // This message is for return value of DeviceProvider#isReachable + IsReachableResponse is_reachable_response = 7; + + // This MUST be the 1st message over the stream + RegisterProvider register_provider = 8; + } +} + +message TriggerProbe { + // DeviceID as String DeviceId#toString + string device_id = 1; +} + +message RoleChanged { + // DeviceID as String DeviceId#toString + string device_id = 1; + MastershipRole new_role = 2; +} + +message IsReachableRequest { + int32 xid = 1; + // DeviceID as String DeviceId#toString + string device_id = 2; +} + +message IsReachableResponse { + int32 xid = 1; + bool is_reachable = 2; +} + +message DeviceProviderMsg { + oneof method { + TriggerProbe trigger_probe = 1; + RoleChanged role_changed = 2; + IsReachableRequest is_reachable_request= 3; + } +} + +service DeviceProviderRegistryRpc { + rpc Register(stream DeviceProviderServiceMsg) returns (stream DeviceProviderMsg); +} diff --git a/framework/src/onos/incubator/rpc-grpc/src/main/proto/Port.proto b/framework/src/onos/incubator/rpc-grpc/src/main/proto/Port.proto new file mode 100644 index 00000000..f32193cc --- /dev/null +++ b/framework/src/onos/incubator/rpc-grpc/src/main/proto/Port.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +option java_package = "org.onosproject.grpc"; + +package Port; + +enum PortType { + // Signifies copper-based connectivity. + COPPER = 0; + // Signifies optical fiber-based connectivity. + FIBER = 1; + // Signifies optical fiber-based packet port. + PACKET = 2; + // Signifies optical fiber-based optical tributary port (called T-port). + //The signal from the client side will be formed into a ITU G.709 (OTN) frame. + ODUCLT = 3; + // Signifies optical fiber-based Line-side port (called L-port). + OCH = 4; + // Signifies optical fiber-based WDM port (called W-port). + //Optical Multiplexing Section (See ITU G.709). + OMS = 5; + // Signifies virtual port. + VIRTUAL = 6; +} + +// TODO What are we going to do with more specific PortDescription ... +message PortDescription { + // PortNumber as String PortNumber#toString + string port_number = 1; + bool is_enabled = 2; + PortType type = 3; + int64 port_speed = 4; + map<string, string> annotations = 8; +} + +message PortStatistics { + int32 port = 1; + int64 packets_received = 2; + int64 packets_sent = 3; + // TODO add all other fields +} |