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 |
|
| 6 | import "dmi/commons.proto";
|
| 7 |
|
| 8 | // Protos for modeling a software image and it's status
|
| 9 |
|
| 10 | message ImageVersion {
|
| 11 | string image_name = 1;
|
| 12 | string version = 2;
|
| 13 | }
|
| 14 |
|
| 15 | message ImageInformation {
|
| 16 | ImageVersion image = 1;
|
| 17 | // Script used by the device specific managers to install the image.
|
| 18 | // Script must be included in the object downloaded from the image_url
|
| 19 | string image_install_script = 2;
|
| 20 | // Location of the image and installation script, authentication (user/pass) if any should be in the url string
|
Amit Ghosh | ab6b2e4 | 2020-07-17 13:46:55 +0100 | [diff] [blame] | 21 | // The image_url would contain the protocol, credentials, the IP address/DNS of the server and the path of the file
|
| 22 | // e.g. sftp://download_user:download_pass@192.168.0.1:22/images/image1
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 23 | string image_url = 3;
|
| 24 | // SHA-256 sum of the image (sha256sum on Linux)
|
| 25 | string sha256sum = 5;
|
| 26 | }
|
| 27 |
|
| 28 | message ImageStatus {
|
| 29 | enum ImageState {
|
Chandrakanth Nalkudre Gowda | f7abc04 | 2021-08-24 14:39:49 +0530 | [diff] [blame] | 30 | UNDEFINED_STATE = 0; // Initial state
|
| 31 | COPYING_IMAGE = 1; // Downloading the image on the standby partition
|
| 32 | INSTALLING_IMAGE = 2; // Installing the image on the standby partition
|
| 33 | COMMITTING_IMAGE = 3; // Committing the image and marking it as the active partition
|
| 34 | REBOOTING_DEVICE = 4; // Rebooting the device
|
| 35 | UPGRADE_COMPLETE = 5; // Image upgrade on the standby partition completed
|
| 36 | UPGRADE_FAILED = 6; // Image upgrade on the standby partition failed
|
| 37 | ACTIVATION_COMPLETE = 7; // Image activation completed
|
| 38 | ACTIVATION_FAILED = 8; // Image activation failed
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 39 | }
|
| 40 |
|
| 41 | enum Reason {
|
Amit Ghosh | ab6b2e4 | 2020-07-17 13:46:55 +0100 | [diff] [blame] | 42 | UNDEFINED_REASON = 0;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 43 | ERROR_IN_REQUEST = 1;
|
| 44 | INTERNAL_ERROR = 2;
|
| 45 | DEVICE_IN_WRONG_STATE = 3;
|
| 46 | INVALID_IMAGE = 4;
|
| 47 | WRONG_IMAGE_CHECKSUM = 5;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 48 | OPERATION_ALREADY_IN_PROGRESS = 6;
|
| 49 | UNKNOWN_DEVICE = 7;
|
| 50 | // The DM implementations should have retry mechanisms (timeout values dependant on specific implementations)
|
| 51 | // and even after those if the operation cannot be completed/reached then return error with reason as DEVICE_NOT_REACHABLE
|
| 52 | DEVICE_NOT_REACHABLE = 8;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 53 | }
|
| 54 |
|
| 55 | Status status = 1;
|
| 56 | Reason reason = 2;
|
| 57 | ImageState state = 3;
|
| 58 | // description contains more information about the current state of the procedure and is device dependant
|
| 59 | string description = 4;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 60 | string reason_detail = 5;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 61 | }
|