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