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