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