Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 1 | syntax = "proto3";
|
| 2 |
|
| 3 | option go_package = "github.com/opencord/device-management-interface/v3/go/dmi";
|
| 4 | package dmi;
|
| 5 |
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 6 | import "dmi/commons.proto";
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 7 | import "dmi/hw.proto";
|
| 8 | import "dmi/sw_image.proto";
|
| 9 |
|
| 10 | // The software management concept described here is aligned with WT-383a3 (Revision: 06 April 2020).
|
| 11 | // In particular Section 11 Software management
|
| 12 | // TODO check model
|
| 13 |
|
| 14 | // Protos for managing the software on a hardware device
|
| 15 |
|
| 16 | message SoftwareVersionInformation {
|
| 17 | repeated ImageVersion active_versions = 1;
|
| 18 | repeated ImageVersion standby_versions = 2;
|
| 19 | }
|
| 20 |
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 21 | message GetSoftwareVersionInformationResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame^] | 22 | enum Reason {
|
| 23 | UNDEFINED_REASON = 0;
|
| 24 | UNKNOWN_DEVICE = 1;
|
| 25 | INTERNAL_ERROR = 2;
|
| 26 | }
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 27 | Status status = 1;
|
| 28 | Reason reason = 2;
|
| 29 | SoftwareVersionInformation info = 3;
|
| 30 | }
|
| 31 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 32 | message DownloadImageRequest {
|
| 33 | Uuid device_uuid = 1;
|
| 34 | ImageInformation image_info = 2;
|
| 35 | }
|
| 36 |
|
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 37 | message ConfigRequest {
|
| 38 | Uuid device_uuid = 1;
|
| 39 | // Location of the configuration file, authentication (user/pass) if any should be in the url string
|
| 40 | // The config_url would contain the protocol, credentials, the IP address/DNS of the server and the path of the file
|
| 41 | // e.g. sftp://download_user:download_pass@192.168.0.1:22/OLT-configs/config-v1.2.3.xml
|
| 42 | string config_url = 2;
|
| 43 | }
|
| 44 |
|
| 45 | message ConfigResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame^] | 46 | enum Reason {
|
| 47 | UNDEFINED_REASON = 0;
|
| 48 | UNKNOWN_DEVICE = 1;
|
| 49 | INTERNAL_ERROR = 2;
|
| 50 | ERROR_FETCHING_CONFIG = 3;
|
| 51 | INVALID_CONFIG = 4;
|
| 52 | OPERATION_ALREADY_IN_PROGRESS = 5;
|
| 53 | }
|
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 54 | Status status = 1;
|
| 55 | Reason reason = 2;
|
| 56 | }
|
| 57 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 58 | service NativeSoftwareManagementService {
|
| 59 | // Get the software version information of the Active and Standby images
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 60 | rpc GetSoftwareVersion(HardwareID) returns(GetSoftwareVersionInformationResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 61 |
|
| 62 | // Downloads and installs the image in the standby partition, returns the status/progress of the Install
|
| 63 | rpc DownloadImage(DownloadImageRequest) returns(stream ImageStatus);
|
| 64 |
|
| 65 | // Activates and runs the OLT with the image in the standby partition. If things are fine this image will
|
| 66 | // henceforth be marked as the Active Partition. The old working image would remain on the Standby partition.
|
| 67 | // Any possibly required (sub-)steps like "commit" are left to the "Device Manager"
|
| 68 | rpc ActivateImage(HardwareID) returns(stream ImageStatus);
|
| 69 |
|
| 70 | // Marks the image in the Standby as Active and reboots the device, so that it boots from that image which was in the standby.
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 71 | // This API is to be used if operator wants to go back to the previous software
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 72 | rpc RevertToStandbyImage(HardwareID) returns(stream ImageStatus);
|
| 73 |
|
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 74 | // This API can be used to let the devices pickup their properitary configuration which they need at startup.
|
| 75 | rpc UpdateStartupConfiguration(ConfigRequest) returns(stream ConfigResponse);
|
| 76 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 77 | // If needed we can add this later
|
| 78 | //rpc SubscribeToEvents() returns (stream );
|
| 79 | }
|