blob: 82917d4c8f15aff17d350adc848ec88ce77c1e1b [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
aghoshc301dcd2020-09-03 16:55:34 +01006import "dmi/commons.proto";
Amit Ghosh09f28362020-06-12 21:52:19 +01007import "dmi/hw.proto";
8import "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
16message SoftwareVersionInformation {
17 repeated ImageVersion active_versions = 1;
18 repeated ImageVersion standby_versions = 2;
19}
20
aghoshc301dcd2020-09-03 16:55:34 +010021message GetSoftwareVersionInformationResponse {
amit.ghoshae473032021-01-10 11:59:10 +010022 enum Reason {
23 UNDEFINED_REASON = 0;
24 UNKNOWN_DEVICE = 1;
25 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +010026 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +010027 }
aghoshc301dcd2020-09-03 16:55:34 +010028 Status status = 1;
29 Reason reason = 2;
30 SoftwareVersionInformation info = 3;
31}
32
Amit Ghosh09f28362020-06-12 21:52:19 +010033message DownloadImageRequest {
34 Uuid device_uuid = 1;
35 ImageInformation image_info = 2;
36}
37
amit.ghoshed23db02020-11-18 10:26:36 +010038message ConfigRequest {
39 Uuid device_uuid = 1;
40 // Location of the configuration file, authentication (user/pass) if any should be in the url string
41 // The config_url would contain the protocol, credentials, the IP address/DNS of the server and the path of the file
42 // e.g. sftp://download_user:download_pass@192.168.0.1:22/OLT-configs/config-v1.2.3.xml
43 string config_url = 2;
44}
45
46message ConfigResponse {
amit.ghoshae473032021-01-10 11:59:10 +010047 enum Reason {
48 UNDEFINED_REASON = 0;
49 UNKNOWN_DEVICE = 1;
50 INTERNAL_ERROR = 2;
51 ERROR_FETCHING_CONFIG = 3;
52 INVALID_CONFIG = 4;
53 OPERATION_ALREADY_IN_PROGRESS = 5;
amit.ghoshbd2022e2021-02-22 05:58:53 +010054 DEVICE_UNREACHABLE = 6;
amit.ghoshae473032021-01-10 11:59:10 +010055 }
amit.ghoshed23db02020-11-18 10:26:36 +010056 Status status = 1;
57 Reason reason = 2;
58}
59
amit.ghosh2c938b82021-01-14 11:34:03 +010060message StartupConfigInfoRequest {
61 Uuid device_uuid = 1;
62}
63
64message StartupConfigInfoResponse {
65 enum Reason {
66 UNDEFINED_REASON = 0;
67 UNKNOWN_DEVICE = 1;
68 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +010069 DEVICE_UNREACHABLE = 3;
amit.ghosh2c938b82021-01-14 11:34:03 +010070 }
71 Status status = 1;
72 Reason reason = 2;
73 // The config_url is an optional attribute, the device manager could return the location from
74 // where the config was downloaded. Also it would not be present/empty for a fresh device into which the
75 // startup config would have been installed in the factory.
76 string config_url = 3;
77 // The version of the startup configuration. It is recommended to use semVer, but the DM implementations
78 // and operators could choose any other format as well.
79 string version = 4;
80}
81
Amit Ghosh09f28362020-06-12 21:52:19 +010082service NativeSoftwareManagementService {
83 // Get the software version information of the Active and Standby images
aghoshc301dcd2020-09-03 16:55:34 +010084 rpc GetSoftwareVersion(HardwareID) returns(GetSoftwareVersionInformationResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +010085
86 // Downloads and installs the image in the standby partition, returns the status/progress of the Install
87 rpc DownloadImage(DownloadImageRequest) returns(stream ImageStatus);
88
89 // Activates and runs the OLT with the image in the standby partition. If things are fine this image will
90 // henceforth be marked as the Active Partition. The old working image would remain on the Standby partition.
91 // Any possibly required (sub-)steps like "commit" are left to the "Device Manager"
92 rpc ActivateImage(HardwareID) returns(stream ImageStatus);
93
94 // Marks the image in the Standby as Active and reboots the device, so that it boots from that image which was in the standby.
aghoshc301dcd2020-09-03 16:55:34 +010095 // This API is to be used if operator wants to go back to the previous software
Amit Ghosh09f28362020-06-12 21:52:19 +010096 rpc RevertToStandbyImage(HardwareID) returns(stream ImageStatus);
97
amit.ghoshed23db02020-11-18 10:26:36 +010098 // This API can be used to let the devices pickup their properitary configuration which they need at startup.
99 rpc UpdateStartupConfiguration(ConfigRequest) returns(stream ConfigResponse);
100
amit.ghosh2c938b82021-01-14 11:34:03 +0100101 // This API can be used to retrieve information about the current startup configuration that a device is using
102 rpc GetStartupConfigurationInfo(StartupConfigInfoRequest) returns(StartupConfigInfoResponse);
103
Amit Ghosh09f28362020-06-12 21:52:19 +0100104 // If needed we can add this later
105 //rpc SubscribeToEvents() returns (stream );
106}