@@ -116,6 +116,90 @@ def update!(**args)
116116 end
117117 end
118118
119+ # An alert is the representation of a violation of an alert policy. It is a read-
120+ # only resource that cannot be modified by the accompanied API.
121+ class Alert
122+ include Google ::Apis ::Core ::Hashable
123+
124+ # The time when the alert was closed.
125+ # Corresponds to the JSON property `closeTime`
126+ # @return [String]
127+ attr_accessor :close_time
128+
129+ # Information about the log for log-based alerts.
130+ # Corresponds to the JSON property `log`
131+ # @return [Google::Apis::MonitoringV3::LogMetadata]
132+ attr_accessor :log
133+
134+ # Auxiliary metadata for a MonitoredResource object. MonitoredResource objects
135+ # contain the minimum set of information to uniquely identify a monitored
136+ # resource instance. There is some other useful auxiliary metadata. Monitoring
137+ # and Logging use an ingestion pipeline to extract metadata for cloud resources
138+ # of all types, and store the metadata in this message.
139+ # Corresponds to the JSON property `metadata`
140+ # @return [Google::Apis::MonitoringV3::MonitoredResourceMetadata]
141+ attr_accessor :metadata
142+
143+ # A specific metric, identified by specifying values for all of the labels of a
144+ # MetricDescriptor.
145+ # Corresponds to the JSON property `metric`
146+ # @return [Google::Apis::MonitoringV3::Metric]
147+ attr_accessor :metric
148+
149+ # Identifier. The name of the alert.The format is: projects/[
150+ # PROJECT_ID_OR_NUMBER]/alerts/[ALERT_ID] The [ALERT_ID] is a system-assigned
151+ # unique identifier for the alert.
152+ # Corresponds to the JSON property `name`
153+ # @return [String]
154+ attr_accessor :name
155+
156+ # The time when the alert was opened.
157+ # Corresponds to the JSON property `openTime`
158+ # @return [String]
159+ attr_accessor :open_time
160+
161+ # The state of the policy at the time the alert was generated.
162+ # Corresponds to the JSON property `policy`
163+ # @return [Google::Apis::MonitoringV3::PolicySnapshot]
164+ attr_accessor :policy
165+
166+ # An object representing a resource that can be used for monitoring, logging,
167+ # billing, or other purposes. Examples include virtual machine instances,
168+ # databases, and storage devices such as disks. The type field identifies a
169+ # MonitoredResourceDescriptor object that describes the resource's schema.
170+ # Information in the labels field identifies the actual resource and its
171+ # attributes according to the schema. For example, a particular Compute Engine
172+ # VM instance could be represented by the following object, because the
173+ # MonitoredResourceDescriptor for "gce_instance" has labels "project_id", "
174+ # instance_id" and "zone": ` "type": "gce_instance", "labels": ` "project_id": "
175+ # my-project", "instance_id": "12345678901234", "zone": "us-central1-a" ``
176+ # Corresponds to the JSON property `resource`
177+ # @return [Google::Apis::MonitoringV3::MonitoredResource]
178+ attr_accessor :resource
179+
180+ # Output only. The current state of the alert.
181+ # Corresponds to the JSON property `state`
182+ # @return [String]
183+ attr_accessor :state
184+
185+ def initialize ( **args )
186+ update! ( **args )
187+ end
188+
189+ # Update properties of this object
190+ def update! ( **args )
191+ @close_time = args [ :close_time ] if args . key? ( :close_time )
192+ @log = args [ :log ] if args . key? ( :log )
193+ @metadata = args [ :metadata ] if args . key? ( :metadata )
194+ @metric = args [ :metric ] if args . key? ( :metric )
195+ @name = args [ :name ] if args . key? ( :name )
196+ @open_time = args [ :open_time ] if args . key? ( :open_time )
197+ @policy = args [ :policy ] if args . key? ( :policy )
198+ @resource = args [ :resource ] if args . key? ( :resource )
199+ @state = args [ :state ] if args . key? ( :state )
200+ end
201+ end
202+
119203 # A description of the conditions under which some aspect of your system is
120204 # considered to be "unhealthy" and the ways to notify people or services about
121205 # this state. For an overview of alerting policies, see Introduction to Alerting
@@ -2407,6 +2491,41 @@ def update!(**args)
24072491 end
24082492 end
24092493
2494+ # The ListAlerts response.
2495+ class ListAlertsResponse
2496+ include Google ::Apis ::Core ::Hashable
2497+
2498+ # The list of alerts.
2499+ # Corresponds to the JSON property `alerts`
2500+ # @return [Array<Google::Apis::MonitoringV3::Alert>]
2501+ attr_accessor :alerts
2502+
2503+ # If not empty, indicates that there may be more results that match the request.
2504+ # Use the value in the page_token field in a subsequent request to fetch the
2505+ # next set of results. The token is encrypted and only guaranteed to return
2506+ # correct results for 72 hours after it is created. If empty, all results have
2507+ # been returned.
2508+ # Corresponds to the JSON property `nextPageToken`
2509+ # @return [String]
2510+ attr_accessor :next_page_token
2511+
2512+ # The estimated total number of matching results for this query.
2513+ # Corresponds to the JSON property `totalSize`
2514+ # @return [Fixnum]
2515+ attr_accessor :total_size
2516+
2517+ def initialize ( **args )
2518+ update! ( **args )
2519+ end
2520+
2521+ # Update properties of this object
2522+ def update! ( **args )
2523+ @alerts = args [ :alerts ] if args . key? ( :alerts )
2524+ @next_page_token = args [ :next_page_token ] if args . key? ( :next_page_token )
2525+ @total_size = args [ :total_size ] if args . key? ( :total_size )
2526+ end
2527+ end
2528+
24102529 # The ListGroupMembers response.
24112530 class ListGroupMembersResponse
24122531 include Google ::Apis ::Core ::Hashable
@@ -2819,6 +2938,25 @@ def update!(**args)
28192938 end
28202939 end
28212940
2941+ # Information about the log for log-based alerts.
2942+ class LogMetadata
2943+ include Google ::Apis ::Core ::Hashable
2944+
2945+ # The labels extracted from the log.
2946+ # Corresponds to the JSON property `extractedLabels`
2947+ # @return [Hash<String,String>]
2948+ attr_accessor :extracted_labels
2949+
2950+ def initialize ( **args )
2951+ update! ( **args )
2952+ end
2953+
2954+ # Update properties of this object
2955+ def update! ( **args )
2956+ @extracted_labels = args [ :extracted_labels ] if args . key? ( :extracted_labels )
2957+ end
2958+ end
2959+
28222960 # Istio service scoped to an Istio mesh. Anthos clusters running ASM < 1.6.8
28232961 # will have their services ingested as this type.
28242962 class MeshIstio
@@ -3958,6 +4096,44 @@ def update!(**args)
39584096 end
39594097 end
39604098
4099+ # The state of the policy at the time the alert was generated.
4100+ class PolicySnapshot
4101+ include Google ::Apis ::Core ::Hashable
4102+
4103+ # The display name of the alert policy.
4104+ # Corresponds to the JSON property `displayName`
4105+ # @return [String]
4106+ attr_accessor :display_name
4107+
4108+ # The name of the alert policy resource. In the form of "projects/
4109+ # PROJECT_ID_OR_NUMBER/alertPolicies/ALERT_POLICY_ID".
4110+ # Corresponds to the JSON property `name`
4111+ # @return [String]
4112+ attr_accessor :name
4113+
4114+ # The severity of the alert policy.
4115+ # Corresponds to the JSON property `severity`
4116+ # @return [String]
4117+ attr_accessor :severity
4118+
4119+ # The user labels for the alert policy.
4120+ # Corresponds to the JSON property `userLabels`
4121+ # @return [Hash<String,String>]
4122+ attr_accessor :user_labels
4123+
4124+ def initialize ( **args )
4125+ update! ( **args )
4126+ end
4127+
4128+ # Update properties of this object
4129+ def update! ( **args )
4130+ @display_name = args [ :display_name ] if args . key? ( :display_name )
4131+ @name = args [ :name ] if args . key? ( :name )
4132+ @severity = args [ :severity ] if args . key? ( :severity )
4133+ @user_labels = args [ :user_labels ] if args . key? ( :user_labels )
4134+ end
4135+ end
4136+
39614137 # A condition type that allows alerting policies to be defined using Prometheus
39624138 # Query Language (PromQL) (https://prometheus.io/docs/prometheus/latest/querying/
39634139 # basics/).The PrometheusQueryLanguageCondition message contains information
0 commit comments