Class: Google::Apis::MonitoringV3::Alert
- Inherits:
-
Object
- Object
- Google::Apis::MonitoringV3::Alert
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/monitoring_v3/classes.rb,
lib/google/apis/monitoring_v3/representations.rb,
lib/google/apis/monitoring_v3/representations.rb
Overview
An alert is the representation of a violation of an alert policy. It is a read- only resource that cannot be modified by the accompanied API.
Instance Attribute Summary collapse
-
#close_time ⇒ String
The time when the alert was closed.
-
#log ⇒ Google::Apis::MonitoringV3::LogMetadata
Information about the log for log-based alerts.
-
#metadata ⇒ Google::Apis::MonitoringV3::MonitoredResourceMetadata
Auxiliary metadata for a MonitoredResource object.
-
#metric ⇒ Google::Apis::MonitoringV3::Metric
A specific metric, identified by specifying values for all of the labels of a MetricDescriptor.
-
#name ⇒ String
Identifier.
-
#open_time ⇒ String
The time when the alert was opened.
-
#policy ⇒ Google::Apis::MonitoringV3::PolicySnapshot
The state of the policy at the time the alert was generated.
-
#resource ⇒ Google::Apis::MonitoringV3::MonitoredResource
An object representing a resource that can be used for monitoring, logging, billing, or other purposes.
-
#state ⇒ String
Output only.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Alert
constructor
A new instance of Alert.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Alert
Returns a new instance of Alert.
185 186 187 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 185 def initialize(**args) update!(**args) end |
Instance Attribute Details
#close_time ⇒ String
The time when the alert was closed.
Corresponds to the JSON property closeTime
127 128 129 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 127 def close_time @close_time end |
#log ⇒ Google::Apis::MonitoringV3::LogMetadata
Information about the log for log-based alerts.
Corresponds to the JSON property log
132 133 134 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 132 def log @log end |
#metadata ⇒ Google::Apis::MonitoringV3::MonitoredResourceMetadata
Auxiliary metadata for a MonitoredResource object. MonitoredResource objects
contain the minimum set of information to uniquely identify a monitored
resource instance. There is some other useful auxiliary metadata. Monitoring
and Logging use an ingestion pipeline to extract metadata for cloud resources
of all types, and store the metadata in this message.
Corresponds to the JSON property metadata
141 142 143 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 141 def @metadata end |
#metric ⇒ Google::Apis::MonitoringV3::Metric
A specific metric, identified by specifying values for all of the labels of a
MetricDescriptor.
Corresponds to the JSON property metric
147 148 149 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 147 def metric @metric end |
#name ⇒ String
Identifier. The name of the alert.The format is: projects/[
PROJECT_ID_OR_NUMBER]/alerts/[ALERT_ID] The [ALERT_ID] is a system-assigned
unique identifier for the alert.
Corresponds to the JSON property name
154 155 156 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 154 def name @name end |
#open_time ⇒ String
The time when the alert was opened.
Corresponds to the JSON property openTime
159 160 161 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 159 def open_time @open_time end |
#policy ⇒ Google::Apis::MonitoringV3::PolicySnapshot
The state of the policy at the time the alert was generated.
Corresponds to the JSON property policy
164 165 166 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 164 def policy @policy end |
#resource ⇒ Google::Apis::MonitoringV3::MonitoredResource
An object representing a resource that can be used for monitoring, logging,
billing, or other purposes. Examples include virtual machine instances,
databases, and storage devices such as disks. The type field identifies a
MonitoredResourceDescriptor object that describes the resource's schema.
Information in the labels field identifies the actual resource and its
attributes according to the schema. For example, a particular Compute Engine
VM instance could be represented by the following object, because the
MonitoredResourceDescriptor for "gce_instance" has labels "project_id", "
instance_id" and "zone": "type": "gce_instance", "labels": "project_id": "
my-project", "instance_id": "12345678901234", "zone": "us-central1-a" `
Corresponds to the JSON propertyresource`
178 179 180 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 178 def resource @resource end |
#state ⇒ String
Output only. The current state of the alert.
Corresponds to the JSON property state
183 184 185 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 183 def state @state end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 190 def update!(**args) @close_time = args[:close_time] if args.key?(:close_time) @log = args[:log] if args.key?(:log) @metadata = args[:metadata] if args.key?(:metadata) @metric = args[:metric] if args.key?(:metric) @name = args[:name] if args.key?(:name) @open_time = args[:open_time] if args.key?(:open_time) @policy = args[:policy] if args.key?(:policy) @resource = args[:resource] if args.key?(:resource) @state = args[:state] if args.key?(:state) end |