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 | |
manikkaraj k | 166cb20 | 2019-07-28 13:05:56 -0400 | [diff] [blame] | 165 | // Additional information required to process flow at device adapters |
| 166 | message FlowMetadata { |
| 167 | // Meters associated with flow-update to adapter |
| 168 | repeated openflow_13.ofp_meter_config meters = 1; |
| 169 | } |
| 170 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 171 | /* |
| 172 | * Voltha APIs |
| 173 | * |
| 174 | */ |
| 175 | service VolthaService { |
| 176 | |
William Kurkian | 6ea97f8 | 2019-03-13 15:51:55 -0400 | [diff] [blame] | 177 | // Get the membership group of a Voltha Core |
| 178 | rpc GetMembership(google.protobuf.Empty) returns(Membership) { |
| 179 | option (google.api.http) = { |
| 180 | get: "/api/v1/membership" |
| 181 | }; |
| 182 | } |
| 183 | |
| 184 | // Set the membership group of a Voltha Core |
| 185 | rpc UpdateMembership(Membership) returns(google.protobuf.Empty) { |
| 186 | option (google.api.http) = { |
| 187 | post: "/api/v1/membership" |
| 188 | body: "*" |
| 189 | }; |
| 190 | } |
| 191 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 192 | // Get high level information on the Voltha cluster |
| 193 | rpc GetVoltha(google.protobuf.Empty) returns(Voltha) { |
| 194 | option (google.api.http) = { |
| 195 | get: "/api/v1" |
| 196 | }; |
| 197 | } |
| 198 | |
| 199 | // List all Voltha cluster core instances |
| 200 | rpc ListCoreInstances(google.protobuf.Empty) returns(CoreInstances) { |
| 201 | option (google.api.http) = { |
| 202 | get: "/api/v1/instances" |
| 203 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | // Get details on a Voltha cluster instance |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 207 | rpc GetCoreInstance(common.ID) returns(CoreInstance) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 208 | option (google.api.http) = { |
| 209 | get: "/api/v1/instances/{id}" |
| 210 | }; |
| 211 | } |
| 212 | |
| 213 | // List all active adapters (plugins) in the Voltha cluster |
| 214 | rpc ListAdapters(google.protobuf.Empty) returns(Adapters) { |
| 215 | option (google.api.http) = { |
| 216 | get: "/api/v1/adapters" |
| 217 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | |
| 221 | // List all logical devices managed by the Voltha cluster |
| 222 | rpc ListLogicalDevices(google.protobuf.Empty) returns(LogicalDevices) { |
| 223 | option (google.api.http) = { |
| 224 | get: "/api/v1/logical_devices" |
| 225 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | // Get additional information on a given logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 229 | rpc GetLogicalDevice(common.ID) returns(LogicalDevice) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 230 | option (google.api.http) = { |
| 231 | get: "/api/v1/logical_devices/{id}" |
| 232 | }; |
| 233 | } |
| 234 | |
| 235 | // List ports of a logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 236 | rpc ListLogicalDevicePorts(common.ID) returns(LogicalPorts) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 237 | option (google.api.http) = { |
| 238 | get: "/api/v1/logical_devices/{id}/ports" |
| 239 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | // Gets a logical device port |
| 243 | rpc GetLogicalDevicePort(LogicalPortId) returns(LogicalPort) { |
| 244 | option (google.api.http) = { |
| 245 | get: "/api/v1/logical_devices/{id}/ports/{port_id}" |
| 246 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | // Enables a logical device port |
| 250 | rpc EnableLogicalDevicePort(LogicalPortId) returns(google.protobuf.Empty) { |
| 251 | option (google.api.http) = { |
| 252 | post: "/api/v1/logical_devices/{id}/ports/{port_id}/enable" |
| 253 | }; |
| 254 | } |
| 255 | |
| 256 | // Disables a logical device port |
| 257 | rpc DisableLogicalDevicePort(LogicalPortId) returns(google.protobuf.Empty) { |
| 258 | option (google.api.http) = { |
| 259 | post: "/api/v1/logical_devices/{id}/ports/{port_id}/disable" |
| 260 | }; |
| 261 | } |
| 262 | |
| 263 | // List all flows of a logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 264 | rpc ListLogicalDeviceFlows(common.ID) returns(openflow_13.Flows) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 265 | option (google.api.http) = { |
| 266 | get: "/api/v1/logical_devices/{id}/flows" |
| 267 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 268 | } |
| 269 | |
| 270 | // Update flow table for logical device |
| 271 | rpc UpdateLogicalDeviceFlowTable(openflow_13.FlowTableUpdate) |
| 272 | returns(google.protobuf.Empty) { |
| 273 | option (google.api.http) = { |
| 274 | post: "/api/v1/logical_devices/{id}/flows" |
| 275 | body: "*" |
| 276 | }; |
| 277 | } |
| 278 | |
| 279 | // Update meter table for logical device |
| 280 | rpc UpdateLogicalDeviceMeterTable(openflow_13.MeterModUpdate) |
| 281 | returns(google.protobuf.Empty) { |
| 282 | option (google.api.http) = { |
| 283 | post: "/api/v1/logical_devices/{id}/meters" |
| 284 | body: "*" |
| 285 | }; |
| 286 | } |
| 287 | |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 288 | // List all meters of a logical device |
| 289 | rpc ListLogicalDeviceMeters(common.ID) returns (openflow_13.Meters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 290 | option (google.api.http) = { |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 291 | get: "/api/v1/logical_devices/{id}/meters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 292 | }; |
| 293 | } |
| 294 | |
| 295 | // List all flow groups of a logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 296 | rpc ListLogicalDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 297 | option (google.api.http) = { |
| 298 | get: "/api/v1/logical_devices/{id}/flow_groups" |
| 299 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | // Update group table for device |
| 303 | rpc UpdateLogicalDeviceFlowGroupTable(openflow_13.FlowGroupTableUpdate) |
| 304 | returns(google.protobuf.Empty) { |
| 305 | option (google.api.http) = { |
| 306 | post: "/api/v1/logical_devices/{id}/flow_groups" |
| 307 | body: "*" |
| 308 | }; |
| 309 | } |
| 310 | |
| 311 | // List all physical devices controlled by the Voltha cluster |
| 312 | rpc ListDevices(google.protobuf.Empty) returns(Devices) { |
| 313 | option (google.api.http) = { |
| 314 | get: "/api/v1/devices" |
| 315 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 316 | } |
| 317 | |
| 318 | // List all physical devices IDs controlled by the Voltha cluster |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 319 | rpc ListDeviceIds(google.protobuf.Empty) returns(common.IDs) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 320 | option (google.api.http) = { |
| 321 | get: "/api/v1/deviceids" |
| 322 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | // 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] | 326 | rpc ReconcileDevices(common.IDs) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 327 | option (google.api.http) = { |
| 328 | post: "/api/v1/deviceids" |
| 329 | body: "*" |
| 330 | }; |
| 331 | } |
| 332 | |
| 333 | // Get more information on a given physical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 334 | rpc GetDevice(common.ID) returns(Device) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 335 | option (google.api.http) = { |
| 336 | get: "/api/v1/devices/{id}" |
| 337 | }; |
| 338 | } |
| 339 | |
| 340 | // Pre-provision a new physical device |
| 341 | rpc CreateDevice(Device) returns(Device) { |
| 342 | option (google.api.http) = { |
| 343 | post: "/api/v1/devices" |
| 344 | body: "*" |
| 345 | }; |
| 346 | } |
| 347 | |
| 348 | // Enable a device. If the device was in pre-provisioned state then it |
| 349 | // will transition to ENABLED state. If it was is DISABLED state then it |
| 350 | // will transition to ENABLED state as well. |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 351 | rpc EnableDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 352 | option (google.api.http) = { |
| 353 | post: "/api/v1/devices/{id}/enable" |
| 354 | }; |
| 355 | } |
| 356 | |
| 357 | // Disable a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 358 | rpc DisableDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 359 | option (google.api.http) = { |
| 360 | post: "/api/v1/devices/{id}/disable" |
| 361 | }; |
| 362 | } |
| 363 | |
| 364 | // Reboot a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 365 | rpc RebootDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 366 | option (google.api.http) = { |
| 367 | post: "/api/v1/devices/{id}/reboot" |
| 368 | }; |
| 369 | } |
| 370 | |
| 371 | // Delete a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 372 | rpc DeleteDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 373 | option (google.api.http) = { |
| 374 | delete: "/api/v1/devices/{id}/delete" |
| 375 | }; |
| 376 | } |
| 377 | |
Himani Chawla | 503b7ce | 2020-10-07 13:20:03 +0530 | [diff] [blame] | 378 | // Forcefully delete a device |
| 379 | rpc ForceDeleteDevice(common.ID) returns(google.protobuf.Empty) { |
| 380 | option (google.api.http) = { |
| 381 | delete: "/api/v1/devices/{id}/force_delete" |
| 382 | }; |
| 383 | } |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 384 | // Request an image download to the standby partition |
| 385 | // of a device. |
| 386 | // Note that the call is expected to be non-blocking. |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 387 | rpc DownloadImage(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 388 | option (google.api.http) = { |
| 389 | post: "/api/v1/devices/{id}/image_downloads/{name}" |
| 390 | body: "*" |
| 391 | }; |
| 392 | } |
| 393 | |
| 394 | // Get image download status on a device |
| 395 | // The request retrieves progress on device and updates db record |
| 396 | rpc GetImageDownloadStatus(ImageDownload) returns(ImageDownload) { |
| 397 | option (google.api.http) = { |
| 398 | get: "/api/v1/devices/{id}/image_downloads/{name}/status" |
| 399 | }; |
| 400 | } |
| 401 | |
| 402 | // Get image download db record |
| 403 | rpc GetImageDownload(ImageDownload) returns(ImageDownload) { |
| 404 | option (google.api.http) = { |
| 405 | get: "/api/v1/devices/{id}/image_downloads/{name}" |
| 406 | }; |
| 407 | } |
| 408 | |
| 409 | // List image download db records for a given device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 410 | rpc ListImageDownloads(common.ID) returns(ImageDownloads) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 411 | option (google.api.http) = { |
| 412 | get: "/api/v1/devices/{id}/image_downloads" |
| 413 | }; |
| 414 | } |
| 415 | |
| 416 | // Cancel an existing image download process on a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 417 | rpc CancelImageDownload(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 418 | option (google.api.http) = { |
| 419 | delete: "/api/v1/devices/{id}/image_downloads/{name}" |
| 420 | }; |
| 421 | } |
| 422 | |
| 423 | // Activate the specified image at a standby partition |
| 424 | // to active partition. |
| 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 | // activated 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 ActivateImageUpdate(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_update" |
| 433 | body: "*" |
| 434 | }; |
| 435 | } |
| 436 | |
| 437 | // Revert the specified image at standby partition |
| 438 | // to active partition, and revert to previous image |
| 439 | // Depending on the device implementation, this call |
| 440 | // may or may not cause device reboot. |
| 441 | // If no reboot, then a reboot is required to make the |
| 442 | // previous image running on device |
| 443 | // Note that the call is expected to be non-blocking. |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 444 | rpc RevertImageUpdate(ImageDownload) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 445 | option (google.api.http) = { |
| 446 | post: "/api/v1/devices/{id}/image_downloads/{name}/image_revert" |
| 447 | body: "*" |
| 448 | }; |
| 449 | } |
| 450 | |
| 451 | // List ports of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 452 | rpc ListDevicePorts(common.ID) returns(Ports) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 453 | option (google.api.http) = { |
| 454 | get: "/api/v1/devices/{id}/ports" |
| 455 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 456 | } |
| 457 | |
| 458 | // List pm config of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 459 | rpc ListDevicePmConfigs(common.ID) returns(PmConfigs) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 460 | option (google.api.http) = { |
| 461 | get: "/api/v1/devices/{id}/pm_configs" |
| 462 | }; |
| 463 | } |
| 464 | |
| 465 | // Update the pm config of a device |
| 466 | rpc UpdateDevicePmConfigs(voltha.PmConfigs) returns(google.protobuf.Empty) { |
| 467 | option (google.api.http) = { |
| 468 | post: "/api/v1/devices/{id}/pm_configs" |
| 469 | body: "*" |
| 470 | }; |
| 471 | } |
| 472 | |
| 473 | // List all flows of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 474 | rpc ListDeviceFlows(common.ID) returns(openflow_13.Flows) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 475 | option (google.api.http) = { |
| 476 | get: "/api/v1/devices/{id}/flows" |
| 477 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 478 | } |
| 479 | |
| 480 | // List all flow groups of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 481 | rpc ListDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 482 | option (google.api.http) = { |
| 483 | get: "/api/v1/devices/{id}/flow_groups" |
| 484 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 485 | } |
| 486 | |
| 487 | // List device types known to Voltha |
| 488 | rpc ListDeviceTypes(google.protobuf.Empty) returns(DeviceTypes) { |
| 489 | option (google.api.http) = { |
| 490 | get: "/api/v1/device_types" |
| 491 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 492 | } |
| 493 | |
| 494 | // Get additional information on a device type |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 495 | rpc GetDeviceType(common.ID) returns(DeviceType) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 496 | option (google.api.http) = { |
| 497 | get: "/api/v1/device_types/{id}" |
| 498 | }; |
| 499 | } |
| 500 | |
| 501 | // List all device sharding groups |
| 502 | rpc ListDeviceGroups(google.protobuf.Empty) returns(DeviceGroups) { |
| 503 | option (google.api.http) = { |
| 504 | get: "/api/v1/device_groups" |
| 505 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 506 | } |
| 507 | |
| 508 | // Stream control packets to the dataplane |
| 509 | rpc StreamPacketsOut(stream openflow_13.PacketOut) |
| 510 | returns(google.protobuf.Empty) { |
| 511 | // This does not have an HTTP representation |
| 512 | } |
| 513 | |
| 514 | // Receive control packet stream |
| 515 | rpc ReceivePacketsIn(google.protobuf.Empty) |
| 516 | returns(stream openflow_13.PacketIn) { |
| 517 | // This does not have an HTTP representation |
| 518 | } |
| 519 | |
| 520 | rpc ReceiveChangeEvents(google.protobuf.Empty) |
| 521 | returns(stream openflow_13.ChangeEvent) { |
| 522 | // This does not have an HTTP representation |
| 523 | } |
| 524 | |
| 525 | // Get additional information on a device group |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 526 | rpc GetDeviceGroup(common.ID) returns(DeviceGroup) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 527 | option (google.api.http) = { |
| 528 | get: "/api/v1/device_groups/{id}" |
| 529 | }; |
| 530 | } |
| 531 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 532 | rpc CreateEventFilter(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 | post: "/api/v1/event_filters" |
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 | // Get all filters present for a device |
| 540 | rpc GetEventFilter(common.ID) returns(EventFilters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 541 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 542 | get: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 543 | }; |
| 544 | } |
| 545 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 546 | rpc UpdateEventFilter(EventFilter) returns(EventFilter) { |
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 | put: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 549 | body: "*" |
| 550 | }; |
| 551 | } |
| 552 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 553 | rpc DeleteEventFilter(EventFilter) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 554 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 555 | delete: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 556 | }; |
| 557 | } |
| 558 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 559 | // Get all the filters present |
| 560 | rpc ListEventFilters(google.protobuf.Empty) returns(EventFilters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 561 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 562 | get: "/api/v1/event_filters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 563 | }; |
| 564 | } |
| 565 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 566 | rpc GetImages(common.ID) returns(Images) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 567 | option (google.api.http) = { |
| 568 | get: "/api/v1/devices/{id}/images" |
| 569 | }; |
| 570 | } |
| 571 | |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 572 | rpc SelfTest(common.ID) returns(SelfTestResponse) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 573 | option (google.api.http) = { |
| 574 | post: "/api/v1/devices/{id}/self_test" |
| 575 | }; |
| 576 | } |
| 577 | |
| 578 | // OpenOMCI MIB information |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 579 | rpc GetMibDeviceData(common.ID) returns(omci.MibDeviceData) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 580 | option (google.api.http) = { |
| 581 | get: "/api/v1/openomci/{id}/mib" |
| 582 | }; |
| 583 | } |
| 584 | |
| 585 | // OpenOMCI ALARM information |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 586 | rpc GetAlarmDeviceData(common.ID) returns(omci.AlarmDeviceData) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 587 | option (google.api.http) = { |
| 588 | get: "/api/v1/openomci/{id}/alarm" |
| 589 | }; |
| 590 | } |
| 591 | |
| 592 | // Simulate an Alarm |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 593 | rpc SimulateAlarm(SimulateAlarmRequest) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 594 | option (google.api.http) = { |
| 595 | post: "/api/v1/devices/{id}/simulate_larm" |
| 596 | body: "*" |
| 597 | }; |
| 598 | } |
| 599 | rpc Subscribe (OfAgentSubscriber) returns (OfAgentSubscriber) { |
| 600 | } |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 601 | |
kesavand | 4a002b0 | 2020-01-23 21:29:47 -0500 | [diff] [blame] | 602 | rpc EnablePort(voltha.Port) returns(google.protobuf.Empty) { |
| 603 | option (google.api.http) = { |
| 604 | post: "/v1/EnablePort" |
| 605 | body: "*" |
| 606 | }; |
| 607 | } |
| 608 | rpc DisablePort(voltha.Port) returns(google.protobuf.Empty) { |
| 609 | option (google.api.http) = { |
| 610 | post: "/v1/DisablePort" |
| 611 | body: "*" |
| 612 | }; |
| 613 | } |
Dinesh Belwalkar | ed6da5e | 2020-02-25 11:23:57 -0800 | [diff] [blame] | 614 | rpc GetExtValue(common.ValueSpecifier) returns(common.ReturnValues) { |
| 615 | option (google.api.http) = { |
| 616 | get: "/api/v1/GetExtValue" |
| 617 | }; |
| 618 | } |
dpaul | 2b52e71 | 2020-06-23 13:02:28 +0530 | [diff] [blame] | 619 | rpc SetExtValue(ValueSet) returns(google.protobuf.Empty) { |
| 620 | option (google.api.http) = { |
| 621 | get: "/api/v1/SetExtValue" |
| 622 | }; |
| 623 | } |
kesavand | 4a002b0 | 2020-01-23 21:29:47 -0500 | [diff] [blame] | 624 | |
onkar.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 625 | // omci start and stop cli implementation |
| 626 | rpc StartOmciTestAction(OmciTestRequest) returns(TestResponse) { |
| 627 | option (google.api.http) = { |
| 628 | post: "/api/v1/start_omci_test" |
| 629 | body: "*" |
| 630 | }; |
| 631 | } |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 632 | } |
| 633 | |