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;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 26 | DEVICE_UNREACHABLE = 3;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 27 | }
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 28 | Status status = 1;
|
| 29 | Reason reason = 2;
|
| 30 | SoftwareVersionInformation info = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 31 | string reason_detail = 4;
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 32 | }
|
| 33 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 34 | message DownloadImageRequest {
|
| 35 | Uuid device_uuid = 1;
|
| 36 | ImageInformation image_info = 2;
|
| 37 | }
|
| 38 |
|
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 39 | message ConfigRequest {
|
| 40 | Uuid device_uuid = 1;
|
| 41 | // Location of the configuration file, authentication (user/pass) if any should be in the url string
|
| 42 | // The config_url would contain the protocol, credentials, the IP address/DNS of the server and the path of the file
|
| 43 | // e.g. sftp://download_user:download_pass@192.168.0.1:22/OLT-configs/config-v1.2.3.xml
|
| 44 | string config_url = 2;
|
| 45 | }
|
| 46 |
|
| 47 | message ConfigResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 48 | enum Reason {
|
| 49 | UNDEFINED_REASON = 0;
|
| 50 | UNKNOWN_DEVICE = 1;
|
| 51 | INTERNAL_ERROR = 2;
|
| 52 | ERROR_FETCHING_CONFIG = 3;
|
| 53 | INVALID_CONFIG = 4;
|
| 54 | OPERATION_ALREADY_IN_PROGRESS = 5;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 55 | DEVICE_UNREACHABLE = 6;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 56 | }
|
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 57 | Status status = 1;
|
| 58 | Reason reason = 2;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 59 | string reason_detail = 3;
|
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 60 | }
|
| 61 |
|
amit.ghosh | 2c938b8 | 2021-01-14 11:34:03 +0100 | [diff] [blame] | 62 | message StartupConfigInfoRequest {
|
| 63 | Uuid device_uuid = 1;
|
| 64 | }
|
| 65 |
|
| 66 | message StartupConfigInfoResponse {
|
| 67 | enum Reason {
|
| 68 | UNDEFINED_REASON = 0;
|
| 69 | UNKNOWN_DEVICE = 1;
|
| 70 | INTERNAL_ERROR = 2;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 71 | DEVICE_UNREACHABLE = 3;
|
amit.ghosh | 2c938b8 | 2021-01-14 11:34:03 +0100 | [diff] [blame] | 72 | }
|
| 73 | Status status = 1;
|
| 74 | Reason reason = 2;
|
| 75 | // The config_url is an optional attribute, the device manager could return the location from
|
| 76 | // where the config was downloaded. Also it would not be present/empty for a fresh device into which the
|
| 77 | // startup config would have been installed in the factory.
|
| 78 | string config_url = 3;
|
| 79 | // The version of the startup configuration. It is recommended to use semVer, but the DM implementations
|
| 80 | // and operators could choose any other format as well.
|
| 81 | string version = 4;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 82 | string reason_detail = 5;
|
amit.ghosh | 2c938b8 | 2021-01-14 11:34:03 +0100 | [diff] [blame] | 83 | }
|
| 84 |
|
amit.ghosh | 5a68980 | 2022-09-12 14:26:10 +0200 | [diff] [blame] | 85 | message UploadDebugInfoRequest {
|
| 86 | Uuid device_uuid = 1;
|
| 87 | // location_url is the remote location where the information needed for troubleshooting should be uploaded.
|
| 88 | // Authentication (user/pass) if any should be in the location_url string
|
| 89 | // The locaion_url would contain the protocol, credentials, the IP address/DNS of the server and the path of the directory
|
| 90 | // e.g. sftp://upload_user:upload_pass@192.168.0.1:22/hw_debug_info/
|
| 91 | string location_url = 3;
|
| 92 | }
|
| 93 |
|
| 94 | // Implementations would be expected to stream multiple UploadDebugInfoStatus indicating the progress of the upload
|
| 95 | message UploadDebugInfoStatus {
|
| 96 | Uuid device_uuid = 1;
|
| 97 |
|
| 98 | enum UploadStatus {
|
| 99 | UNDEFINED_UPLOAD_STATUS = 0;
|
| 100 | COMPLETE = 1;
|
| 101 | IN_PROGRESS = 2;
|
| 102 | ERROR = 3;
|
| 103 | }
|
| 104 |
|
| 105 | UploadStatus status = 2;
|
| 106 | // percent_uploaded is the percentage of the upload that is done
|
| 107 | // should be a value between 0 and 100 when status is IN_PROGRESS
|
| 108 | // should be 100 when status is COMPLETE
|
| 109 | // can be set to -1 if the device manager implementations cannot support
|
| 110 | // the progress percentage
|
| 111 | int32 percent_uploaded = 3;
|
| 112 |
|
| 113 | enum Reason {
|
| 114 | UNDEFINED_REASON = 0;
|
| 115 | UNKNOWN_DEVICE = 1;
|
| 116 | INTERNAL_ERROR = 2;
|
amit.ghosh | dfd5d7e | 2023-03-14 21:14:33 +0100 | [diff] [blame] | 117 | // The DM implementations should have retry mechanisms (timeout values dependant on specific implementations)
|
| 118 | // and even after those if the operation cannot be completed/reached then return error with reason as DEVICE_NOT_REACHABLE
|
| 119 | DEVICE_NOT_REACHABLE = 3;
|
amit.ghosh | 5a68980 | 2022-09-12 14:26:10 +0200 | [diff] [blame] | 120 | REMOTE_LOCATION_UNREACHABLE = 4;
|
| 121 | REMOTE_LOCATION_PERMISSION_DENIED = 5;
|
| 122 | ERROR_DURING_UPLOAD = 6;
|
amit.ghosh | 4d731da | 2023-03-07 14:32:00 +0100 | [diff] [blame] | 123 | DEVICE_BUSY = 7;
|
amit.ghosh | dfd5d7e | 2023-03-14 21:14:33 +0100 | [diff] [blame] | 124 | // wrong location_url in the request
|
| 125 | ERROR_IN_REQUEST = 8;
|
| 126 | DEVICE_IN_WRONG_STATE = 9;
|
| 127 | OPERATION_ALREADY_IN_PROGRESS = 10;
|
amit.ghosh | 5a68980 | 2022-09-12 14:26:10 +0200 | [diff] [blame] | 128 | }
|
| 129 | Reason reason = 4; // reason specifies why the status is ERROR
|
| 130 | string location_url = 5;
|
| 131 | // file_name is the file at location_url where the debug information was uploaded.
|
| 132 | // Implementations need to ensure that file_name is unique at the remote location.
|
| 133 | string file_name = 6;
|
| 134 | }
|
| 135 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 136 | service NativeSoftwareManagementService {
|
| 137 | // Get the software version information of the Active and Standby images
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 138 | rpc GetSoftwareVersion(HardwareID) returns(GetSoftwareVersionInformationResponse);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 139 |
|
| 140 | // Downloads and installs the image in the standby partition, returns the status/progress of the Install
|
| 141 | rpc DownloadImage(DownloadImageRequest) returns(stream ImageStatus);
|
| 142 |
|
| 143 | // Activates and runs the OLT with the image in the standby partition. If things are fine this image will
|
| 144 | // henceforth be marked as the Active Partition. The old working image would remain on the Standby partition.
|
| 145 | // Any possibly required (sub-)steps like "commit" are left to the "Device Manager"
|
| 146 | rpc ActivateImage(HardwareID) returns(stream ImageStatus);
|
| 147 |
|
| 148 | // 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] | 149 | // 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] | 150 | rpc RevertToStandbyImage(HardwareID) returns(stream ImageStatus);
|
| 151 |
|
amit.ghosh | ed23db0 | 2020-11-18 10:26:36 +0100 | [diff] [blame] | 152 | // This API can be used to let the devices pickup their properitary configuration which they need at startup.
|
| 153 | rpc UpdateStartupConfiguration(ConfigRequest) returns(stream ConfigResponse);
|
| 154 |
|
amit.ghosh | 2c938b8 | 2021-01-14 11:34:03 +0100 | [diff] [blame] | 155 | // This API can be used to retrieve information about the current startup configuration that a device is using
|
| 156 | rpc GetStartupConfigurationInfo(StartupConfigInfoRequest) returns(StartupConfigInfoResponse);
|
| 157 |
|
amit.ghosh | 5a68980 | 2022-09-12 14:26:10 +0200 | [diff] [blame] | 158 | // This API can be used to upload to a remote location, information useful for troubleshooting problems on the hardware
|
| 159 | rpc UploadDebugInfo(UploadDebugInfoRequest) returns(stream UploadDebugInfoStatus);
|
| 160 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 161 | // If needed we can add this later
|
| 162 | //rpc SubscribeToEvents() returns (stream );
|
| 163 | }
|