xref: /aosp_15_r20/external/googleapis/google/monitoring/v3/snooze.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.monitoring.v3;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/monitoring/v3/common.proto";
22
23option csharp_namespace = "Google.Cloud.Monitoring.V3";
24option go_package = "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb";
25option java_multiple_files = true;
26option java_outer_classname = "SnoozeProto";
27option java_package = "com.google.monitoring.v3";
28option php_namespace = "Google\\Cloud\\Monitoring\\V3";
29option ruby_package = "Google::Cloud::Monitoring::V3";
30
31// A `Snooze` will prevent any alerts from being opened, and close any that
32// are already open. The `Snooze` will work on alerts that match the
33// criteria defined in the `Snooze`. The `Snooze` will be active from
34// `interval.start_time` through `interval.end_time`.
35message Snooze {
36  option (google.api.resource) = {
37    type: "monitoring.googleapis.com/Snooze"
38    pattern: "projects/{project}/snoozes/{snooze}"
39  };
40
41  // Criteria specific to the `AlertPolicy`s that this `Snooze` applies to. The
42  // `Snooze` will suppress alerts that come from one of the `AlertPolicy`s
43  // whose names are supplied.
44  message Criteria {
45    // The specific `AlertPolicy` names for the alert that should be snoozed.
46    // The format is:
47    //
48    //     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]
49    //
50    // There is a limit of 16 policies per snooze. This limit is checked during
51    // snooze creation.
52    repeated string policies = 1 [(google.api.resource_reference) = {
53      type: "monitoring.googleapis.com/AlertPolicy"
54    }];
55  }
56
57  // Required. The name of the `Snooze`. The format is:
58  //
59  //     projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID]
60  //
61  // The ID of the `Snooze` will be generated by the system.
62  string name = 1 [(google.api.field_behavior) = REQUIRED];
63
64  // Required. This defines the criteria for applying the `Snooze`. See
65  // `Criteria` for more information.
66  Criteria criteria = 3 [(google.api.field_behavior) = REQUIRED];
67
68  // Required. The `Snooze` will be active from `interval.start_time` through
69  // `interval.end_time`.
70  // `interval.start_time` cannot be in the past. There is a 15 second clock
71  // skew to account for the time it takes for a request to reach the API from
72  // the UI.
73  TimeInterval interval = 4 [(google.api.field_behavior) = REQUIRED];
74
75  // Required. A display name for the `Snooze`. This can be, at most, 512
76  // unicode characters.
77  string display_name = 5 [(google.api.field_behavior) = REQUIRED];
78}
79