[PATCH proxmox v7 07/34] s3-client: api-types: define request counter thresholds

Christian Ebner
2026-04-01T13:48:15Z

These will be used in the datastore config as property string to
allow setting per-request/traffic volume notification thresholds.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Reviewed-by: Hannes Laimer <h.laimer@proxmox.com>
Tested-by: Hannes Laimer <h.laimer@proxmox.com>
---
proxmox-s3-client/src/api_types.rs | 59 ++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)

diff --git a/proxmox-s3-client/src/api_types.rs b/proxmox-s3-client/src/api_types.rs
index b4fc24e0..217bee11 100644
--- a/proxmox-s3-client/src/api_types.rs
+++ b/proxmox-s3-client/src/api_types.rs
@@ -257,3 +257,62 @@ pub struct S3BucketListItem {
/// S3 bucket name.
pub name: String,
}
+
+#[api(
+ properties: {
+ "s3-get": {
+ type: Integer,
+ optional: true,
+ },
+ "s3-put": {
+ type: Integer,
+ optional: true,
+ },
+ "s3-post": {
+ type: Integer,
+ optional: true,
+ },
+ "s3-head": {
+ type: Integer,
+ optional: true,
+ },
+ "s3-delete": {
+ type: Integer,
+ optional: true,
+ },
+ "s3-upload": {
+ type: HumanByte,
+ optional: true,
+ },
+ "s3-download": {
+ type: HumanByte,
+ optional: true,
+ }
+ },
+)]
+#[derive(Default, Deserialize, Serialize)]
+#[serde(rename_all = "kebab-case")]
+/// Request counter thresholds
+pub struct RequestCounterThresholds {
+ #[serde(skip_serializing_if = "Option::is_none")]
+ /// Threshold for GET requests.
+ pub s3_get: Option<u64>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ /// Threshold for PUT requests.
+ pub s3_put: Option<u64>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ /// Threshold for POST requests.
+ pub s3_post: Option<u64>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ /// Threshold for HEAD requests.
+ pub s3_head: Option<u64>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ /// Threshold for DELETE requests.
+ pub s3_delete: Option<u64>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ /// Threshold for upload traffic to datastore's backing S3 bucket.
+ pub s3_upload: Option<HumanByte>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ /// Threshold for download traffic to datastore's backing S3 bucket.
+ pub s3_download: Option<HumanByte>,
+}
--
2.47.3