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 | |
khenaidoo | 5fc5cea | 2021-08-11 17:39:16 -0400 | [diff] [blame] | 9 | option go_package = "github.com/opencord/voltha-protos/v5/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 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 16 | import public "voltha_protos/common.proto"; |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 17 | import "voltha_protos/health.proto"; |
| 18 | import "voltha_protos/logical_device.proto"; |
| 19 | import "voltha_protos/device.proto"; |
| 20 | import "voltha_protos/adapter.proto"; |
| 21 | import "voltha_protos/openflow_13.proto"; |
| 22 | import "voltha_protos/events.proto"; |
| 23 | import "voltha_protos/extensions.proto"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 24 | |
| 25 | import "voltha_protos/omci_mib_db.proto"; |
| 26 | import "voltha_protos/omci_alarm_db.proto"; |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 27 | import "voltha_protos/omci_test.proto"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 28 | |
| 29 | option java_package = "org.opencord.voltha"; |
| 30 | option java_outer_classname = "VolthaProtos"; |
| 31 | option csharp_namespace = "Opencord.Voltha.Voltha"; |
| 32 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 33 | // CoreInstance represents a core instance. It is data held in memory when a core |
| 34 | // is running. This data is not persistent. |
| 35 | message CoreInstance { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 36 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 37 | string instance_id = 1; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 38 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 39 | health.HealthStatus health = 2; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 40 | |
| 41 | } |
| 42 | |
| 43 | message CoreInstances { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 44 | repeated CoreInstance items = 1; |
| 45 | } |
| 46 | |
dpaul | 2b52e71 | 2020-06-23 13:02:28 +0530 | [diff] [blame] | 47 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 48 | // Voltha represents the Voltha cluster data. Each Core instance will hold a subset of |
| 49 | // the entire cluster. However, some items (e.g. adapters) will be held by all cores |
| 50 | // for better performance |
| 51 | message Voltha { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 52 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 53 | string version = 1 ; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 54 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 55 | repeated adapter.Adapter adapters = 2; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 56 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 57 | repeated logical_device.LogicalDevice logical_devices = 3; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 58 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 59 | repeated device.Device devices = 4; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 60 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 61 | repeated device.DeviceType device_types = 5; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 62 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 63 | reserved 6; |
| 64 | // device_groups is not used |
| 65 | // repeated DeviceGroup device_groups = 6; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 66 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 67 | repeated event.EventFilter event_filters = 7; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 68 | |
| 69 | repeated |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 70 | omci.MibDeviceData omci_mib_database = 28; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 71 | |
| 72 | repeated |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 73 | omci.AlarmDeviceData omci_alarm_database = 29; |
manikkaraj k | 166cb20 | 2019-07-28 13:05:56 -0400 | [diff] [blame] | 74 | } |
| 75 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 76 | /* |
| 77 | * Voltha APIs |
| 78 | * |
| 79 | */ |
| 80 | service VolthaService { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 81 | // Get high level information on the Voltha cluster |
| 82 | rpc GetVoltha(google.protobuf.Empty) returns(Voltha) { |
| 83 | option (google.api.http) = { |
| 84 | get: "/api/v1" |
| 85 | }; |
| 86 | } |
| 87 | |
| 88 | // List all Voltha cluster core instances |
| 89 | rpc ListCoreInstances(google.protobuf.Empty) returns(CoreInstances) { |
| 90 | option (google.api.http) = { |
| 91 | get: "/api/v1/instances" |
| 92 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 93 | } |
| 94 | |
| 95 | // Get details on a Voltha cluster instance |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 96 | rpc GetCoreInstance(common.ID) returns(CoreInstance) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 97 | option (google.api.http) = { |
| 98 | get: "/api/v1/instances/{id}" |
| 99 | }; |
| 100 | } |
| 101 | |
| 102 | // List all active adapters (plugins) in the Voltha cluster |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 103 | rpc ListAdapters(google.protobuf.Empty) returns(adapter.Adapters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 104 | option (google.api.http) = { |
| 105 | get: "/api/v1/adapters" |
| 106 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | |
| 110 | // List all logical devices managed by the Voltha cluster |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 111 | rpc ListLogicalDevices(google.protobuf.Empty) returns(logical_device.LogicalDevices) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 112 | option (google.api.http) = { |
| 113 | get: "/api/v1/logical_devices" |
| 114 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | // Get additional information on a given logical device |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 118 | rpc GetLogicalDevice(common.ID) returns(logical_device.LogicalDevice) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 119 | option (google.api.http) = { |
| 120 | get: "/api/v1/logical_devices/{id}" |
| 121 | }; |
| 122 | } |
| 123 | |
| 124 | // List ports of a logical device |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 125 | rpc ListLogicalDevicePorts(common.ID) returns(logical_device.LogicalPorts) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 126 | option (google.api.http) = { |
| 127 | get: "/api/v1/logical_devices/{id}/ports" |
| 128 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | // Gets a logical device port |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 132 | rpc GetLogicalDevicePort(logical_device.LogicalPortId) returns(logical_device.LogicalPort) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 133 | option (google.api.http) = { |
| 134 | get: "/api/v1/logical_devices/{id}/ports/{port_id}" |
| 135 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | // Enables a logical device port |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 139 | rpc EnableLogicalDevicePort(logical_device.LogicalPortId) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 140 | option (google.api.http) = { |
| 141 | post: "/api/v1/logical_devices/{id}/ports/{port_id}/enable" |
| 142 | }; |
| 143 | } |
| 144 | |
| 145 | // Disables a logical device port |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 146 | rpc DisableLogicalDevicePort(logical_device.LogicalPortId) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 147 | option (google.api.http) = { |
| 148 | post: "/api/v1/logical_devices/{id}/ports/{port_id}/disable" |
| 149 | }; |
| 150 | } |
| 151 | |
| 152 | // List all flows of a logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 153 | rpc ListLogicalDeviceFlows(common.ID) returns(openflow_13.Flows) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 154 | option (google.api.http) = { |
| 155 | get: "/api/v1/logical_devices/{id}/flows" |
| 156 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | // Update flow table for logical device |
| 160 | rpc UpdateLogicalDeviceFlowTable(openflow_13.FlowTableUpdate) |
| 161 | returns(google.protobuf.Empty) { |
| 162 | option (google.api.http) = { |
| 163 | post: "/api/v1/logical_devices/{id}/flows" |
| 164 | body: "*" |
| 165 | }; |
| 166 | } |
| 167 | |
| 168 | // Update meter table for logical device |
| 169 | rpc UpdateLogicalDeviceMeterTable(openflow_13.MeterModUpdate) |
| 170 | returns(google.protobuf.Empty) { |
| 171 | option (google.api.http) = { |
| 172 | post: "/api/v1/logical_devices/{id}/meters" |
| 173 | body: "*" |
| 174 | }; |
| 175 | } |
| 176 | |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 177 | // List all meters of a logical device |
| 178 | rpc ListLogicalDeviceMeters(common.ID) returns (openflow_13.Meters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 179 | option (google.api.http) = { |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 180 | get: "/api/v1/logical_devices/{id}/meters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 181 | }; |
| 182 | } |
| 183 | |
| 184 | // List all flow groups of a logical device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 185 | rpc ListLogicalDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 186 | option (google.api.http) = { |
| 187 | get: "/api/v1/logical_devices/{id}/flow_groups" |
| 188 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | // Update group table for device |
| 192 | rpc UpdateLogicalDeviceFlowGroupTable(openflow_13.FlowGroupTableUpdate) |
| 193 | returns(google.protobuf.Empty) { |
| 194 | option (google.api.http) = { |
| 195 | post: "/api/v1/logical_devices/{id}/flow_groups" |
| 196 | body: "*" |
| 197 | }; |
| 198 | } |
| 199 | |
| 200 | // List all physical devices controlled by the Voltha cluster |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 201 | rpc ListDevices(google.protobuf.Empty) returns(device.Devices) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 202 | option (google.api.http) = { |
| 203 | get: "/api/v1/devices" |
| 204 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | // List all physical devices IDs controlled by the Voltha cluster |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 208 | rpc ListDeviceIds(google.protobuf.Empty) returns(common.IDs) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 209 | option (google.api.http) = { |
| 210 | get: "/api/v1/deviceids" |
| 211 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | // 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] | 215 | rpc ReconcileDevices(common.IDs) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 216 | option (google.api.http) = { |
| 217 | post: "/api/v1/deviceids" |
| 218 | body: "*" |
| 219 | }; |
| 220 | } |
| 221 | |
| 222 | // Get more information on a given physical device |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 223 | rpc GetDevice(common.ID) returns(device.Device) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 224 | option (google.api.http) = { |
| 225 | get: "/api/v1/devices/{id}" |
| 226 | }; |
| 227 | } |
| 228 | |
| 229 | // Pre-provision a new physical device |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 230 | rpc CreateDevice(device.Device) returns(device.Device) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 231 | option (google.api.http) = { |
| 232 | post: "/api/v1/devices" |
| 233 | body: "*" |
| 234 | }; |
| 235 | } |
| 236 | |
| 237 | // Enable a device. If the device was in pre-provisioned state then it |
| 238 | // will transition to ENABLED state. If it was is DISABLED state then it |
| 239 | // will transition to ENABLED state as well. |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 240 | rpc EnableDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 241 | option (google.api.http) = { |
| 242 | post: "/api/v1/devices/{id}/enable" |
| 243 | }; |
| 244 | } |
| 245 | |
| 246 | // Disable a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 247 | rpc DisableDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 248 | option (google.api.http) = { |
| 249 | post: "/api/v1/devices/{id}/disable" |
| 250 | }; |
| 251 | } |
| 252 | |
| 253 | // Reboot a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 254 | rpc RebootDevice(common.ID) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 255 | option (google.api.http) = { |
| 256 | post: "/api/v1/devices/{id}/reboot" |
| 257 | }; |
| 258 | } |
| 259 | |
| 260 | // Delete a device |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 261 | rpc DeleteDevice (common.ID) returns (google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 262 | option (google.api.http) = { |
| 263 | delete: "/api/v1/devices/{id}/delete" |
| 264 | }; |
| 265 | } |
| 266 | |
Himani Chawla | 503b7ce | 2020-10-07 13:20:03 +0530 | [diff] [blame] | 267 | // Forcefully delete a device |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 268 | rpc ForceDeleteDevice (common.ID) returns (google.protobuf.Empty) { |
Himani Chawla | 503b7ce | 2020-10-07 13:20:03 +0530 | [diff] [blame] | 269 | option (google.api.http) = { |
| 270 | delete: "/api/v1/devices/{id}/force_delete" |
| 271 | }; |
| 272 | } |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 273 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 274 | // Request an image download to the standby partition |
| 275 | // of a device. |
| 276 | // Note that the call is expected to be non-blocking. |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 277 | rpc DownloadImage(device.ImageDownload) returns(common.OperationResp) { |
| 278 | option deprecated = true; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 279 | option (google.api.http) = { |
| 280 | post: "/api/v1/devices/{id}/image_downloads/{name}" |
| 281 | body: "*" |
| 282 | }; |
| 283 | } |
| 284 | |
| 285 | // Get image download status on a device |
| 286 | // The request retrieves progress on device and updates db record |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 287 | // Deprecated in voltha 2.8, will be removed |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 288 | rpc GetImageDownloadStatus(device.ImageDownload) returns(device.ImageDownload) { |
| 289 | option deprecated = true; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 290 | option (google.api.http) = { |
| 291 | get: "/api/v1/devices/{id}/image_downloads/{name}/status" |
| 292 | }; |
| 293 | } |
| 294 | |
| 295 | // Get image download db record |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 296 | // Deprecated in voltha 2.8, will be removed |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 297 | rpc GetImageDownload(device.ImageDownload) returns(device.ImageDownload) { |
| 298 | option deprecated = true; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 299 | option (google.api.http) = { |
| 300 | get: "/api/v1/devices/{id}/image_downloads/{name}" |
| 301 | }; |
| 302 | } |
| 303 | |
| 304 | // List image download db records for a given device |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 305 | // Deprecated in voltha 2.8, will be removed |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 306 | rpc ListImageDownloads(common.ID) returns(device.ImageDownloads) { |
| 307 | option deprecated = true; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 308 | option (google.api.http) = { |
| 309 | get: "/api/v1/devices/{id}/image_downloads" |
| 310 | }; |
| 311 | } |
| 312 | |
| 313 | // Cancel an existing image download process on a device |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 314 | // Deprecated in voltha 2.8, will be removed |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 315 | rpc CancelImageDownload(device.ImageDownload) returns(common.OperationResp) { |
| 316 | option deprecated = true; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 317 | option (google.api.http) = { |
| 318 | delete: "/api/v1/devices/{id}/image_downloads/{name}" |
| 319 | }; |
| 320 | } |
| 321 | |
| 322 | // Activate the specified image at a standby partition |
| 323 | // to active partition. |
| 324 | // Depending on the device implementation, this call |
| 325 | // may or may not cause device reboot. |
| 326 | // If no reboot, then a reboot is required to make the |
| 327 | // activated image running on device |
| 328 | // Note that the call is expected to be non-blocking. |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 329 | // Deprecated in voltha 2.8, will be removed |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 330 | rpc ActivateImageUpdate(device.ImageDownload) returns(common.OperationResp) { |
| 331 | option deprecated = true; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 332 | option (google.api.http) = { |
| 333 | post: "/api/v1/devices/{id}/image_downloads/{name}/image_update" |
| 334 | body: "*" |
| 335 | }; |
| 336 | } |
| 337 | |
| 338 | // Revert the specified image at standby partition |
| 339 | // to active partition, and revert to previous image |
| 340 | // Depending on the device implementation, this call |
| 341 | // may or may not cause device reboot. |
| 342 | // If no reboot, then a reboot is required to make the |
| 343 | // previous image running on device |
| 344 | // Note that the call is expected to be non-blocking. |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 345 | // Deprecated in voltha 2.8, will be removed |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 346 | rpc RevertImageUpdate(device.ImageDownload) returns(common.OperationResp) { |
| 347 | option deprecated = true; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 348 | option (google.api.http) = { |
| 349 | post: "/api/v1/devices/{id}/image_downloads/{name}/image_revert" |
| 350 | body: "*" |
| 351 | }; |
| 352 | } |
| 353 | |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 354 | // Downloads a certain image to the standby partition of the devices |
| 355 | // Note that the call is expected to be non-blocking. |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 356 | rpc DownloadImageToDevice (device.DeviceImageDownloadRequest) returns (device.DeviceImageResponse) { |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 357 | option (google.api.http) = { |
| 358 | get: "/api/v1/devices/images/download_images" |
| 359 | }; |
| 360 | } |
| 361 | |
| 362 | // Get image status on a number of devices devices |
| 363 | // Polled from northbound systems to get state of download/activate/commit |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 364 | rpc GetImageStatus (device.DeviceImageRequest) returns (device.DeviceImageResponse) { |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 365 | option (google.api.http) = { |
| 366 | get: "/api/v1/devices/images/images_status" |
| 367 | }; |
| 368 | } |
| 369 | |
| 370 | // Aborts the upgrade of an image on a device |
| 371 | // To be used carefully, stops any further operations for the Image on the given devices |
| 372 | // Might also stop if possible existing work, but no guarantees are given, |
| 373 | // depends on implementation and procedure status. |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 374 | rpc AbortImageUpgradeToDevice (device.DeviceImageRequest) returns (device.DeviceImageResponse) { |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 375 | option (google.api.http) = { |
| 376 | get: "/api/v1/devices/images/abort_upgrade_images" |
| 377 | }; |
| 378 | } |
| 379 | |
| 380 | // Get Both Active and Standby image for a given device |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 381 | rpc GetOnuImages (common.ID) returns (device.OnuImages) { |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 382 | option (google.api.http) = { |
| 383 | get: "/api/v1/devices/{id}/onu_images" |
| 384 | }; |
| 385 | } |
| 386 | |
| 387 | // Activate the specified image from a standby partition |
| 388 | // to active partition. |
| 389 | // Depending on the device implementation, this call |
| 390 | // may or may not cause device reboot. |
| 391 | // If no reboot, then a reboot is required to make the |
| 392 | // activated image running on device |
| 393 | // Note that the call is expected to be non-blocking. |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 394 | rpc ActivateImage (device.DeviceImageRequest) returns (device.DeviceImageResponse) { |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 395 | option (google.api.http) = { |
| 396 | post: "/api/v1/devices/images/activate_images" |
| 397 | body: "*" |
| 398 | }; |
| 399 | } |
| 400 | |
| 401 | // Commit the specified image to be default. |
| 402 | // Depending on the device implementation, this call |
| 403 | // may or may not cause device reboot. |
| 404 | // If no reboot, then a reboot is required to make the |
| 405 | // activated image running on device upon next reboot |
| 406 | // Note that the call is expected to be non-blocking. |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 407 | rpc CommitImage (device.DeviceImageRequest) returns (device.DeviceImageResponse) { |
Andrea Campanella | 9e94e8a | 2021-01-19 15:21:25 +0100 | [diff] [blame] | 408 | option (google.api.http) = { |
| 409 | post: "/api/v1/devices/images/commit_images" |
| 410 | body: "*" |
| 411 | }; |
| 412 | } |
| 413 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 414 | // List ports of a device |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 415 | rpc ListDevicePorts (common.ID) returns (device.Ports) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 416 | option (google.api.http) = { |
| 417 | get: "/api/v1/devices/{id}/ports" |
| 418 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 419 | } |
| 420 | |
| 421 | // List pm config of a device |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 422 | rpc ListDevicePmConfigs (common.ID) returns (device.PmConfigs) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 423 | option (google.api.http) = { |
| 424 | get: "/api/v1/devices/{id}/pm_configs" |
| 425 | }; |
| 426 | } |
| 427 | |
| 428 | // Update the pm config of a device |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 429 | rpc UpdateDevicePmConfigs(device.PmConfigs) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 430 | option (google.api.http) = { |
| 431 | post: "/api/v1/devices/{id}/pm_configs" |
| 432 | body: "*" |
| 433 | }; |
| 434 | } |
| 435 | |
| 436 | // List all flows of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 437 | rpc ListDeviceFlows(common.ID) returns(openflow_13.Flows) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 438 | option (google.api.http) = { |
| 439 | get: "/api/v1/devices/{id}/flows" |
| 440 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 441 | } |
| 442 | |
| 443 | // List all flow groups of a device |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 444 | rpc ListDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 445 | option (google.api.http) = { |
| 446 | get: "/api/v1/devices/{id}/flow_groups" |
| 447 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 448 | } |
| 449 | |
| 450 | // List device types known to Voltha |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 451 | rpc ListDeviceTypes(google.protobuf.Empty) returns(device.DeviceTypes) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 452 | option (google.api.http) = { |
| 453 | get: "/api/v1/device_types" |
| 454 | }; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 455 | } |
| 456 | |
| 457 | // Get additional information on a device type |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 458 | rpc GetDeviceType(common.ID) returns(device.DeviceType) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 459 | option (google.api.http) = { |
| 460 | get: "/api/v1/device_types/{id}" |
| 461 | }; |
| 462 | } |
| 463 | |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 464 | // Stream control packets to the dataplane |
| 465 | rpc StreamPacketsOut(stream openflow_13.PacketOut) |
| 466 | returns(google.protobuf.Empty) { |
| 467 | // This does not have an HTTP representation |
| 468 | } |
| 469 | |
| 470 | // Receive control packet stream |
| 471 | rpc ReceivePacketsIn(google.protobuf.Empty) |
| 472 | returns(stream openflow_13.PacketIn) { |
| 473 | // This does not have an HTTP representation |
| 474 | } |
| 475 | |
| 476 | rpc ReceiveChangeEvents(google.protobuf.Empty) |
| 477 | returns(stream openflow_13.ChangeEvent) { |
| 478 | // This does not have an HTTP representation |
| 479 | } |
| 480 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 481 | rpc CreateEventFilter(event.EventFilter) returns(event.EventFilter) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 482 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 483 | post: "/api/v1/event_filters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 484 | body: "*" |
| 485 | }; |
| 486 | } |
| 487 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 488 | // Get all filters present for a device |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 489 | rpc GetEventFilter(common.ID) returns(event.EventFilters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 490 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 491 | get: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 492 | }; |
| 493 | } |
| 494 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 495 | rpc UpdateEventFilter(event.EventFilter) returns(event.EventFilter) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 496 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 497 | put: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 498 | body: "*" |
| 499 | }; |
| 500 | } |
| 501 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 502 | rpc DeleteEventFilter(event.EventFilter) returns(google.protobuf.Empty) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 503 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 504 | delete: "/api/v1/event_filters/{id}" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 505 | }; |
| 506 | } |
| 507 | |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 508 | // Get all the filters present |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 509 | rpc ListEventFilters(google.protobuf.Empty) returns(event.EventFilters) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 510 | option (google.api.http) = { |
Devmalya Paul | 96a2c9e | 2019-11-06 07:17:44 +0000 | [diff] [blame] | 511 | get: "/api/v1/event_filters" |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 512 | }; |
| 513 | } |
| 514 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 515 | rpc GetImages(common.ID) returns(device.Images) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 516 | option (google.api.http) = { |
| 517 | get: "/api/v1/devices/{id}/images" |
| 518 | }; |
| 519 | } |
| 520 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 521 | rpc SelfTest(common.ID) returns(device.SelfTestResponse) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 522 | option (google.api.http) = { |
| 523 | post: "/api/v1/devices/{id}/self_test" |
| 524 | }; |
| 525 | } |
| 526 | |
| 527 | // OpenOMCI MIB information |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 528 | rpc GetMibDeviceData(common.ID) returns(omci.MibDeviceData) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 529 | option (google.api.http) = { |
| 530 | get: "/api/v1/openomci/{id}/mib" |
| 531 | }; |
| 532 | } |
| 533 | |
| 534 | // OpenOMCI ALARM information |
William Kurkian | 12fc0af | 2019-04-18 14:27:45 -0400 | [diff] [blame] | 535 | rpc GetAlarmDeviceData(common.ID) returns(omci.AlarmDeviceData) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 536 | option (google.api.http) = { |
| 537 | get: "/api/v1/openomci/{id}/alarm" |
| 538 | }; |
| 539 | } |
| 540 | |
| 541 | // Simulate an Alarm |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 542 | rpc SimulateAlarm(device.SimulateAlarmRequest) returns(common.OperationResp) { |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 543 | option (google.api.http) = { |
| 544 | post: "/api/v1/devices/{id}/simulate_larm" |
| 545 | body: "*" |
| 546 | }; |
| 547 | } |
Abhilash Laxmeshwar | dfbb74d | 2019-07-23 08:03:08 -0400 | [diff] [blame] | 548 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 549 | rpc EnablePort(device.Port) returns(google.protobuf.Empty) { |
kesavand | 4a002b0 | 2020-01-23 21:29:47 -0500 | [diff] [blame] | 550 | option (google.api.http) = { |
| 551 | post: "/v1/EnablePort" |
| 552 | body: "*" |
| 553 | }; |
| 554 | } |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 555 | rpc DisablePort(device.Port) returns(google.protobuf.Empty) { |
kesavand | 4a002b0 | 2020-01-23 21:29:47 -0500 | [diff] [blame] | 556 | option (google.api.http) = { |
| 557 | post: "/v1/DisablePort" |
| 558 | body: "*" |
| 559 | }; |
| 560 | } |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 561 | rpc GetExtValue(extension.ValueSpecifier) returns(extension.ReturnValues) { |
Dinesh Belwalkar | ed6da5e | 2020-02-25 11:23:57 -0800 | [diff] [blame] | 562 | option (google.api.http) = { |
| 563 | get: "/api/v1/GetExtValue" |
| 564 | }; |
| 565 | } |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 566 | rpc SetExtValue(extension.ValueSet) returns(google.protobuf.Empty) { |
dpaul | 2b52e71 | 2020-06-23 13:02:28 +0530 | [diff] [blame] | 567 | option (google.api.http) = { |
| 568 | get: "/api/v1/SetExtValue" |
| 569 | }; |
| 570 | } |
kesavand | 4a002b0 | 2020-01-23 21:29:47 -0500 | [diff] [blame] | 571 | |
onkar.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 572 | // omci start and stop cli implementation |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 573 | rpc StartOmciTestAction(omci.OmciTestRequest) returns(omci.TestResponse) { |
onkar.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 574 | option (google.api.http) = { |
| 575 | post: "/api/v1/start_omci_test" |
| 576 | body: "*" |
| 577 | }; |
| 578 | } |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 579 | } |
| 580 | |