REST Resource: projects.alerts

Resource: Alert

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.

JSON representation
 { 
 "name" 
 : 
 string 
 , 
 "state" 
 : 
 enum (  State 
 
) 
 , 
 "openTime" 
 : 
 string 
 , 
 "closeTime" 
 : 
 string 
 , 
 "resource" 
 : 
 { 
 object (  MonitoredResource 
 
) 
 } 
 , 
 "metadata" 
 : 
 { 
 object (  MonitoredResourceMetadata 
 
) 
 } 
 , 
 "metric" 
 : 
 { 
 object (  Metric 
 
) 
 } 
 , 
 "log" 
 : 
 { 
 object (  LogMetadata 
 
) 
 } 
 , 
 "policy" 
 : 
 { 
 object (  PolicySnapshot 
 
) 
 } 
 } 
Fields
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.

state

enum ( State )

Output only. The current state of the alert.

openTime

string ( Timestamp format)

The time when the alert was opened.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30" .

closeTime

string ( Timestamp format)

The time when the alert was closed.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30" .

resource

object ( MonitoredResource )

The monitored resource type and any monitored resource labels preserved from the incident's generating condition.

metric

object ( Metric )

The metric type and any metric labels preserved from the incident's generating condition.

log

object ( LogMetadata )

The log information associated with the alert. This field is only populated for log-based alerts.

policy

object ( PolicySnapshot )

The snapshot of the alert policy that generated this alert.

State

The enumeration of possible states for an alert.

Enums
STATE_UNSPECIFIED The alert state is unspecified.
OPEN The alert is open.
CLOSED The alert is closed.

Metric

A specific metric, identified by specifying values for all of the labels of a MetricDescriptor .

JSON representation
 { 
 "type" 
 : 
 string 
 , 
 "labels" 
 : 
 { 
 string 
 : 
 string 
 , 
 ... 
 } 
 } 
Fields
type

string

An existing metric type, see google.api.MetricDescriptor . For example, custom.googleapis.com/invoice/paid/amount .

labels

map (key: string, value: string)

The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.

PolicySnapshot

The state of the policy at the time the alert was generated.

JSON representation
 { 
 "name" 
 : 
 string 
 , 
 "displayName" 
 : 
 string 
 , 
 "severity" 
 : 
 enum (  Severity 
 
) 
 , 
 "userLabels" 
 : 
 { 
 string 
 : 
 string 
 , 
 ... 
 } 
 } 
Fields
name

string

The name of the alert policy resource. In the form of "projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]".

displayName

string

The display name of the alert policy.

severity

enum ( Severity )

The severity of the alert policy.

userLabels

map (key: string, value: string)

The user labels for the alert policy.

Methods

get

Gets a single alert.

list

Lists the existing alerts for the metrics scope of the project.
Design a Mobile Site
View Site in Mobile | Classic
Share by: