blob: 1d4dc788d45ccdfa60f9e6c114cd74568b574176 [file] [log] [blame]
Zack Williams52209662019-02-07 10:15:31 -07001/*
2 * Top-level Voltha API definition
3 *
4 * For details, see individual definition files.
5 */
6
7syntax = "proto3";
8
khenaidoo5fc5cea2021-08-11 17:39:16 -04009option go_package = "github.com/opencord/voltha-protos/v5/go/voltha";
Zack Williams52209662019-02-07 10:15:31 -070010
11package voltha;
12
13import "google/api/annotations.proto";
14import "google/protobuf/empty.proto";
15
16import public "voltha_protos/meta.proto";
17import public "voltha_protos/common.proto";
18import public "voltha_protos/health.proto";
19import public "voltha_protos/logical_device.proto";
20import public "voltha_protos/device.proto";
21import public "voltha_protos/adapter.proto";
22import public "voltha_protos/openflow_13.proto";
23
24import "voltha_protos/omci_mib_db.proto";
25import "voltha_protos/omci_alarm_db.proto";
dpaul2b52e712020-06-23 13:02:28 +053026import "voltha_protos/ext_config.proto";
Zack Williams52209662019-02-07 10:15:31 -070027
28option java_package = "org.opencord.voltha";
29option java_outer_classname = "VolthaProtos";
30option csharp_namespace = "Opencord.Voltha.Voltha";
31
32message DeviceGroup {
33
34 string id = 1 [(access) = READ_ONLY];
35
36 repeated LogicalDevice logical_devices = 2 [(child_node) = {key: "id"}];
37
38 repeated Device devices = 3 [(child_node) = {key: "id"}];
39}
40
41message DeviceGroups {
42 repeated DeviceGroup items = 1;
43}
44
45
Devmalya Paul96a2c9e2019-11-06 07:17:44 +000046message EventFilterRuleKey {
Zack Williams52209662019-02-07 10:15:31 -070047
Devmalya Paul96a2c9e2019-11-06 07:17:44 +000048 enum EventFilterRuleType {
49 filter_all = 0;
50 category = 1;
51 sub_category = 2;
52 kpi_event_type = 3;
53 config_event_type = 4;
54 device_event_type = 5;
Zack Williams52209662019-02-07 10:15:31 -070055 }
56}
57
Devmalya Paul96a2c9e2019-11-06 07:17:44 +000058message EventFilterRule {
59 EventFilterRuleKey.EventFilterRuleType key = 1;
Zack Williams52209662019-02-07 10:15:31 -070060 string value = 2;
61}
Devmalya Paul96a2c9e2019-11-06 07:17:44 +000062message EventFilter {
Zack Williams52209662019-02-07 10:15:31 -070063 string id = 1 [(access) = READ_ONLY];
Devmalya Paul96a2c9e2019-11-06 07:17:44 +000064 bool enable = 2;
65 string device_id = 3;
66 string event_type = 4;
67 repeated EventFilterRule rules = 5;
Zack Williams52209662019-02-07 10:15:31 -070068}
69
Devmalya Paul96a2c9e2019-11-06 07:17:44 +000070message EventFilters {
71 repeated EventFilter filters = 1;
Zack Williams52209662019-02-07 10:15:31 -070072}
73
Zack Williams52209662019-02-07 10:15:31 -070074// CoreInstance represents a core instance. It is data held in memory when a core
75// is running. This data is not persistent.
76message CoreInstance {
Zack Williams52209662019-02-07 10:15:31 -070077
78 string instance_id = 1 [(access) = READ_ONLY];
79
80 HealthStatus health = 2 [(child_node) = {}];
81
82}
83
84message CoreInstances {
Zack Williams52209662019-02-07 10:15:31 -070085 repeated CoreInstance items = 1;
86}
87
onkar.kundargi7b85fa12020-02-27 13:19:22 +053088message OmciTestRequest {
89 string id = 1;
90 string uuid = 2;
91}
92
93message TestResponse{
94 enum TestResponseResult {
95 SUCCESS = 0;
96 FAILURE = 1;
97 }
98 TestResponseResult result = 1;
99}
100
dpaul2b52e712020-06-23 13:02:28 +0530101message ValueSet {
102 string id = 1;
103 oneof value{
104 config.AlarmConfig alarm_config = 2;
105 }
106}
107
Zack Williams52209662019-02-07 10:15:31 -0700108// Voltha represents the Voltha cluster data. Each Core instance will hold a subset of
109// the entire cluster. However, some items (e.g. adapters) will be held by all cores
110// for better performance
111message Voltha {
Zack Williams52209662019-02-07 10:15:31 -0700112
113 string version = 1 [(access) = READ_ONLY];
114
115 repeated Adapter adapters = 2 [(child_node) = {key: "id"}];
116
117 repeated LogicalDevice logical_devices = 3 [(child_node) = {key: "id"}];
118
119 repeated Device devices = 4 [(child_node) = {key: "id"}];
120
121 repeated DeviceType device_types = 5 [(child_node) = {key: "id"}];
122
123 repeated DeviceGroup device_groups = 6 [(child_node) = {key: "id"}];
124
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000125 repeated EventFilter event_filters = 7 [(child_node) = {key: "id"}];
Zack Williams52209662019-02-07 10:15:31 -0700126
127 repeated
128 omci.MibDeviceData omci_mib_database = 28
129 [(child_node) = {key: "device_id"}];
130
131 repeated
William Kurkian12fc0af2019-04-18 14:27:45 -0400132 omci.AlarmDeviceData omci_alarm_database = 29
Zack Williams52209662019-02-07 10:15:31 -0700133 [(child_node) = {key: "device_id"}];
134}
135
136// Device Self Test Response
137message SelfTestResponse {
Zack Williams52209662019-02-07 10:15:31 -0700138
139 enum SelfTestResult {
140 SUCCESS = 0;
141 FAILURE = 1;
142 NOT_SUPPORTED = 2;
143 UNKNOWN_ERROR = 3;
144 }
145 SelfTestResult result = 1;
146}
147
148message OfAgentSubscriber {
149 // ID of ofagent instance
150 string ofagent_id = 1;
151
152 // ID of voltha instance to which the ofagent is subscribed
153 string voltha_id = 2;
154}
155
William Kurkian6ea97f82019-03-13 15:51:55 -0400156// Identifies a membership group a Core belongs to
157message Membership {
158 // Group name
159 string group_name = 1;
160
161 // Unique ID of a container within that group
162 string id = 2;
163}
164
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100165message DeviceImageDownloadRequest {
166
167 // Device Id
168 // allows for operations on multiple devices.
169 repeated common.ID device_id = 1;
170
171 //The image for the device containing all the information
172 Image image = 2;
173
174 //Activate the image if the download to the device is successful
175 bool activateOnSuccess = 3;
176
177 //Automatically commit the image if the activation on the device is successful
178 bool commitOnSuccess = 4;
179}
180
181message DeviceImageRequest {
182
183 //Device Id
184 //allows for operations on multiple adapters.
185 repeated common.ID device_id = 1;
186
187 // Image Version, this is the sole identifier of the image. it's the vendor specified OMCI version
188 // must be known at the time of initiating a download, activate, commit image on an onu.
189 string version = 2;
190
191 //Automatically commit the image if the activation on the device is successful
192 bool commitOnSuccess = 3;
193}
194
195message DeviceImageResponse {
196
197 //Image state for the different devices
198 repeated DeviceImageState device_image_states = 1;
199}
200
manikkaraj k166cb202019-07-28 13:05:56 -0400201// Additional information required to process flow at device adapters
202message FlowMetadata {
203 // Meters associated with flow-update to adapter
204 repeated openflow_13.ofp_meter_config meters = 1;
205}
206
Zack Williams52209662019-02-07 10:15:31 -0700207/*
208 * Voltha APIs
209 *
210 */
211service VolthaService {
212
William Kurkian6ea97f82019-03-13 15:51:55 -0400213 // Get the membership group of a Voltha Core
214 rpc GetMembership(google.protobuf.Empty) returns(Membership) {
215 option (google.api.http) = {
216 get: "/api/v1/membership"
217 };
218 }
219
220 // Set the membership group of a Voltha Core
221 rpc UpdateMembership(Membership) returns(google.protobuf.Empty) {
222 option (google.api.http) = {
223 post: "/api/v1/membership"
224 body: "*"
225 };
226 }
227
Zack Williams52209662019-02-07 10:15:31 -0700228 // Get high level information on the Voltha cluster
229 rpc GetVoltha(google.protobuf.Empty) returns(Voltha) {
230 option (google.api.http) = {
231 get: "/api/v1"
232 };
233 }
234
235 // List all Voltha cluster core instances
236 rpc ListCoreInstances(google.protobuf.Empty) returns(CoreInstances) {
237 option (google.api.http) = {
238 get: "/api/v1/instances"
239 };
Zack Williams52209662019-02-07 10:15:31 -0700240 }
241
242 // Get details on a Voltha cluster instance
William Kurkian12fc0af2019-04-18 14:27:45 -0400243 rpc GetCoreInstance(common.ID) returns(CoreInstance) {
Zack Williams52209662019-02-07 10:15:31 -0700244 option (google.api.http) = {
245 get: "/api/v1/instances/{id}"
246 };
247 }
248
249 // List all active adapters (plugins) in the Voltha cluster
250 rpc ListAdapters(google.protobuf.Empty) returns(Adapters) {
251 option (google.api.http) = {
252 get: "/api/v1/adapters"
253 };
Zack Williams52209662019-02-07 10:15:31 -0700254 }
255
256
257 // List all logical devices managed by the Voltha cluster
258 rpc ListLogicalDevices(google.protobuf.Empty) returns(LogicalDevices) {
259 option (google.api.http) = {
260 get: "/api/v1/logical_devices"
261 };
Zack Williams52209662019-02-07 10:15:31 -0700262 }
263
264 // Get additional information on a given logical device
William Kurkian12fc0af2019-04-18 14:27:45 -0400265 rpc GetLogicalDevice(common.ID) returns(LogicalDevice) {
Zack Williams52209662019-02-07 10:15:31 -0700266 option (google.api.http) = {
267 get: "/api/v1/logical_devices/{id}"
268 };
269 }
270
271 // List ports of a logical device
William Kurkian12fc0af2019-04-18 14:27:45 -0400272 rpc ListLogicalDevicePorts(common.ID) returns(LogicalPorts) {
Zack Williams52209662019-02-07 10:15:31 -0700273 option (google.api.http) = {
274 get: "/api/v1/logical_devices/{id}/ports"
275 };
Zack Williams52209662019-02-07 10:15:31 -0700276 }
277
278 // Gets a logical device port
279 rpc GetLogicalDevicePort(LogicalPortId) returns(LogicalPort) {
280 option (google.api.http) = {
281 get: "/api/v1/logical_devices/{id}/ports/{port_id}"
282 };
Zack Williams52209662019-02-07 10:15:31 -0700283 }
284
285 // Enables a logical device port
286 rpc EnableLogicalDevicePort(LogicalPortId) returns(google.protobuf.Empty) {
287 option (google.api.http) = {
288 post: "/api/v1/logical_devices/{id}/ports/{port_id}/enable"
289 };
290 }
291
292 // Disables a logical device port
293 rpc DisableLogicalDevicePort(LogicalPortId) returns(google.protobuf.Empty) {
294 option (google.api.http) = {
295 post: "/api/v1/logical_devices/{id}/ports/{port_id}/disable"
296 };
297 }
298
299 // List all flows of a logical device
William Kurkian12fc0af2019-04-18 14:27:45 -0400300 rpc ListLogicalDeviceFlows(common.ID) returns(openflow_13.Flows) {
Zack Williams52209662019-02-07 10:15:31 -0700301 option (google.api.http) = {
302 get: "/api/v1/logical_devices/{id}/flows"
303 };
Zack Williams52209662019-02-07 10:15:31 -0700304 }
305
306 // Update flow table for logical device
307 rpc UpdateLogicalDeviceFlowTable(openflow_13.FlowTableUpdate)
308 returns(google.protobuf.Empty) {
309 option (google.api.http) = {
310 post: "/api/v1/logical_devices/{id}/flows"
311 body: "*"
312 };
313 }
314
315 // Update meter table for logical device
316 rpc UpdateLogicalDeviceMeterTable(openflow_13.MeterModUpdate)
317 returns(google.protobuf.Empty) {
318 option (google.api.http) = {
319 post: "/api/v1/logical_devices/{id}/meters"
320 body: "*"
321 };
322 }
323
Abhilash Laxmeshwardfbb74d2019-07-23 08:03:08 -0400324 // List all meters of a logical device
325 rpc ListLogicalDeviceMeters(common.ID) returns (openflow_13.Meters) {
Zack Williams52209662019-02-07 10:15:31 -0700326 option (google.api.http) = {
Abhilash Laxmeshwardfbb74d2019-07-23 08:03:08 -0400327 get: "/api/v1/logical_devices/{id}/meters"
Zack Williams52209662019-02-07 10:15:31 -0700328 };
329 }
330
331 // List all flow groups of a logical device
William Kurkian12fc0af2019-04-18 14:27:45 -0400332 rpc ListLogicalDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) {
Zack Williams52209662019-02-07 10:15:31 -0700333 option (google.api.http) = {
334 get: "/api/v1/logical_devices/{id}/flow_groups"
335 };
Zack Williams52209662019-02-07 10:15:31 -0700336 }
337
338 // Update group table for device
339 rpc UpdateLogicalDeviceFlowGroupTable(openflow_13.FlowGroupTableUpdate)
340 returns(google.protobuf.Empty) {
341 option (google.api.http) = {
342 post: "/api/v1/logical_devices/{id}/flow_groups"
343 body: "*"
344 };
345 }
346
347 // List all physical devices controlled by the Voltha cluster
348 rpc ListDevices(google.protobuf.Empty) returns(Devices) {
349 option (google.api.http) = {
350 get: "/api/v1/devices"
351 };
Zack Williams52209662019-02-07 10:15:31 -0700352 }
353
354 // List all physical devices IDs controlled by the Voltha cluster
William Kurkian12fc0af2019-04-18 14:27:45 -0400355 rpc ListDeviceIds(google.protobuf.Empty) returns(common.IDs) {
Zack Williams52209662019-02-07 10:15:31 -0700356 option (google.api.http) = {
357 get: "/api/v1/deviceids"
358 };
Zack Williams52209662019-02-07 10:15:31 -0700359 }
360
361 // Request to a voltha Core to reconcile a set of devices based on their IDs
William Kurkian12fc0af2019-04-18 14:27:45 -0400362 rpc ReconcileDevices(common.IDs) returns(google.protobuf.Empty) {
Zack Williams52209662019-02-07 10:15:31 -0700363 option (google.api.http) = {
364 post: "/api/v1/deviceids"
365 body: "*"
366 };
367 }
368
369 // Get more information on a given physical device
William Kurkian12fc0af2019-04-18 14:27:45 -0400370 rpc GetDevice(common.ID) returns(Device) {
Zack Williams52209662019-02-07 10:15:31 -0700371 option (google.api.http) = {
372 get: "/api/v1/devices/{id}"
373 };
374 }
375
376 // Pre-provision a new physical device
377 rpc CreateDevice(Device) returns(Device) {
378 option (google.api.http) = {
379 post: "/api/v1/devices"
380 body: "*"
381 };
382 }
383
384 // Enable a device. If the device was in pre-provisioned state then it
385 // will transition to ENABLED state. If it was is DISABLED state then it
386 // will transition to ENABLED state as well.
William Kurkian12fc0af2019-04-18 14:27:45 -0400387 rpc EnableDevice(common.ID) returns(google.protobuf.Empty) {
Zack Williams52209662019-02-07 10:15:31 -0700388 option (google.api.http) = {
389 post: "/api/v1/devices/{id}/enable"
390 };
391 }
392
393 // Disable a device
William Kurkian12fc0af2019-04-18 14:27:45 -0400394 rpc DisableDevice(common.ID) returns(google.protobuf.Empty) {
Zack Williams52209662019-02-07 10:15:31 -0700395 option (google.api.http) = {
396 post: "/api/v1/devices/{id}/disable"
397 };
398 }
399
400 // Reboot a device
William Kurkian12fc0af2019-04-18 14:27:45 -0400401 rpc RebootDevice(common.ID) returns(google.protobuf.Empty) {
Zack Williams52209662019-02-07 10:15:31 -0700402 option (google.api.http) = {
403 post: "/api/v1/devices/{id}/reboot"
404 };
405 }
406
407 // Delete a device
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100408 rpc DeleteDevice (common.ID) returns (google.protobuf.Empty) {
Zack Williams52209662019-02-07 10:15:31 -0700409 option (google.api.http) = {
410 delete: "/api/v1/devices/{id}/delete"
411 };
412 }
413
Himani Chawla503b7ce2020-10-07 13:20:03 +0530414 // Forcefully delete a device
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100415 rpc ForceDeleteDevice (common.ID) returns (google.protobuf.Empty) {
Himani Chawla503b7ce2020-10-07 13:20:03 +0530416 option (google.api.http) = {
417 delete: "/api/v1/devices/{id}/force_delete"
418 };
419 }
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100420
Zack Williams52209662019-02-07 10:15:31 -0700421 // Request an image download to the standby partition
422 // of a device.
423 // Note that the call is expected to be non-blocking.
William Kurkian12fc0af2019-04-18 14:27:45 -0400424 rpc DownloadImage(ImageDownload) returns(common.OperationResp) {
Zack Williams52209662019-02-07 10:15:31 -0700425 option (google.api.http) = {
426 post: "/api/v1/devices/{id}/image_downloads/{name}"
427 body: "*"
428 };
429 }
430
431 // Get image download status on a device
432 // The request retrieves progress on device and updates db record
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100433 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700434 rpc GetImageDownloadStatus(ImageDownload) returns(ImageDownload) {
435 option (google.api.http) = {
436 get: "/api/v1/devices/{id}/image_downloads/{name}/status"
437 };
438 }
439
440 // Get image download db record
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100441 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700442 rpc GetImageDownload(ImageDownload) returns(ImageDownload) {
443 option (google.api.http) = {
444 get: "/api/v1/devices/{id}/image_downloads/{name}"
445 };
446 }
447
448 // List image download db records for a given device
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100449 // Deprecated in voltha 2.8, will be removed
William Kurkian12fc0af2019-04-18 14:27:45 -0400450 rpc ListImageDownloads(common.ID) returns(ImageDownloads) {
Zack Williams52209662019-02-07 10:15:31 -0700451 option (google.api.http) = {
452 get: "/api/v1/devices/{id}/image_downloads"
453 };
454 }
455
456 // Cancel an existing image download process on a device
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100457 // Deprecated in voltha 2.8, will be removed
William Kurkian12fc0af2019-04-18 14:27:45 -0400458 rpc CancelImageDownload(ImageDownload) returns(common.OperationResp) {
Zack Williams52209662019-02-07 10:15:31 -0700459 option (google.api.http) = {
460 delete: "/api/v1/devices/{id}/image_downloads/{name}"
461 };
462 }
463
464 // Activate the specified image at a standby partition
465 // to active partition.
466 // Depending on the device implementation, this call
467 // may or may not cause device reboot.
468 // If no reboot, then a reboot is required to make the
469 // activated image running on device
470 // Note that the call is expected to be non-blocking.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100471 // Deprecated in voltha 2.8, will be removed
William Kurkian12fc0af2019-04-18 14:27:45 -0400472 rpc ActivateImageUpdate(ImageDownload) returns(common.OperationResp) {
Zack Williams52209662019-02-07 10:15:31 -0700473 option (google.api.http) = {
474 post: "/api/v1/devices/{id}/image_downloads/{name}/image_update"
475 body: "*"
476 };
477 }
478
479 // Revert the specified image at standby partition
480 // to active partition, and revert to previous image
481 // Depending on the device implementation, this call
482 // may or may not cause device reboot.
483 // If no reboot, then a reboot is required to make the
484 // previous image running on device
485 // Note that the call is expected to be non-blocking.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100486 // Deprecated in voltha 2.8, will be removed
William Kurkian12fc0af2019-04-18 14:27:45 -0400487 rpc RevertImageUpdate(ImageDownload) returns(common.OperationResp) {
Zack Williams52209662019-02-07 10:15:31 -0700488 option (google.api.http) = {
489 post: "/api/v1/devices/{id}/image_downloads/{name}/image_revert"
490 body: "*"
491 };
492 }
493
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100494 // Downloads a certain image to the standby partition of the devices
495 // Note that the call is expected to be non-blocking.
496 rpc DownloadImageToDevice (DeviceImageDownloadRequest) returns (DeviceImageResponse) {
497 option (google.api.http) = {
498 get: "/api/v1/devices/images/download_images"
499 };
500 }
501
502 // Get image status on a number of devices devices
503 // Polled from northbound systems to get state of download/activate/commit
504 rpc GetImageStatus (DeviceImageRequest) returns (DeviceImageResponse) {
505 option (google.api.http) = {
506 get: "/api/v1/devices/images/images_status"
507 };
508 }
509
510 // Aborts the upgrade of an image on a device
511 // To be used carefully, stops any further operations for the Image on the given devices
512 // Might also stop if possible existing work, but no guarantees are given,
513 // depends on implementation and procedure status.
514 rpc AbortImageUpgradeToDevice (DeviceImageRequest) returns (DeviceImageResponse) {
515 option (google.api.http) = {
516 get: "/api/v1/devices/images/abort_upgrade_images"
517 };
518 }
519
520 // Get Both Active and Standby image for a given device
521 rpc GetOnuImages (common.ID) returns (OnuImages) {
522 option (google.api.http) = {
523 get: "/api/v1/devices/{id}/onu_images"
524 };
525 }
526
527 // Activate the specified image from a standby partition
528 // to active partition.
529 // Depending on the device implementation, this call
530 // may or may not cause device reboot.
531 // If no reboot, then a reboot is required to make the
532 // activated image running on device
533 // Note that the call is expected to be non-blocking.
534 rpc ActivateImage (DeviceImageRequest) returns (DeviceImageResponse) {
535 option (google.api.http) = {
536 post: "/api/v1/devices/images/activate_images"
537 body: "*"
538 };
539 }
540
541 // Commit the specified image to be default.
542 // Depending on the device implementation, this call
543 // may or may not cause device reboot.
544 // If no reboot, then a reboot is required to make the
545 // activated image running on device upon next reboot
546 // Note that the call is expected to be non-blocking.
547 rpc CommitImage (DeviceImageRequest) returns (DeviceImageResponse) {
548 option (google.api.http) = {
549 post: "/api/v1/devices/images/commit_images"
550 body: "*"
551 };
552 }
553
Zack Williams52209662019-02-07 10:15:31 -0700554 // List ports of a device
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100555 rpc ListDevicePorts (common.ID) returns (Ports) {
Zack Williams52209662019-02-07 10:15:31 -0700556 option (google.api.http) = {
557 get: "/api/v1/devices/{id}/ports"
558 };
Zack Williams52209662019-02-07 10:15:31 -0700559 }
560
561 // List pm config of a device
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100562 rpc ListDevicePmConfigs (common.ID) returns (PmConfigs) {
Zack Williams52209662019-02-07 10:15:31 -0700563 option (google.api.http) = {
564 get: "/api/v1/devices/{id}/pm_configs"
565 };
566 }
567
568 // Update the pm config of a device
569 rpc UpdateDevicePmConfigs(voltha.PmConfigs) returns(google.protobuf.Empty) {
570 option (google.api.http) = {
571 post: "/api/v1/devices/{id}/pm_configs"
572 body: "*"
573 };
574 }
575
576 // List all flows of a device
William Kurkian12fc0af2019-04-18 14:27:45 -0400577 rpc ListDeviceFlows(common.ID) returns(openflow_13.Flows) {
Zack Williams52209662019-02-07 10:15:31 -0700578 option (google.api.http) = {
579 get: "/api/v1/devices/{id}/flows"
580 };
Zack Williams52209662019-02-07 10:15:31 -0700581 }
582
583 // List all flow groups of a device
William Kurkian12fc0af2019-04-18 14:27:45 -0400584 rpc ListDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) {
Zack Williams52209662019-02-07 10:15:31 -0700585 option (google.api.http) = {
586 get: "/api/v1/devices/{id}/flow_groups"
587 };
Zack Williams52209662019-02-07 10:15:31 -0700588 }
589
590 // List device types known to Voltha
591 rpc ListDeviceTypes(google.protobuf.Empty) returns(DeviceTypes) {
592 option (google.api.http) = {
593 get: "/api/v1/device_types"
594 };
Zack Williams52209662019-02-07 10:15:31 -0700595 }
596
597 // Get additional information on a device type
William Kurkian12fc0af2019-04-18 14:27:45 -0400598 rpc GetDeviceType(common.ID) returns(DeviceType) {
Zack Williams52209662019-02-07 10:15:31 -0700599 option (google.api.http) = {
600 get: "/api/v1/device_types/{id}"
601 };
602 }
603
604 // List all device sharding groups
605 rpc ListDeviceGroups(google.protobuf.Empty) returns(DeviceGroups) {
606 option (google.api.http) = {
607 get: "/api/v1/device_groups"
608 };
Zack Williams52209662019-02-07 10:15:31 -0700609 }
610
611 // Stream control packets to the dataplane
612 rpc StreamPacketsOut(stream openflow_13.PacketOut)
613 returns(google.protobuf.Empty) {
614 // This does not have an HTTP representation
615 }
616
617 // Receive control packet stream
618 rpc ReceivePacketsIn(google.protobuf.Empty)
619 returns(stream openflow_13.PacketIn) {
620 // This does not have an HTTP representation
621 }
622
623 rpc ReceiveChangeEvents(google.protobuf.Empty)
624 returns(stream openflow_13.ChangeEvent) {
625 // This does not have an HTTP representation
626 }
627
628 // Get additional information on a device group
William Kurkian12fc0af2019-04-18 14:27:45 -0400629 rpc GetDeviceGroup(common.ID) returns(DeviceGroup) {
Zack Williams52209662019-02-07 10:15:31 -0700630 option (google.api.http) = {
631 get: "/api/v1/device_groups/{id}"
632 };
633 }
634
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000635 rpc CreateEventFilter(EventFilter) returns(EventFilter) {
Zack Williams52209662019-02-07 10:15:31 -0700636 option (google.api.http) = {
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000637 post: "/api/v1/event_filters"
Zack Williams52209662019-02-07 10:15:31 -0700638 body: "*"
639 };
640 }
641
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000642 // Get all filters present for a device
643 rpc GetEventFilter(common.ID) returns(EventFilters) {
Zack Williams52209662019-02-07 10:15:31 -0700644 option (google.api.http) = {
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000645 get: "/api/v1/event_filters/{id}"
Zack Williams52209662019-02-07 10:15:31 -0700646 };
647 }
648
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000649 rpc UpdateEventFilter(EventFilter) returns(EventFilter) {
Zack Williams52209662019-02-07 10:15:31 -0700650 option (google.api.http) = {
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000651 put: "/api/v1/event_filters/{id}"
Zack Williams52209662019-02-07 10:15:31 -0700652 body: "*"
653 };
654 }
655
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000656 rpc DeleteEventFilter(EventFilter) returns(google.protobuf.Empty) {
Zack Williams52209662019-02-07 10:15:31 -0700657 option (google.api.http) = {
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000658 delete: "/api/v1/event_filters/{id}"
Zack Williams52209662019-02-07 10:15:31 -0700659 };
660 }
661
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000662 // Get all the filters present
663 rpc ListEventFilters(google.protobuf.Empty) returns(EventFilters) {
Zack Williams52209662019-02-07 10:15:31 -0700664 option (google.api.http) = {
Devmalya Paul96a2c9e2019-11-06 07:17:44 +0000665 get: "/api/v1/event_filters"
Zack Williams52209662019-02-07 10:15:31 -0700666 };
667 }
668
William Kurkian12fc0af2019-04-18 14:27:45 -0400669 rpc GetImages(common.ID) returns(Images) {
Zack Williams52209662019-02-07 10:15:31 -0700670 option (google.api.http) = {
671 get: "/api/v1/devices/{id}/images"
672 };
673 }
674
William Kurkian12fc0af2019-04-18 14:27:45 -0400675 rpc SelfTest(common.ID) returns(SelfTestResponse) {
Zack Williams52209662019-02-07 10:15:31 -0700676 option (google.api.http) = {
677 post: "/api/v1/devices/{id}/self_test"
678 };
679 }
680
681 // OpenOMCI MIB information
William Kurkian12fc0af2019-04-18 14:27:45 -0400682 rpc GetMibDeviceData(common.ID) returns(omci.MibDeviceData) {
Zack Williams52209662019-02-07 10:15:31 -0700683 option (google.api.http) = {
684 get: "/api/v1/openomci/{id}/mib"
685 };
686 }
687
688 // OpenOMCI ALARM information
William Kurkian12fc0af2019-04-18 14:27:45 -0400689 rpc GetAlarmDeviceData(common.ID) returns(omci.AlarmDeviceData) {
Zack Williams52209662019-02-07 10:15:31 -0700690 option (google.api.http) = {
691 get: "/api/v1/openomci/{id}/alarm"
692 };
693 }
694
695 // Simulate an Alarm
William Kurkian12fc0af2019-04-18 14:27:45 -0400696 rpc SimulateAlarm(SimulateAlarmRequest) returns(common.OperationResp) {
Zack Williams52209662019-02-07 10:15:31 -0700697 option (google.api.http) = {
698 post: "/api/v1/devices/{id}/simulate_larm"
699 body: "*"
700 };
701 }
702 rpc Subscribe (OfAgentSubscriber) returns (OfAgentSubscriber) {
703 }
Abhilash Laxmeshwardfbb74d2019-07-23 08:03:08 -0400704
kesavand4a002b02020-01-23 21:29:47 -0500705 rpc EnablePort(voltha.Port) returns(google.protobuf.Empty) {
706 option (google.api.http) = {
707 post: "/v1/EnablePort"
708 body: "*"
709 };
710 }
711 rpc DisablePort(voltha.Port) returns(google.protobuf.Empty) {
712 option (google.api.http) = {
713 post: "/v1/DisablePort"
714 body: "*"
715 };
716 }
Dinesh Belwalkared6da5e2020-02-25 11:23:57 -0800717 rpc GetExtValue(common.ValueSpecifier) returns(common.ReturnValues) {
718 option (google.api.http) = {
719 get: "/api/v1/GetExtValue"
720 };
721 }
dpaul2b52e712020-06-23 13:02:28 +0530722 rpc SetExtValue(ValueSet) returns(google.protobuf.Empty) {
723 option (google.api.http) = {
724 get: "/api/v1/SetExtValue"
725 };
726 }
kesavand4a002b02020-01-23 21:29:47 -0500727
onkar.kundargi7b85fa12020-02-27 13:19:22 +0530728 // omci start and stop cli implementation
729 rpc StartOmciTestAction(OmciTestRequest) returns(TestResponse) {
730 option (google.api.http) = {
731 post: "/api/v1/start_omci_test"
732 body: "*"
733 };
734 }
Zack Williams52209662019-02-07 10:15:31 -0700735}
736