From 86c68ad50aa62c0ddac8933bff9f6afa1636db73 Mon Sep 17 00:00:00 2001 From: Indigo Bosworth Date: Wed, 12 Jun 2024 13:47:31 +0100 Subject: [PATCH] update/alert.v1: Add time based debouncing fields to Rule Added SuppressFor (Duration) field to the Rule struct within the alert api. This field is used for optional time based debouncing of a rule and rate limiting. Suppress For represents the amount of time after being last triggered that a rule should be prevented from triggering again. Change-Id: I366090c7e2fd92d6887d8118682c1e59f54cc653 --- arista/alert.v1/alert-changelog.yaml | 5 ++++ arista/alert.v1/alert.proto | 3 +++ arista/alert.v1/services.gen.swagger.json | 30 +++-------------------- 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/arista/alert.v1/alert-changelog.yaml b/arista/alert.v1/alert-changelog.yaml index 296a4de7..3ce49dff 100644 --- a/arista/alert.v1/alert-changelog.yaml +++ b/arista/alert.v1/alert-changelog.yaml @@ -7,6 +7,11 @@ # New entries go on top. Changes: + - date: 2024-06-12 + description: Update Rule struct with debouncing field + version: 1.9.1 + onprem: true + cvaas: true - date: 2024-05-09 description: Update GetSome, SetSome, DeleteSome REST endpoints version: 1.9.0 diff --git a/arista/alert.v1/alert.proto b/arista/alert.v1/alert.proto index 85d7bafb..df735798 100644 --- a/arista/alert.v1/alert.proto +++ b/arista/alert.v1/alert.proto @@ -9,6 +9,7 @@ package arista.alert.v1; option go_package = "github.com/aristanetworks/cloudvision-go/api/arista/alert.v1;alert"; import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; import "fmp/extensions.proto"; @@ -584,6 +585,8 @@ message Rule { google.protobuf.BoolValue continue_checks = 3; // comment is a comment to include that will be displayed in the alert google.protobuf.StringValue comment = 4; + // suppress_for is a time duration that a rule will be debounced for after being called + google.protobuf.Duration suppress_for = 5; } // Matches is a set of restrictions that must be satisfied for a rule to be matched diff --git a/arista/alert.v1/services.gen.swagger.json b/arista/alert.v1/services.gen.swagger.json index e0338ccb..4b791fe0 100644 --- a/arista/alert.v1/services.gen.swagger.json +++ b/arista/alert.v1/services.gen.swagger.json @@ -1373,19 +1373,6 @@ }, "title": "Alert is the current status of the alert system" }, - "arista.alert.v1.AlertBatchedStreamResponse": { - "type": "object", - "properties": { - "responses": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/arista.alert.v1.AlertStreamResponse" - }, - "description": "Values are the values deemed relevant to the initiating request.\nThe length of this structure is guaranteed to be between (inclusive) 1 and \nmin(req.max_messages, INTERNAL_BATCH_LIMIT)." - } - } - }, "arista.alert.v1.AlertConfig": { "type": "object", "properties": { @@ -1404,19 +1391,6 @@ }, "title": "AlertConfig is the configuration for sending alerts" }, - "arista.alert.v1.AlertConfigBatchedStreamResponse": { - "type": "object", - "properties": { - "responses": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/arista.alert.v1.AlertConfigStreamResponse" - }, - "description": "Values are the values deemed relevant to the initiating request.\nThe length of this structure is guaranteed to be between (inclusive) 1 and \nmin(req.max_messages, INTERNAL_BATCH_LIMIT)." - } - } - }, "arista.alert.v1.AlertConfigResponse": { "type": "object", "properties": { @@ -2534,6 +2508,10 @@ "comment": { "type": "string", "title": "comment is a comment to include that will be displayed in the alert" + }, + "suppressFor": { + "type": "string", + "title": "suppress_for is a time duration that a rule will be debounced for after being called" } }, "title": "Rule is a rule to send to a certain broadcast group"