From f67ce33973294462378beb617b3b3ea0d05eebec Mon Sep 17 00:00:00 2001 From: michel-laterman Date: Wed, 16 Oct 2024 09:11:09 -0700 Subject: [PATCH 1/4] Add downloading state and metadata to packagestatus --- proto/opamp.proto | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/proto/opamp.proto b/proto/opamp.proto index 1e233c4..4d1952a 100644 --- a/proto/opamp.proto +++ b/proto/opamp.proto @@ -802,6 +802,10 @@ message PackageStatus { // Error message if the status is erroneous. string error_message = 7; + + // Optional details that may be of interest to a user. + // For example the download rate, percent downloaded, or a message. + map metadata = 8; } // The status of this package. @@ -814,7 +818,7 @@ enum PackageStatusEnum { // Installation of this package has not yet started. PackageStatusEnum_InstallPending = 1; - // Agent is currently downloading and installing the package. + // Agent is currently installing the package. // server_offered_hash field MUST be set to indicate the version that the // Agent is installing. The error_message field MUST NOT be set. PackageStatusEnum_Installing = 2; @@ -824,6 +828,11 @@ enum PackageStatusEnum { // tried to install. The error_message may also contain more details about // the failure. PackageStatusEnum_InstallFailed = 3; + + // Agent is currently downloading the package. + // server_offered_hash field MUST be set to indicate the version that the + // Agent is installing. The error_message field MUST NOT be set. + PackageStatusEnum_Downloading = 4; } // Properties related to identification of the Agent, which can be overridden From 89133c69b04a3d462dca5a943ed208c1a512f54f Mon Sep 17 00:00:00 2001 From: michel-laterman Date: Wed, 16 Oct 2024 09:24:46 -0700 Subject: [PATCH 2/4] mark metadata feature in development stage --- proto/opamp.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/proto/opamp.proto b/proto/opamp.proto index 4d1952a..a60718b 100644 --- a/proto/opamp.proto +++ b/proto/opamp.proto @@ -805,6 +805,7 @@ message PackageStatus { // Optional details that may be of interest to a user. // For example the download rate, percent downloaded, or a message. + // Status: [Development] map metadata = 8; } From c037c2eaab4eb2ec8ce931c9ee06a02397bc17b7 Mon Sep 17 00:00:00 2001 From: michel-laterman Date: Tue, 22 Oct 2024 15:36:27 -0700 Subject: [PATCH 3/4] Review feedback; replaced generic map with a concrete details implementation --- proto/opamp.proto | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/proto/opamp.proto b/proto/opamp.proto index a60718b..c039e51 100644 --- a/proto/opamp.proto +++ b/proto/opamp.proto @@ -804,9 +804,20 @@ message PackageStatus { string error_message = 7; // Optional details that may be of interest to a user. - // For example the download rate, percent downloaded, or a message. + // Should only be set if status is Downloading. // Status: [Development] - map metadata = 8; + PackageDownloadDetails download_details = 8; +} + + +// Additional details that an agent can use to describe an in-progress package download. +// Status: [Development] +message PackageDownloadDetails { + // The package download progress as a percentage. + double download_percent = 1; + + // The current package download rate in bytes per second. + uint64 download_rate = 2; } // The status of this package. @@ -833,6 +844,7 @@ enum PackageStatusEnum { // Agent is currently downloading the package. // server_offered_hash field MUST be set to indicate the version that the // Agent is installing. The error_message field MUST NOT be set. + // Status: [Development] PackageStatusEnum_Downloading = 4; } From 3d03bdd92e8dad87eee00d95fc84f81b1e78f976 Mon Sep 17 00:00:00 2001 From: michel-laterman Date: Wed, 23 Oct 2024 08:51:04 -0700 Subject: [PATCH 4/4] Review feedback, add new attributes to specification.md --- proto/opamp.proto | 2 +- specification.md | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/proto/opamp.proto b/proto/opamp.proto index c039e51..44f9dc3 100644 --- a/proto/opamp.proto +++ b/proto/opamp.proto @@ -817,7 +817,7 @@ message PackageDownloadDetails { double download_percent = 1; // The current package download rate in bytes per second. - uint64 download_rate = 2; + uint64 download_bytes_per_second = 2; } // The status of this package. diff --git a/specification.md b/specification.md index e86953a..806b69b 100644 --- a/specification.md +++ b/specification.md @@ -88,6 +88,7 @@ Status: [Beta] - [PackageStatus.server_offered_hash](#packagestatusserver_offered_hash) - [PackageStatus.status](#packagestatusstatus) - [PackageStatus.error_message](#packagestatuserror_message) + - [PackageStatus.download_details](#packagestatusdownload_details) * [Connection Settings Management](#connection-settings-management) + [OpAMP Connection Setting Offer Flow](#opamp-connection-setting-offer-flow) + [Trust On First Use](#trust-on-first-use) @@ -1310,11 +1311,14 @@ message PackageStatus { bytes server_offered_hash = 5; enum Status { INSTALLED = 0; - INSTALLING = 1; - INSTALL_FAILED = 2; + INSTALL_PENDING = 1; + INSTALLING = 2; + INSTALL_FAILED = 3; + DOWNLOADING = 4; } Status status = 6; string error_message = 7; + PackageDownloadDetails download_details = 8; } ``` @@ -1393,6 +1397,20 @@ failure. An error message if the status is erroneous. +##### PackageStatus.download_details + +Status: [Development] + +The download_details contains additional details that descibe a package download. +It should only be set if the status is `DOWNLOADING`. + +```protobuf +message PackageDownloadDetails { + double download_percent = 1; + uint64 download_bytes_per_second = 2; +} +``` + ### Connection Settings Management Status: [Beta]