Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Top-level Voltha API definition |
| 3 | * |
| 4 | * For details, see individual definition files. |
| 5 | */ |
| 6 | |
| 7 | syntax = "proto3"; |
| 8 | |
Matteo Scandolo | b3c08ae | 2020-10-14 13:15:43 -0700 | [diff] [blame] | 9 | option go_package = "github.com/opencord/voltha-protos/v4/go/voltha"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 10 | |
| 11 | package voltha; |
| 12 | |
| 13 | import "google/api/annotations.proto"; |
| 14 | import "google/protobuf/empty.proto"; |
| 15 | |
| 16 | import public "voltha_protos/meta.proto"; |
| 17 | import public "voltha_protos/common.proto"; |
| 18 | import public "voltha_protos/health.proto"; |
| 19 | import public "voltha_protos/logical_device.proto"; |
| 20 | import public "voltha_protos/device.proto"; |
| 21 | import public "voltha_protos/adapter.proto"; |
| 22 | import public "voltha_protos/openflow_13.proto"; |
| 23 | |
| 24 | import "voltha_protos/omci_mib_db.proto"; |
| 25 | import "voltha_protos/omci_alarm_db.proto"; |
dpaul | 2b52e71 | 2020-06-23 13:02:28 +0530 | [diff] [blame] | 26 | import "voltha_protos/ext_config.proto"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 27 | |
| 28 | option java_package = "org.opencord.voltha"; |
| 29 | option java_outer_classname = "VolthaProtos"; |
| 30 | option csharp_namespace = "Opencord.Voltha.Voltha"; |
| 31 | |
| 32 | message 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 | |
| 41 | message DeviceGroups { |
| 42 | repeated DeviceGroup items = 1; |
| 43 | } |
| 44 | |
| 45 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 46 | message EventFilterRuleKey { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 47 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 48 | 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 55 | } |
| 56 | } |
| 57 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 58 | message EventFilterRule { |
| 59 | EventFilterRuleKey.EventFilterRuleType key = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 60 | string value = 2; |
| 61 | } |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 62 | message EventFilter { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 63 | string id = 1 [(access) = READ_ONLY]; |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 64 | bool enable = 2; |
| 65 | string device_id = 3; |
| 66 | string event_type = 4; |
| 67 | repeated EventFilterRule rules = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 68 | } |
| 69 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 70 | message EventFilters { |
| 71 | repeated EventFilter filters = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 72 | } |
| 73 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 74 | // CoreInstance represents a core instance. It is data held in memory when a core |
| 75 | // is running. This data is not persistent. |
| 76 | message CoreInstance { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 77 | |
| 78 | string instance_id = 1 [(access) = READ_ONLY]; |
| 79 | |
| 80 | HealthStatus health = 2 [(child_node) = {}]; |
| 81 | |
| 82 | } |
| 83 | |
| 84 | message CoreInstances { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 85 | repeated CoreInstance items = 1; |
| 86 | } |
| 87 | |
onkar.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 88 | message OmciTestRequest { |
| 89 | string id = 1; |
| 90 | string uuid = 2; |
| 91 | } |
| 92 | |
| 93 | message TestResponse{ |
| 94 | enum TestResponseResult { |
| 95 | SUCCESS = 0; |
| 96 | FAILURE = 1; |
| 97 | } |
| 98 | TestResponseResult result = 1; |
| 99 | } |
| 100 | |
dpaul | 2b52e71 | 2020-06-23 13:02:28 +0530 | [diff] [blame] | 101 | message ValueSet { |
| 102 | string id = 1; |
| 103 | oneof value{ |
| 104 | config.AlarmConfig alarm_config = 2; |
| 105 | } |
| 106 | } |
| 107 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 108 | // 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 |
| 111 | message Voltha { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 112 | |
| 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 Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 125 | repeated EventFilter event_filters = 7 [(child_node) = {key: "id"}]; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 126 | |
| 127 | repeated |
| 128 | omci.MibDeviceData omci_mib_database = 28 |
| 129 | [(child_node) = {key: "device_id"}]; |
| 130 | |
| 131 | repeated |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 132 | omci.AlarmDeviceData omci_alarm_database = 29 |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 133 | [(child_node) = {key: "device_id"}]; |
| 134 | } |
| 135 | |
| 136 | // Device Self Test Response |
| 137 | message SelfTestResponse { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 138 | |
| 139 | enum SelfTestResult { |
| 140 | SUCCESS = 0; |
| 141 | FAILURE = 1; |
| 142 | NOT_SUPPORTED = 2; |
| 143 | UNKNOWN_ERROR = 3; |
| 144 | } |
| 145 | SelfTestResult result = 1; |
| 146 | } |
| 147 | |
| 148 | message 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 Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 156 | // Identifies a membership group a Core belongs to |
| 157 | message 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 Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 165 | message 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 | |
| 181 | message 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 | |
| 195 | message DeviceImageResponse { |
| 196 | |
| 197 | //Image state for the different devices |
| 198 | repeated DeviceImageState device_image_states = 1; |
| 199 | } |
| 200 | |
manikkaraj k | 166cb20 | 2019-07-28 13:05:56 -0400 | [diff] [blame] | 201 | // Additional information required to process flow at device adapters |
| 202 | message FlowMetadata { |
| 203 | // Meters associated with flow-update to adapter |
| 204 | repeated openflow_13.ofp_meter_config meters = 1; |
| 205 | } |
| 206 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 207 | /* |
| 208 | * Voltha APIs |
| 209 | * |
| 210 | */ |
| 211 | service VolthaService { |
| 212 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 213 | // 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 228 | // 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | // Get details on a Voltha cluster instance |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 243 | rpc GetCoreInstance(common.ID) returns(CoreInstance) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 244 | 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 254 | } |
| 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | // Get additional information on a given logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 265 | rpc GetLogicalDevice(common.ID) returns(LogicalDevice) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 266 | option (google.api.http) = { |
| 267 | get: "/api/v1/logical_devices/{id}" |
| 268 | }; |
| 269 | } |
| 270 | |
| 271 | // List ports of a logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 272 | rpc ListLogicalDevicePorts(common.ID) returns(LogicalPorts) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 273 | option (google.api.http) = { |
| 274 | get: "/api/v1/logical_devices/{id}/ports" |
| 275 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 276 | } |
| 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 283 | } |
| 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 Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 300 | rpc ListLogicalDeviceFlows(common.ID) returns(openflow_13.Flows) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 301 | option (google.api.http) = { |
| 302 | get: "/api/v1/logical_devices/{id}/flows" |
| 303 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 304 | } |
| 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 Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 324 | // List all meters of a logical device |
| 325 | rpc ListLogicalDeviceMeters(common.ID) returns (openflow_13.Meters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 326 | option (google.api.http) = { |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 327 | get: "/api/v1/logical_devices/{id}/meters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 328 | }; |
| 329 | } |
| 330 | |
| 331 | // List all flow groups of a logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 332 | rpc ListLogicalDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 333 | option (google.api.http) = { |
| 334 | get: "/api/v1/logical_devices/{id}/flow_groups" |
| 335 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 336 | } |
| 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 352 | } |
| 353 | |
| 354 | // List all physical devices IDs controlled by the Voltha cluster |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 355 | rpc ListDeviceIds(google.protobuf.Empty) returns(common.IDs) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 356 | option (google.api.http) = { |
| 357 | get: "/api/v1/deviceids" |
| 358 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | // Request to a voltha Core to reconcile a set of devices based on their IDs |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 362 | rpc ReconcileDevices(common.IDs) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 363 | option (google.api.http) = { |
| 364 | post: "/api/v1/deviceids" |
| 365 | body: "*" |
| 366 | }; |
| 367 | } |
| 368 | |
| 369 | // Get more information on a given physical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 370 | rpc GetDevice(common.ID) returns(Device) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 371 | 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 Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 387 | rpc EnableDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 388 | option (google.api.http) = { |
| 389 | post: "/api/v1/devices/{id}/enable" |
| 390 | }; |
| 391 | } |
| 392 | |
| 393 | // Disable a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 394 | rpc DisableDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 395 | option (google.api.http) = { |
| 396 | post: "/api/v1/devices/{id}/disable" |
| 397 | }; |
| 398 | } |
| 399 | |
| 400 | // Reboot a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 401 | rpc RebootDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 402 | option (google.api.http) = { |
| 403 | post: "/api/v1/devices/{id}/reboot" |
| 404 | }; |
| 405 | } |
| 406 | |
| 407 | // Delete a device |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 408 | rpc DeleteDevice (common.ID) returns (google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 409 | option (google.api.http) = { |
| 410 | delete: "/api/v1/devices/{id}/delete" |
| 411 | }; |
| 412 | } |
| 413 | |
Himani Chawla | 503b7ce | 2020-10-07 13:20:03 +0530 | [diff] [blame] | 414 | // Forcefully delete a device |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 415 | rpc ForceDeleteDevice (common.ID) returns (google.protobuf.Empty) { |
Himani Chawla | 503b7ce | 2020-10-07 13:20:03 +0530 | [diff] [blame] | 416 | option (google.api.http) = { |
| 417 | delete: "/api/v1/devices/{id}/force_delete" |
| 418 | }; |
| 419 | } |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 420 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 421 | // Request an image download to the standby partition |
| 422 | // of a device. |
| 423 | // Note that the call is expected to be non-blocking. |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 424 | rpc DownloadImage(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 425 | 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 Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 433 | // Deprecated in voltha 2.8, will be removed |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 434 | 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 Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 441 | // Deprecated in voltha 2.8, will be removed |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 442 | 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 Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 449 | // Deprecated in voltha 2.8, will be removed |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 450 | rpc ListImageDownloads(common.ID) returns(ImageDownloads) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 451 | 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 Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 457 | // Deprecated in voltha 2.8, will be removed |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 458 | rpc CancelImageDownload(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 459 | 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 Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 471 | // Deprecated in voltha 2.8, will be removed |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 472 | rpc ActivateImageUpdate(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 473 | 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 Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 486 | // Deprecated in voltha 2.8, will be removed |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 487 | rpc RevertImageUpdate(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 488 | option (google.api.http) = { |
| 489 | post: "/api/v1/devices/{id}/image_downloads/{name}/image_revert" |
| 490 | body: "*" |
| 491 | }; |
| 492 | } |
| 493 | |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 494 | // 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 554 | // List ports of a device |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 555 | rpc ListDevicePorts (common.ID) returns (Ports) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 556 | option (google.api.http) = { |
| 557 | get: "/api/v1/devices/{id}/ports" |
| 558 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 559 | } |
| 560 | |
| 561 | // List pm config of a device |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame^] | 562 | rpc ListDevicePmConfigs (common.ID) returns (PmConfigs) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 563 | 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 Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 577 | rpc ListDeviceFlows(common.ID) returns(openflow_13.Flows) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 578 | option (google.api.http) = { |
| 579 | get: "/api/v1/devices/{id}/flows" |
| 580 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 581 | } |
| 582 | |
| 583 | // List all flow groups of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 584 | rpc ListDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 585 | option (google.api.http) = { |
| 586 | get: "/api/v1/devices/{id}/flow_groups" |
| 587 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 588 | } |
| 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 595 | } |
| 596 | |
| 597 | // Get additional information on a device type |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 598 | rpc GetDeviceType(common.ID) returns(DeviceType) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 599 | 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 609 | } |
| 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 Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 629 | rpc GetDeviceGroup(common.ID) returns(DeviceGroup) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 630 | option (google.api.http) = { |
| 631 | get: "/api/v1/device_groups/{id}" |
| 632 | }; |
| 633 | } |
| 634 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 635 | rpc CreateEventFilter(EventFilter) returns(EventFilter) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 636 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 637 | post: "/api/v1/event_filters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 638 | body: "*" |
| 639 | }; |
| 640 | } |
| 641 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 642 | // Get all filters present for a device |
| 643 | rpc GetEventFilter(common.ID) returns(EventFilters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 644 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 645 | get: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 646 | }; |
| 647 | } |
| 648 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 649 | rpc UpdateEventFilter(EventFilter) returns(EventFilter) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 650 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 651 | put: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 652 | body: "*" |
| 653 | }; |
| 654 | } |
| 655 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 656 | rpc DeleteEventFilter(EventFilter) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 657 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 658 | delete: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 659 | }; |
| 660 | } |
| 661 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 662 | // Get all the filters present |
| 663 | rpc ListEventFilters(google.protobuf.Empty) returns(EventFilters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 664 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 665 | get: "/api/v1/event_filters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 666 | }; |
| 667 | } |
| 668 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 669 | rpc GetImages(common.ID) returns(Images) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 670 | option (google.api.http) = { |
| 671 | get: "/api/v1/devices/{id}/images" |
| 672 | }; |
| 673 | } |
| 674 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 675 | rpc SelfTest(common.ID) returns(SelfTestResponse) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 676 | option (google.api.http) = { |
| 677 | post: "/api/v1/devices/{id}/self_test" |
| 678 | }; |
| 679 | } |
| 680 | |
| 681 | // OpenOMCI MIB information |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 682 | rpc GetMibDeviceData(common.ID) returns(omci.MibDeviceData) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 683 | option (google.api.http) = { |
| 684 | get: "/api/v1/openomci/{id}/mib" |
| 685 | }; |
| 686 | } |
| 687 | |
| 688 | // OpenOMCI ALARM information |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 689 | rpc GetAlarmDeviceData(common.ID) returns(omci.AlarmDeviceData) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 690 | option (google.api.http) = { |
| 691 | get: "/api/v1/openomci/{id}/alarm" |
| 692 | }; |
| 693 | } |
| 694 | |
| 695 | // Simulate an Alarm |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 696 | rpc SimulateAlarm(SimulateAlarmRequest) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 697 | option (google.api.http) = { |
| 698 | post: "/api/v1/devices/{id}/simulate_larm" |
| 699 | body: "*" |
| 700 | }; |
| 701 | } |
| 702 | rpc Subscribe (OfAgentSubscriber) returns (OfAgentSubscriber) { |
| 703 | } |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 704 | |
kesavand | 4a002b0 | 2020-01-23 21:29:47 -0500 | [diff] [blame] | 705 | 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 Belwalkar | ed6da5e | 2020-02-25 11:23:57 -0800 | [diff] [blame] | 717 | rpc GetExtValue(common.ValueSpecifier) returns(common.ReturnValues) { |
| 718 | option (google.api.http) = { |
| 719 | get: "/api/v1/GetExtValue" |
| 720 | }; |
| 721 | } |
dpaul | 2b52e71 | 2020-06-23 13:02:28 +0530 | [diff] [blame] | 722 | rpc SetExtValue(ValueSet) returns(google.protobuf.Empty) { |
| 723 | option (google.api.http) = { |
| 724 | get: "/api/v1/SetExtValue" |
| 725 | }; |
| 726 | } |
kesavand | 4a002b0 | 2020-01-23 21:29:47 -0500 | [diff] [blame] | 727 | |
onkar.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 728 | // 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 Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 735 | } |
| 736 | |