From: Dietmar Maurer <dietmar@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v3 2/3] maintenance: derive Copy for maintenance type and make maintainance mode fields public
Date: Mon, 22 Apr 2024 10:00:38 +0200 [thread overview]
Message-ID: <20240422080039.2902734-3-dietmar@proxmox.com> (raw)
In-Reply-To: <20240422080039.2902734-1-dietmar@proxmox.com>
Because it is a public api type.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
---
pbs-api-types/src/maintenance.rs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/pbs-api-types/src/maintenance.rs b/pbs-api-types/src/maintenance.rs
index a605cc17..068df2a7 100644
--- a/pbs-api-types/src/maintenance.rs
+++ b/pbs-api-types/src/maintenance.rs
@@ -33,12 +33,11 @@ pub enum Operation {
}
#[api]
-#[derive(Deserialize, Serialize, PartialEq, Eq)]
+#[derive(Copy, Clone, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
/// Maintenance type.
pub enum MaintenanceType {
// TODO:
- // - Add "unmounting" once we got pluggable datastores
// - Add "GarbageCollection" or "DeleteOnly" as type and track GC (or all deletes) as separate
// operation, so that one can enable a mode where nothing new can be added but stuff can be
// cleaned
@@ -69,11 +68,11 @@ serde_plain::derive_fromstr_from_deserialize!(MaintenanceType);
pub struct MaintenanceMode {
/// Type of maintenance ("read-only" or "offline").
#[serde(rename = "type")]
- ty: MaintenanceType,
+ pub ty: MaintenanceType,
/// Reason for maintenance.
#[serde(skip_serializing_if = "Option::is_none")]
- message: Option<String>,
+ pub message: Option<String>,
}
impl MaintenanceMode {
--
2.39.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2024-04-22 8:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-22 8:00 [pbs-devel] [PATCH proxmox-backup v3 0/3] pbs-api-types: new MaintenanceType::Unmount, implement and use set_maintenance_mode Dietmar Maurer
2024-04-22 8:00 ` [pbs-devel] [PATCH proxmox-backup v3 1/3] pbs-api-types: use SchemaDeserializer for maintenance mode Dietmar Maurer
2024-04-22 8:00 ` Dietmar Maurer [this message]
2024-04-22 8:00 ` [pbs-devel] [PATCH proxmox-backup v3 3/3] api: assert that maintenance mode transitions are valid Dietmar Maurer
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=20240422080039.2902734-3-dietmar@proxmox.com \
--to=dietmar@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