blob: c2901e9f0b5aaf8cdd604f246614a6f5455c1f04 [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;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +010031 string reason_detail = 4;
aghoshc301dcd2020-09-03 16:55:34 +010032}
33
Amit Ghosh09f28362020-06-12 21:52:19 +010034message DownloadImageRequest {
35 Uuid device_uuid = 1;
36 ImageInformation image_info = 2;
37}
38
amit.ghoshed23db02020-11-18 10:26:36 +010039message 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
47message ConfigResponse {
amit.ghoshae473032021-01-10 11:59:10 +010048 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.ghoshbd2022e2021-02-22 05:58:53 +010055 DEVICE_UNREACHABLE = 6;
amit.ghoshae473032021-01-10 11:59:10 +010056 }
amit.ghoshed23db02020-11-18 10:26:36 +010057 Status status = 1;
58 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +010059 string reason_detail = 3;
amit.ghoshed23db02020-11-18 10:26:36 +010060}
61
amit.ghosh2c938b82021-01-14 11:34:03 +010062message StartupConfigInfoRequest {
63 Uuid device_uuid = 1;
64}
65
66message StartupConfigInfoResponse {
67 enum Reason {
68 UNDEFINED_REASON = 0;
69 UNKNOWN_DEVICE = 1;
70 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +010071 DEVICE_UNREACHABLE = 3;
amit.ghosh2c938b82021-01-14 11:34:03 +010072 }
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.ghosh8ab1e6e2021-02-23 07:40:17 +010082 string reason_detail = 5;
amit.ghosh2c938b82021-01-14 11:34:03 +010083}
84
Amit Ghosh09f28362020-06-12 21:52:19 +010085service NativeSoftwareManagementService {
86 // Get the software version information of the Active and Standby images
aghoshc301dcd2020-09-03 16:55:34 +010087 rpc GetSoftwareVersion(HardwareID) returns(GetSoftwareVersionInformationResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +010088
89 // Downloads and installs the image in the standby partition, returns the status/progress of the Install
90 rpc DownloadImage(DownloadImageRequest) returns(stream ImageStatus);
91
92 // Activates and runs the OLT with the image in the standby partition. If things are fine this image will
93 // henceforth be marked as the Active Partition. The old working image would remain on the Standby partition.
94 // Any possibly required (sub-)steps like "commit" are left to the "Device Manager"
95 rpc ActivateImage(HardwareID) returns(stream ImageStatus);
96
97 // 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 +010098 // This API is to be used if operator wants to go back to the previous software
Amit Ghosh09f28362020-06-12 21:52:19 +010099 rpc RevertToStandbyImage(HardwareID) returns(stream ImageStatus);
100
amit.ghoshed23db02020-11-18 10:26:36 +0100101 // This API can be used to let the devices pickup their properitary configuration which they need at startup.
102 rpc UpdateStartupConfiguration(ConfigRequest) returns(stream ConfigResponse);
103
amit.ghosh2c938b82021-01-14 11:34:03 +0100104 // This API can be used to retrieve information about the current startup configuration that a device is using
105 rpc GetStartupConfigurationInfo(StartupConfigInfoRequest) returns(StartupConfigInfoResponse);
106
Amit Ghosh09f28362020-06-12 21:52:19 +0100107 // If needed we can add this later
108 //rpc SubscribeToEvents() returns (stream );
109}