Class: Google::Apis::MonitoringV3::Alert

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_timeString

The time when the alert was closed. Corresponds to the JSON property closeTime

Returns:

  • (String)


127
128
129
# File 'lib/google/apis/monitoring_v3/classes.rb', line 127

def close_time
  @close_time
end

#logGoogle::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

#metadataGoogle::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

#metricGoogle::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

#nameString

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

Returns:

  • (String)


154
155
156
# File 'lib/google/apis/monitoring_v3/classes.rb', line 154

def name
  @name
end

#open_timeString

The time when the alert was opened. Corresponds to the JSON property openTime

Returns:

  • (String)


159
160
161
# File 'lib/google/apis/monitoring_v3/classes.rb', line 159

def open_time
  @open_time
end

#policyGoogle::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

#resourceGoogle::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

#stateString

Output only. The current state of the alert. Corresponds to the JSON property state

Returns:

  • (String)


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