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