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