public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Hannes Laimer <h.laimer@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 2/4] api2: DataStoreListItem add maintenance info
Date: Mon, 25 Apr 2022 08:31:41 +0200	[thread overview]
Message-ID: <9fa602a9-b3db-9a23-c909-303f318d7b32@proxmox.com> (raw)
In-Reply-To: <20220415072817.14768-3-h.laimer@proxmox.com>

On 15.04.22 09:28, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
>  pbs-api-types/src/datastore.rs | 5 +++++
>  src/api2/admin/datastore.rs    | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
> index 01e2319a..0fc5622e 100644
> --- a/pbs-api-types/src/datastore.rs
> +++ b/pbs-api-types/src/datastore.rs
> @@ -330,6 +330,9 @@ impl DataStoreConfig {
>              optional: true,
>              schema: SINGLE_LINE_COMMENT_SCHEMA,
>          },
> +        maintenance: {
> +            type: bool,
> +        }
>      },
>  )]
>  #[derive(Serialize, Deserialize)]
> @@ -338,6 +341,8 @@ impl DataStoreConfig {
>  pub struct DataStoreListItem {
>      pub store: String,
>      pub comment: Option<String>,
> +    /// The datastore is in maintenance mode
> +    pub maintenance: bool,

In addition to Fabians comment w.r.t. to keeping this backward compatible I'd also return
the message string, we already got it anyway and an API user can show that too then (e.g.,
tooltip in the nav.tree), like:

#[serde(skip_serializing_if = "Option::is_none")]
pub maintenance: Option <String>,

(String should be replaced with the specific maintenance mdoe type, if any.)

>  }
>  
>  #[api(
> diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
> index ce5bd244..22bce40d 100644
> --- a/src/api2/admin/datastore.rs
> +++ b/src/api2/admin/datastore.rs
> @@ -1084,6 +1084,7 @@ pub fn get_datastore_list(
>                  DataStoreListItem {
>                      store: store.clone(),
>                      comment: data["comment"].as_str().map(String::from),
> +                    maintenance: data.get("maintenance-mode").is_some(),
>                  }
>              );
>          }





  parent reply	other threads:[~2022-04-25  6:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15  7:28 [pbs-devel] [PATCH proxmox-backup 0/4] improve ui for maintenance mode Hannes Laimer
2022-04-15  7:28 ` [pbs-devel] [PATCH proxmox-backup 1/4] ui: add summary mask when in " Hannes Laimer
2022-04-25  6:27   ` Thomas Lamprecht
2022-04-15  7:28 ` [pbs-devel] [PATCH proxmox-backup 2/4] api2: DataStoreListItem add maintenance info Hannes Laimer
2022-04-19 11:19   ` Fabian Grünbichler
2022-04-25  6:31   ` Thomas Lamprecht [this message]
2022-04-15  7:28 ` [pbs-devel] [PATCH proxmox-backup 3/4] ui: update icon in datastore list when in maintenance mode Hannes Laimer
2022-04-15  7:28 ` [pbs-devel] [PATCH proxmox-backup 4/4][optional] ui: update datastore list more often Hannes Laimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9fa602a9-b3db-9a23-c909-303f318d7b32@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=h.laimer@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal