blob: 023af13ab0efd3eac779b2f143885c6bcd7a32af [file] [log] [blame]
HIGUCHI Yutae3e90632016-05-11 16:44:01 -07001syntax = "proto3";
2option java_package = "org.onosproject.grpc.net.device";
3
Jian Lic9b4bf12017-06-26 23:50:32 +09004import "net/device/DeviceDescriptionProto.proto";
5import "net/device/PortDescriptionProto.proto";
6import "net/device/PortStatisticsProto.proto";
Jian Lia9a77ca2017-12-08 03:06:03 +09007import "net/MastershipRoleProto.proto";
HIGUCHI Yutae3e90632016-05-11 16:44:01 -07008
9package Device;
10
11message DeviceConnected {
12 // DeviceID as String DeviceId#toString
13 string device_id = 1;
Jian Lic9b4bf12017-06-26 23:50:32 +090014 net.device.DeviceDescriptionProto device_description = 2;
HIGUCHI Yutae3e90632016-05-11 16:44:01 -070015}
16
17message DeviceDisconnected {
18 // DeviceID as String DeviceId#toString
19 string device_id = 1;
20}
21
22message UpdatePorts {
23 // DeviceID as String DeviceId#toString
24 string device_id = 1;
Jian Lic9b4bf12017-06-26 23:50:32 +090025 repeated net.device.PortDescriptionProto port_descriptions= 2;
HIGUCHI Yutae3e90632016-05-11 16:44:01 -070026}
27
28message PortStatusChanged {
29 // DeviceID as String DeviceId#toString
30 string device_id = 1;
Jian Lic9b4bf12017-06-26 23:50:32 +090031 net.device.PortDescriptionProto port_description= 2;
HIGUCHI Yutae3e90632016-05-11 16:44:01 -070032}
33
34message ReceivedRoleReply {
35 // DeviceID as String DeviceId#toString
36 string device_id = 1;
Jian Lia9a77ca2017-12-08 03:06:03 +090037 net.MastershipRoleProto requested = 2;
38 net.MastershipRoleProto response = 3;
HIGUCHI Yutae3e90632016-05-11 16:44:01 -070039}
40
41message UpdatePortStatistics {
42 // DeviceID as String DeviceId#toString
43 string device_id = 1;
Jian Lic9b4bf12017-06-26 23:50:32 +090044 repeated net.device.PortStatisticsProto port_statistics = 2;
HIGUCHI Yutae3e90632016-05-11 16:44:01 -070045}
46
47message RegisterProvider {
48 // DeviceProvider's ProviderId scheme
49 string provider_scheme = 1;
50}
51
52message 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
69message TriggerProbe {
70 // DeviceID as String DeviceId#toString
71 string device_id = 1;
72}
73
74message RoleChanged {
75 // DeviceID as String DeviceId#toString
76 string device_id = 1;
Jian Lia9a77ca2017-12-08 03:06:03 +090077 net.MastershipRoleProto new_role = 2;
HIGUCHI Yutae3e90632016-05-11 16:44:01 -070078}
79
80message IsReachableRequest {
81 int32 xid = 1;
82 // DeviceID as String DeviceId#toString
83 string device_id = 2;
84}
85
86message IsReachableResponse {
87 int32 xid = 1;
88 bool is_reachable = 2;
89}
90
91message DeviceProviderMsg {
92 oneof method {
93 TriggerProbe trigger_probe = 1;
94 RoleChanged role_changed = 2;
95 IsReachableRequest is_reachable_request= 3;
96 }
97}
98
99service DeviceProviderRegistryRpc {
100 rpc Register(stream DeviceProviderServiceMsg) returns (stream DeviceProviderMsg);
101}