HIGUCHI Yuta | e3e9063 | 2016-05-11 16:44:01 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | option java_package = "org.onosproject.grpc.net.device"; |
| 3 | |
Jian Li | c9b4bf1 | 2017-06-26 23:50:32 +0900 | [diff] [blame] | 4 | import "net/device/DeviceDescriptionProto.proto"; |
| 5 | import "net/device/PortDescriptionProto.proto"; |
| 6 | import "net/device/PortStatisticsProto.proto"; |
Jian Li | a9a77ca | 2017-12-08 03:06:03 +0900 | [diff] [blame] | 7 | import "net/MastershipRoleProto.proto"; |
HIGUCHI Yuta | e3e9063 | 2016-05-11 16:44:01 -0700 | [diff] [blame] | 8 | |
| 9 | package Device; |
| 10 | |
| 11 | message DeviceConnected { |
| 12 | // DeviceID as String DeviceId#toString |
| 13 | string device_id = 1; |
Jian Li | c9b4bf1 | 2017-06-26 23:50:32 +0900 | [diff] [blame] | 14 | net.device.DeviceDescriptionProto device_description = 2; |
HIGUCHI Yuta | e3e9063 | 2016-05-11 16:44:01 -0700 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | message DeviceDisconnected { |
| 18 | // DeviceID as String DeviceId#toString |
| 19 | string device_id = 1; |
| 20 | } |
| 21 | |
| 22 | message UpdatePorts { |
| 23 | // DeviceID as String DeviceId#toString |
| 24 | string device_id = 1; |
Jian Li | c9b4bf1 | 2017-06-26 23:50:32 +0900 | [diff] [blame] | 25 | repeated net.device.PortDescriptionProto port_descriptions= 2; |
HIGUCHI Yuta | e3e9063 | 2016-05-11 16:44:01 -0700 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | message PortStatusChanged { |
| 29 | // DeviceID as String DeviceId#toString |
| 30 | string device_id = 1; |
Jian Li | c9b4bf1 | 2017-06-26 23:50:32 +0900 | [diff] [blame] | 31 | net.device.PortDescriptionProto port_description= 2; |
HIGUCHI Yuta | e3e9063 | 2016-05-11 16:44:01 -0700 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | message ReceivedRoleReply { |
| 35 | // DeviceID as String DeviceId#toString |
| 36 | string device_id = 1; |
Jian Li | a9a77ca | 2017-12-08 03:06:03 +0900 | [diff] [blame] | 37 | net.MastershipRoleProto requested = 2; |
| 38 | net.MastershipRoleProto response = 3; |
HIGUCHI Yuta | e3e9063 | 2016-05-11 16:44:01 -0700 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | message UpdatePortStatistics { |
| 42 | // DeviceID as String DeviceId#toString |
| 43 | string device_id = 1; |
Jian Li | c9b4bf1 | 2017-06-26 23:50:32 +0900 | [diff] [blame] | 44 | repeated net.device.PortStatisticsProto port_statistics = 2; |
HIGUCHI Yuta | e3e9063 | 2016-05-11 16:44:01 -0700 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | message RegisterProvider { |
| 48 | // DeviceProvider's ProviderId scheme |
| 49 | string provider_scheme = 1; |
| 50 | } |
| 51 | |
| 52 | message DeviceProviderServiceMsg { |
| 53 | oneof method { |
| 54 | DeviceConnected device_connected= 1; |
| 55 | DeviceDisconnected device_disconnected = 2; |
| 56 | UpdatePorts update_ports= 3; |
| 57 | PortStatusChanged port_status_changed = 4; |
| 58 | ReceivedRoleReply received_role_reply = 5; |
| 59 | UpdatePortStatistics update_port_statistics = 6; |
| 60 | |
| 61 | // This message is for return value of DeviceProvider#isReachable |
| 62 | IsReachableResponse is_reachable_response = 7; |
| 63 | |
| 64 | // This MUST be the 1st message over the stream |
| 65 | RegisterProvider register_provider = 8; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | message TriggerProbe { |
| 70 | // DeviceID as String DeviceId#toString |
| 71 | string device_id = 1; |
| 72 | } |
| 73 | |
| 74 | message RoleChanged { |
| 75 | // DeviceID as String DeviceId#toString |
| 76 | string device_id = 1; |
Jian Li | a9a77ca | 2017-12-08 03:06:03 +0900 | [diff] [blame] | 77 | net.MastershipRoleProto new_role = 2; |
HIGUCHI Yuta | e3e9063 | 2016-05-11 16:44:01 -0700 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | message IsReachableRequest { |
| 81 | int32 xid = 1; |
| 82 | // DeviceID as String DeviceId#toString |
| 83 | string device_id = 2; |
| 84 | } |
| 85 | |
| 86 | message IsReachableResponse { |
| 87 | int32 xid = 1; |
| 88 | bool is_reachable = 2; |
| 89 | } |
| 90 | |
| 91 | message DeviceProviderMsg { |
| 92 | oneof method { |
| 93 | TriggerProbe trigger_probe = 1; |
| 94 | RoleChanged role_changed = 2; |
| 95 | IsReachableRequest is_reachable_request= 3; |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | service DeviceProviderRegistryRpc { |
| 100 | rpc Register(stream DeviceProviderServiceMsg) returns (stream DeviceProviderMsg); |
| 101 | } |