blob: 9fcc32232d1511aacc3024b8199ec6439c72b79a [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;
26 }
aghoshc301dcd2020-09-03 16:55:34 +010027 Status status = 1;
28 Reason reason = 2;
29 SoftwareVersionInformation info = 3;
30}
31
Amit Ghosh09f28362020-06-12 21:52:19 +010032message DownloadImageRequest {
33 Uuid device_uuid = 1;
34 ImageInformation image_info = 2;
35}
36
amit.ghoshed23db02020-11-18 10:26:36 +010037message ConfigRequest {
38 Uuid device_uuid = 1;
39 // Location of the configuration file, authentication (user/pass) if any should be in the url string
40 // The config_url would contain the protocol, credentials, the IP address/DNS of the server and the path of the file
41 // e.g. sftp://download_user:download_pass@192.168.0.1:22/OLT-configs/config-v1.2.3.xml
42 string config_url = 2;
43}
44
45message ConfigResponse {
amit.ghoshae473032021-01-10 11:59:10 +010046 enum Reason {
47 UNDEFINED_REASON = 0;
48 UNKNOWN_DEVICE = 1;
49 INTERNAL_ERROR = 2;
50 ERROR_FETCHING_CONFIG = 3;
51 INVALID_CONFIG = 4;
52 OPERATION_ALREADY_IN_PROGRESS = 5;
53 }
amit.ghoshed23db02020-11-18 10:26:36 +010054 Status status = 1;
55 Reason reason = 2;
56}
57
amit.ghosh2c938b82021-01-14 11:34:03 +010058message StartupConfigInfoRequest {
59 Uuid device_uuid = 1;
60}
61
62message StartupConfigInfoResponse {
63 enum Reason {
64 UNDEFINED_REASON = 0;
65 UNKNOWN_DEVICE = 1;
66 INTERNAL_ERROR = 2;
67 }
68 Status status = 1;
69 Reason reason = 2;
70 // The config_url is an optional attribute, the device manager could return the location from
71 // where the config was downloaded. Also it would not be present/empty for a fresh device into which the
72 // startup config would have been installed in the factory.
73 string config_url = 3;
74 // The version of the startup configuration. It is recommended to use semVer, but the DM implementations
75 // and operators could choose any other format as well.
76 string version = 4;
77}
78
Amit Ghosh09f28362020-06-12 21:52:19 +010079service NativeSoftwareManagementService {
80 // Get the software version information of the Active and Standby images
aghoshc301dcd2020-09-03 16:55:34 +010081 rpc GetSoftwareVersion(HardwareID) returns(GetSoftwareVersionInformationResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +010082
83 // Downloads and installs the image in the standby partition, returns the status/progress of the Install
84 rpc DownloadImage(DownloadImageRequest) returns(stream ImageStatus);
85
86 // Activates and runs the OLT with the image in the standby partition. If things are fine this image will
87 // henceforth be marked as the Active Partition. The old working image would remain on the Standby partition.
88 // Any possibly required (sub-)steps like "commit" are left to the "Device Manager"
89 rpc ActivateImage(HardwareID) returns(stream ImageStatus);
90
91 // 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 +010092 // This API is to be used if operator wants to go back to the previous software
Amit Ghosh09f28362020-06-12 21:52:19 +010093 rpc RevertToStandbyImage(HardwareID) returns(stream ImageStatus);
94
amit.ghoshed23db02020-11-18 10:26:36 +010095 // This API can be used to let the devices pickup their properitary configuration which they need at startup.
96 rpc UpdateStartupConfiguration(ConfigRequest) returns(stream ConfigResponse);
97
amit.ghosh2c938b82021-01-14 11:34:03 +010098 // This API can be used to retrieve information about the current startup configuration that a device is using
99 rpc GetStartupConfigurationInfo(StartupConfigInfoRequest) returns(StartupConfigInfoResponse);
100
Amit Ghosh09f28362020-06-12 21:52:19 +0100101 // If needed we can add this later
102 //rpc SubscribeToEvents() returns (stream );
103}