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