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 | |
Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 9 | option go_package = "github.com/opencord/voltha-protos/v3/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"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 26 | |
| 27 | option java_package = "org.opencord.voltha"; |
| 28 | option java_outer_classname = "VolthaProtos"; |
| 29 | option csharp_namespace = "Opencord.Voltha.Voltha"; |
| 30 | |
| 31 | message DeviceGroup { |
| 32 | |
| 33 | string id = 1 [(access) = READ_ONLY]; |
| 34 | |
| 35 | repeated LogicalDevice logical_devices = 2 [(child_node) = {key: "id"}]; |
| 36 | |
| 37 | repeated Device devices = 3 [(child_node) = {key: "id"}]; |
| 38 | } |
| 39 | |
| 40 | message DeviceGroups { |
| 41 | repeated DeviceGroup items = 1; |
| 42 | } |
| 43 | |
| 44 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 45 | message EventFilterRuleKey { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 46 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 47 | enum EventFilterRuleType { |
| 48 | filter_all = 0; |
| 49 | category = 1; |
| 50 | sub_category = 2; |
| 51 | kpi_event_type = 3; |
| 52 | config_event_type = 4; |
| 53 | device_event_type = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 54 | } |
| 55 | } |
| 56 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 57 | message EventFilterRule { |
| 58 | EventFilterRuleKey.EventFilterRuleType key = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 59 | string value = 2; |
| 60 | } |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 61 | message EventFilter { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 62 | string id = 1 [(access) = READ_ONLY]; |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 63 | bool enable = 2; |
| 64 | string device_id = 3; |
| 65 | string event_type = 4; |
| 66 | repeated EventFilterRule rules = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 67 | } |
| 68 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 69 | message EventFilters { |
| 70 | repeated EventFilter filters = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 71 | } |
| 72 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 73 | // CoreInstance represents a core instance. It is data held in memory when a core |
| 74 | // is running. This data is not persistent. |
| 75 | message CoreInstance { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 76 | |
| 77 | string instance_id = 1 [(access) = READ_ONLY]; |
| 78 | |
| 79 | HealthStatus health = 2 [(child_node) = {}]; |
| 80 | |
| 81 | } |
| 82 | |
| 83 | message CoreInstances { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 84 | repeated CoreInstance items = 1; |
| 85 | } |
| 86 | |
onkar.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 87 | message OmciTestRequest { |
| 88 | string id = 1; |
| 89 | string uuid = 2; |
| 90 | } |
| 91 | |
| 92 | message TestResponse{ |
| 93 | enum TestResponseResult { |
| 94 | SUCCESS = 0; |
| 95 | FAILURE = 1; |
| 96 | } |
| 97 | TestResponseResult result = 1; |
| 98 | } |
| 99 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 100 | // Voltha represents the Voltha cluster data. Each Core instance will hold a subset of |
| 101 | // the entire cluster. However, some items (e.g. adapters) will be held by all cores |
| 102 | // for better performance |
| 103 | message Voltha { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 104 | |
| 105 | string version = 1 [(access) = READ_ONLY]; |
| 106 | |
| 107 | repeated Adapter adapters = 2 [(child_node) = {key: "id"}]; |
| 108 | |
| 109 | repeated LogicalDevice logical_devices = 3 [(child_node) = {key: "id"}]; |
| 110 | |
| 111 | repeated Device devices = 4 [(child_node) = {key: "id"}]; |
| 112 | |
| 113 | repeated DeviceType device_types = 5 [(child_node) = {key: "id"}]; |
| 114 | |
| 115 | repeated DeviceGroup device_groups = 6 [(child_node) = {key: "id"}]; |
| 116 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 117 | repeated EventFilter event_filters = 7 [(child_node) = {key: "id"}]; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 118 | |
| 119 | repeated |
| 120 | omci.MibDeviceData omci_mib_database = 28 |
| 121 | [(child_node) = {key: "device_id"}]; |
| 122 | |
| 123 | repeated |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 124 | omci.AlarmDeviceData omci_alarm_database = 29 |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 125 | [(child_node) = {key: "device_id"}]; |
| 126 | } |
| 127 | |
| 128 | // Device Self Test Response |
| 129 | message SelfTestResponse { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 130 | |
| 131 | enum SelfTestResult { |
| 132 | SUCCESS = 0; |
| 133 | FAILURE = 1; |
| 134 | NOT_SUPPORTED = 2; |
| 135 | UNKNOWN_ERROR = 3; |
| 136 | } |
| 137 | SelfTestResult result = 1; |
| 138 | } |
| 139 | |
| 140 | message OfAgentSubscriber { |
| 141 | // ID of ofagent instance |
| 142 | string ofagent_id = 1; |
| 143 | |
| 144 | // ID of voltha instance to which the ofagent is subscribed |
| 145 | string voltha_id = 2; |
| 146 | } |
| 147 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 148 | // Identifies a membership group a Core belongs to |
| 149 | message Membership { |
| 150 | // Group name |
| 151 | string group_name = 1; |
| 152 | |
| 153 | // Unique ID of a container within that group |
| 154 | string id = 2; |
| 155 | } |
| 156 | |
manikkaraj k | 166cb20 | 2019-07-28 13:05:56 -0400 | [diff] [blame] | 157 | // Additional information required to process flow at device adapters |
| 158 | message FlowMetadata { |
| 159 | // Meters associated with flow-update to adapter |
| 160 | repeated openflow_13.ofp_meter_config meters = 1; |
| 161 | } |
| 162 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 163 | /* |
| 164 | * Voltha APIs |
| 165 | * |
| 166 | */ |
| 167 | service VolthaService { |
| 168 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 169 | // Get the membership group of a Voltha Core |
| 170 | rpc GetMembership(google.protobuf.Empty) returns(Membership) { |
| 171 | option (google.api.http) = { |
| 172 | get: "/api/v1/membership" |
| 173 | }; |
| 174 | } |
| 175 | |
| 176 | // Set the membership group of a Voltha Core |
| 177 | rpc UpdateMembership(Membership) returns(google.protobuf.Empty) { |
| 178 | option (google.api.http) = { |
| 179 | post: "/api/v1/membership" |
| 180 | body: "*" |
| 181 | }; |
| 182 | } |
| 183 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 184 | // Get high level information on the Voltha cluster |
| 185 | rpc GetVoltha(google.protobuf.Empty) returns(Voltha) { |
| 186 | option (google.api.http) = { |
| 187 | get: "/api/v1" |
| 188 | }; |
| 189 | } |
| 190 | |
| 191 | // List all Voltha cluster core instances |
| 192 | rpc ListCoreInstances(google.protobuf.Empty) returns(CoreInstances) { |
| 193 | option (google.api.http) = { |
| 194 | get: "/api/v1/instances" |
| 195 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | // Get details on a Voltha cluster instance |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 199 | rpc GetCoreInstance(common.ID) returns(CoreInstance) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 200 | option (google.api.http) = { |
| 201 | get: "/api/v1/instances/{id}" |
| 202 | }; |
| 203 | } |
| 204 | |
| 205 | // List all active adapters (plugins) in the Voltha cluster |
| 206 | rpc ListAdapters(google.protobuf.Empty) returns(Adapters) { |
| 207 | option (google.api.http) = { |
| 208 | get: "/api/v1/adapters" |
| 209 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | |
| 213 | // List all logical devices managed by the Voltha cluster |
| 214 | rpc ListLogicalDevices(google.protobuf.Empty) returns(LogicalDevices) { |
| 215 | option (google.api.http) = { |
| 216 | get: "/api/v1/logical_devices" |
| 217 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | // Get additional information on a given logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 221 | rpc GetLogicalDevice(common.ID) returns(LogicalDevice) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 222 | option (google.api.http) = { |
| 223 | get: "/api/v1/logical_devices/{id}" |
| 224 | }; |
| 225 | } |
| 226 | |
| 227 | // List ports of a logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 228 | rpc ListLogicalDevicePorts(common.ID) returns(LogicalPorts) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 229 | option (google.api.http) = { |
| 230 | get: "/api/v1/logical_devices/{id}/ports" |
| 231 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 232 | } |
| 233 | |
| 234 | // Gets a logical device port |
| 235 | rpc GetLogicalDevicePort(LogicalPortId) returns(LogicalPort) { |
| 236 | option (google.api.http) = { |
| 237 | get: "/api/v1/logical_devices/{id}/ports/{port_id}" |
| 238 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | // Enables a logical device port |
| 242 | rpc EnableLogicalDevicePort(LogicalPortId) returns(google.protobuf.Empty) { |
| 243 | option (google.api.http) = { |
| 244 | post: "/api/v1/logical_devices/{id}/ports/{port_id}/enable" |
| 245 | }; |
| 246 | } |
| 247 | |
| 248 | // Disables a logical device port |
| 249 | rpc DisableLogicalDevicePort(LogicalPortId) returns(google.protobuf.Empty) { |
| 250 | option (google.api.http) = { |
| 251 | post: "/api/v1/logical_devices/{id}/ports/{port_id}/disable" |
| 252 | }; |
| 253 | } |
| 254 | |
| 255 | // List all flows of a logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 256 | rpc ListLogicalDeviceFlows(common.ID) returns(openflow_13.Flows) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 257 | option (google.api.http) = { |
| 258 | get: "/api/v1/logical_devices/{id}/flows" |
| 259 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 260 | } |
| 261 | |
| 262 | // Update flow table for logical device |
| 263 | rpc UpdateLogicalDeviceFlowTable(openflow_13.FlowTableUpdate) |
| 264 | returns(google.protobuf.Empty) { |
| 265 | option (google.api.http) = { |
| 266 | post: "/api/v1/logical_devices/{id}/flows" |
| 267 | body: "*" |
| 268 | }; |
| 269 | } |
| 270 | |
| 271 | // Update meter table for logical device |
| 272 | rpc UpdateLogicalDeviceMeterTable(openflow_13.MeterModUpdate) |
| 273 | returns(google.protobuf.Empty) { |
| 274 | option (google.api.http) = { |
| 275 | post: "/api/v1/logical_devices/{id}/meters" |
| 276 | body: "*" |
| 277 | }; |
| 278 | } |
| 279 | |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 280 | // List all meters of a logical device |
| 281 | rpc ListLogicalDeviceMeters(common.ID) returns (openflow_13.Meters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 282 | option (google.api.http) = { |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 283 | get: "/api/v1/logical_devices/{id}/meters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 284 | }; |
| 285 | } |
| 286 | |
| 287 | // List all flow groups of a logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 288 | rpc ListLogicalDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 289 | option (google.api.http) = { |
| 290 | get: "/api/v1/logical_devices/{id}/flow_groups" |
| 291 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | // Update group table for device |
| 295 | rpc UpdateLogicalDeviceFlowGroupTable(openflow_13.FlowGroupTableUpdate) |
| 296 | returns(google.protobuf.Empty) { |
| 297 | option (google.api.http) = { |
| 298 | post: "/api/v1/logical_devices/{id}/flow_groups" |
| 299 | body: "*" |
| 300 | }; |
| 301 | } |
| 302 | |
| 303 | // List all physical devices controlled by the Voltha cluster |
| 304 | rpc ListDevices(google.protobuf.Empty) returns(Devices) { |
| 305 | option (google.api.http) = { |
| 306 | get: "/api/v1/devices" |
| 307 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 308 | } |
| 309 | |
| 310 | // List all physical devices IDs controlled by the Voltha cluster |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 311 | rpc ListDeviceIds(google.protobuf.Empty) returns(common.IDs) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 312 | option (google.api.http) = { |
| 313 | get: "/api/v1/deviceids" |
| 314 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 315 | } |
| 316 | |
| 317 | // 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] | 318 | rpc ReconcileDevices(common.IDs) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 319 | option (google.api.http) = { |
| 320 | post: "/api/v1/deviceids" |
| 321 | body: "*" |
| 322 | }; |
| 323 | } |
| 324 | |
| 325 | // Get more information on a given physical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 326 | rpc GetDevice(common.ID) returns(Device) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 327 | option (google.api.http) = { |
| 328 | get: "/api/v1/devices/{id}" |
| 329 | }; |
| 330 | } |
| 331 | |
| 332 | // Pre-provision a new physical device |
| 333 | rpc CreateDevice(Device) returns(Device) { |
| 334 | option (google.api.http) = { |
| 335 | post: "/api/v1/devices" |
| 336 | body: "*" |
| 337 | }; |
| 338 | } |
| 339 | |
| 340 | // Enable a device. If the device was in pre-provisioned state then it |
| 341 | // will transition to ENABLED state. If it was is DISABLED state then it |
| 342 | // will transition to ENABLED state as well. |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 343 | rpc EnableDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 344 | option (google.api.http) = { |
| 345 | post: "/api/v1/devices/{id}/enable" |
| 346 | }; |
| 347 | } |
| 348 | |
| 349 | // Disable a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 350 | rpc DisableDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 351 | option (google.api.http) = { |
| 352 | post: "/api/v1/devices/{id}/disable" |
| 353 | }; |
| 354 | } |
| 355 | |
| 356 | // Reboot a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 357 | rpc RebootDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 358 | option (google.api.http) = { |
| 359 | post: "/api/v1/devices/{id}/reboot" |
| 360 | }; |
| 361 | } |
| 362 | |
| 363 | // Delete a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 364 | rpc DeleteDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 365 | option (google.api.http) = { |
| 366 | delete: "/api/v1/devices/{id}/delete" |
| 367 | }; |
| 368 | } |
| 369 | |
| 370 | // Request an image download to the standby partition |
| 371 | // of a device. |
| 372 | // Note that the call is expected to be non-blocking. |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 373 | rpc DownloadImage(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 374 | option (google.api.http) = { |
| 375 | post: "/api/v1/devices/{id}/image_downloads/{name}" |
| 376 | body: "*" |
| 377 | }; |
| 378 | } |
| 379 | |
| 380 | // Get image download status on a device |
| 381 | // The request retrieves progress on device and updates db record |
| 382 | rpc GetImageDownloadStatus(ImageDownload) returns(ImageDownload) { |
| 383 | option (google.api.http) = { |
| 384 | get: "/api/v1/devices/{id}/image_downloads/{name}/status" |
| 385 | }; |
| 386 | } |
| 387 | |
| 388 | // Get image download db record |
| 389 | rpc GetImageDownload(ImageDownload) returns(ImageDownload) { |
| 390 | option (google.api.http) = { |
| 391 | get: "/api/v1/devices/{id}/image_downloads/{name}" |
| 392 | }; |
| 393 | } |
| 394 | |
| 395 | // List image download db records for a given device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 396 | rpc ListImageDownloads(common.ID) returns(ImageDownloads) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 397 | option (google.api.http) = { |
| 398 | get: "/api/v1/devices/{id}/image_downloads" |
| 399 | }; |
| 400 | } |
| 401 | |
| 402 | // Cancel an existing image download process on a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 403 | rpc CancelImageDownload(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 404 | option (google.api.http) = { |
| 405 | delete: "/api/v1/devices/{id}/image_downloads/{name}" |
| 406 | }; |
| 407 | } |
| 408 | |
| 409 | // Activate the specified image at a standby partition |
| 410 | // to active partition. |
| 411 | // Depending on the device implementation, this call |
| 412 | // may or may not cause device reboot. |
| 413 | // If no reboot, then a reboot is required to make the |
| 414 | // activated image running on device |
| 415 | // Note that the call is expected to be non-blocking. |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 416 | rpc ActivateImageUpdate(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 417 | option (google.api.http) = { |
| 418 | post: "/api/v1/devices/{id}/image_downloads/{name}/image_update" |
| 419 | body: "*" |
| 420 | }; |
| 421 | } |
| 422 | |
| 423 | // Revert the specified image at standby partition |
| 424 | // to active partition, and revert to previous image |
| 425 | // Depending on the device implementation, this call |
| 426 | // may or may not cause device reboot. |
| 427 | // If no reboot, then a reboot is required to make the |
| 428 | // previous image running on device |
| 429 | // Note that the call is expected to be non-blocking. |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 430 | rpc RevertImageUpdate(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 431 | option (google.api.http) = { |
| 432 | post: "/api/v1/devices/{id}/image_downloads/{name}/image_revert" |
| 433 | body: "*" |
| 434 | }; |
| 435 | } |
| 436 | |
| 437 | // List ports of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 438 | rpc ListDevicePorts(common.ID) returns(Ports) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 439 | option (google.api.http) = { |
| 440 | get: "/api/v1/devices/{id}/ports" |
| 441 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 442 | } |
| 443 | |
| 444 | // List pm config of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 445 | rpc ListDevicePmConfigs(common.ID) returns(PmConfigs) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 446 | option (google.api.http) = { |
| 447 | get: "/api/v1/devices/{id}/pm_configs" |
| 448 | }; |
| 449 | } |
| 450 | |
| 451 | // Update the pm config of a device |
| 452 | rpc UpdateDevicePmConfigs(voltha.PmConfigs) returns(google.protobuf.Empty) { |
| 453 | option (google.api.http) = { |
| 454 | post: "/api/v1/devices/{id}/pm_configs" |
| 455 | body: "*" |
| 456 | }; |
| 457 | } |
| 458 | |
| 459 | // List all flows of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 460 | rpc ListDeviceFlows(common.ID) returns(openflow_13.Flows) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 461 | option (google.api.http) = { |
| 462 | get: "/api/v1/devices/{id}/flows" |
| 463 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 464 | } |
| 465 | |
| 466 | // List all flow groups of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 467 | rpc ListDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 468 | option (google.api.http) = { |
| 469 | get: "/api/v1/devices/{id}/flow_groups" |
| 470 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 471 | } |
| 472 | |
| 473 | // List device types known to Voltha |
| 474 | rpc ListDeviceTypes(google.protobuf.Empty) returns(DeviceTypes) { |
| 475 | option (google.api.http) = { |
| 476 | get: "/api/v1/device_types" |
| 477 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 478 | } |
| 479 | |
| 480 | // Get additional information on a device type |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 481 | rpc GetDeviceType(common.ID) returns(DeviceType) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 482 | option (google.api.http) = { |
| 483 | get: "/api/v1/device_types/{id}" |
| 484 | }; |
| 485 | } |
| 486 | |
| 487 | // List all device sharding groups |
| 488 | rpc ListDeviceGroups(google.protobuf.Empty) returns(DeviceGroups) { |
| 489 | option (google.api.http) = { |
| 490 | get: "/api/v1/device_groups" |
| 491 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 492 | } |
| 493 | |
| 494 | // Stream control packets to the dataplane |
| 495 | rpc StreamPacketsOut(stream openflow_13.PacketOut) |
| 496 | returns(google.protobuf.Empty) { |
| 497 | // This does not have an HTTP representation |
| 498 | } |
| 499 | |
| 500 | // Receive control packet stream |
| 501 | rpc ReceivePacketsIn(google.protobuf.Empty) |
| 502 | returns(stream openflow_13.PacketIn) { |
| 503 | // This does not have an HTTP representation |
| 504 | } |
| 505 | |
| 506 | rpc ReceiveChangeEvents(google.protobuf.Empty) |
| 507 | returns(stream openflow_13.ChangeEvent) { |
| 508 | // This does not have an HTTP representation |
| 509 | } |
| 510 | |
| 511 | // Get additional information on a device group |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 512 | rpc GetDeviceGroup(common.ID) returns(DeviceGroup) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 513 | option (google.api.http) = { |
| 514 | get: "/api/v1/device_groups/{id}" |
| 515 | }; |
| 516 | } |
| 517 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 518 | rpc CreateEventFilter(EventFilter) returns(EventFilter) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 519 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 520 | post: "/api/v1/event_filters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 521 | body: "*" |
| 522 | }; |
| 523 | } |
| 524 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 525 | // Get all filters present for a device |
| 526 | rpc GetEventFilter(common.ID) returns(EventFilters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 527 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 528 | get: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 529 | }; |
| 530 | } |
| 531 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 532 | rpc UpdateEventFilter(EventFilter) returns(EventFilter) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 533 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 534 | put: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 535 | body: "*" |
| 536 | }; |
| 537 | } |
| 538 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 539 | rpc DeleteEventFilter(EventFilter) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 540 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 541 | delete: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 542 | }; |
| 543 | } |
| 544 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 545 | // Get all the filters present |
| 546 | rpc ListEventFilters(google.protobuf.Empty) returns(EventFilters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 547 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 548 | get: "/api/v1/event_filters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 549 | }; |
| 550 | } |
| 551 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 552 | rpc GetImages(common.ID) returns(Images) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 553 | option (google.api.http) = { |
| 554 | get: "/api/v1/devices/{id}/images" |
| 555 | }; |
| 556 | } |
| 557 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 558 | rpc SelfTest(common.ID) returns(SelfTestResponse) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 559 | option (google.api.http) = { |
| 560 | post: "/api/v1/devices/{id}/self_test" |
| 561 | }; |
| 562 | } |
| 563 | |
| 564 | // OpenOMCI MIB information |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 565 | rpc GetMibDeviceData(common.ID) returns(omci.MibDeviceData) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 566 | option (google.api.http) = { |
| 567 | get: "/api/v1/openomci/{id}/mib" |
| 568 | }; |
| 569 | } |
| 570 | |
| 571 | // OpenOMCI ALARM information |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 572 | rpc GetAlarmDeviceData(common.ID) returns(omci.AlarmDeviceData) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 573 | option (google.api.http) = { |
| 574 | get: "/api/v1/openomci/{id}/alarm" |
| 575 | }; |
| 576 | } |
| 577 | |
| 578 | // Simulate an Alarm |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 579 | rpc SimulateAlarm(SimulateAlarmRequest) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 580 | option (google.api.http) = { |
| 581 | post: "/api/v1/devices/{id}/simulate_larm" |
| 582 | body: "*" |
| 583 | }; |
| 584 | } |
| 585 | rpc Subscribe (OfAgentSubscriber) returns (OfAgentSubscriber) { |
| 586 | } |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 587 | |
kesavand | 4a002b0 | 2020-01-23 21:29:47 -0500 | [diff] [blame] | 588 | rpc EnablePort(voltha.Port) returns(google.protobuf.Empty) { |
| 589 | option (google.api.http) = { |
| 590 | post: "/v1/EnablePort" |
| 591 | body: "*" |
| 592 | }; |
| 593 | } |
| 594 | rpc DisablePort(voltha.Port) returns(google.protobuf.Empty) { |
| 595 | option (google.api.http) = { |
| 596 | post: "/v1/DisablePort" |
| 597 | body: "*" |
| 598 | }; |
| 599 | } |
Dinesh Belwalkar | ed6da5e | 2020-02-25 11:23:57 -0800 | [diff] [blame] | 600 | rpc GetExtValue(common.ValueSpecifier) returns(common.ReturnValues) { |
| 601 | option (google.api.http) = { |
| 602 | get: "/api/v1/GetExtValue" |
| 603 | }; |
| 604 | } |
kesavand | 4a002b0 | 2020-01-23 21:29:47 -0500 | [diff] [blame] | 605 | |
onkar.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 606 | // omci start and stop cli implementation |
| 607 | rpc StartOmciTestAction(OmciTestRequest) returns(TestResponse) { |
| 608 | option (google.api.http) = { |
| 609 | post: "/api/v1/start_omci_test" |
| 610 | body: "*" |
| 611 | }; |
| 612 | } |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 613 | } |
| 614 | |