blob: 8013c8b9e36fea6c0965ac83c411f8d1d27476e8 [file] [log] [blame]
Amit Ghosh09f28362020-06-12 21:52:19 +01001syntax = "proto3";
2
3option go_package = "github.com/opencord/device-management-interface/v3/go/dmi";
4package dmi;
5
6import "dmi/commons.proto";
7
8// Protos for modeling a software image and it's status
9
10message ImageVersion {
11 string image_name = 1;
12 string version = 2;
13}
14
15message 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 Ghoshab6b2e42020-07-17 13:46:55 +010021 // 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 Ghosh09f28362020-06-12 21:52:19 +010023 string image_url = 3;
24 // SHA-256 sum of the image (sha256sum on Linux)
25 string sha256sum = 5;
26}
27
28message ImageStatus {
29 enum ImageState {
30 UNDEFINED_STATE = 0;
31 COPYING_IMAGE = 1;
32 INSTALLING_IMAGE = 2;
aghoshc301dcd2020-09-03 16:55:34 +010033 COMMITTING_IMAGE = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +010034 REBOOTING_DEVICE = 4;
35 UPGRADE_COMPLETE = 5;
36 UPGRADE_FAILED = 6;
37 ACTIVATION_COMPLETE = 7;
38 ACTIVATION_FAILED = 8;
39 }
40
41 enum Reason {
Amit Ghoshab6b2e42020-07-17 13:46:55 +010042 UNDEFINED_REASON = 0;
Amit Ghosh09f28362020-06-12 21:52:19 +010043 ERROR_IN_REQUEST = 1;
44 INTERNAL_ERROR = 2;
45 DEVICE_IN_WRONG_STATE = 3;
46 INVALID_IMAGE = 4;
47 WRONG_IMAGE_CHECKSUM = 5;
amit.ghoshae473032021-01-10 11:59:10 +010048 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 Ghosh09f28362020-06-12 21:52:19 +010053 }
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;
60}