Close httplib2 connections.
Gets a single alert.
list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists the existing alerts for the metrics scope of the project.
Retrieves the next page of results.
close()
Close httplib2 connections.
get(name, x__xgafv=None)
Gets a single alert.
Args:
name: string, Required. 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. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # 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.
"closeTime": "A String", # The time when the alert was closed.
"log": { # Information about the log for log-based alerts. # The log information associated with the alert. This field is only populated for log-based alerts.
"extractedLabels": { # The labels extracted from the log.
"a_key": "A String",
},
},
"metadata": { # 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. # The metadata of the monitored resource.
"systemLabels": { # Output only. Values for predefined system metadata labels. System labels are a kind of metadata extracted by Google, including "machine_image", "vpc", "subnet_id", "security_group", "name", etc. System label values can be only strings, Boolean values, or a list of strings. For example: { "name": "my-test-instance", "security_group": ["a", "b", "c"], "spot_instance": false }
"a_key": "", # Properties of the object.
},
"userLabels": { # Output only. A map of user-defined metadata labels.
"a_key": "A String",
},
},
"metric": { # A specific metric, identified by specifying values for all of the labels of a MetricDescriptor. # The metric type and any metric labels preserved from the incident's generating condition.
"labels": { # The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.
"a_key": "A String",
},
"type": "A String", # An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount.
},
"name": "A 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.
"openTime": "A String", # The time when the alert was opened.
"policy": { # The state of the policy at the time the alert was generated. # The snapshot of the alert policy that generated this alert.
"displayName": "A String", # The display name of the alert policy.
"name": "A String", # The name of the alert policy resource. In the form of "projects/PROJECT_ID_OR_NUMBER/alertPolicies/ALERT_POLICY_ID".
"severity": "A String", # The severity of the alert policy.
"userLabels": { # The user labels for the alert policy.
"a_key": "A String",
},
},
"resource": { # 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" }} # The monitored resource type and any monitored resource labels preserved from the incident's generating condition.
"labels": { # Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels "project_id", "instance_id", and "zone".
"a_key": "A String",
},
"type": "A String", # Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance. For a list of types, see Monitoring resource types (https://cloud.google.com/monitoring/api/resources) and Logging resource types (https://cloud.google.com/logging/docs/api/v2/resource-list).
},
"state": "A String", # Output only. The current state of the alert.
}
list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists the existing alerts for the metrics scope of the project.
Args:
parent: string, Required. The name of the project to list alerts for. (required)
filter: string, Optional. An alert is returned if there is a match on any fields belonging to the alert or its subfields.
orderBy: string, Optional. A comma-separated list of fields in Alert to use for sorting. The default sort direction is ascending. To specify descending order for a field, add a desc modifier. The following fields are supported: open_time close_timeFor example, close_time desc, open_time will return the alerts closed most recently, with ties broken in the order of older alerts listed first.If the field is not set, the results are sorted by open_time desc.
pageSize: integer, Optional. The maximum number of results to return in a single response. If not set to a positive number, at most 50 alerts will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
pageToken: string, Optional. If non-empty, page_token must contain a value returned as the next_page_token in a previous response to request the next set of results.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # The ListAlerts response.
"alerts": [ # The list of alerts.
{ # 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.
"closeTime": "A String", # The time when the alert was closed.
"log": { # Information about the log for log-based alerts. # The log information associated with the alert. This field is only populated for log-based alerts.
"extractedLabels": { # The labels extracted from the log.
"a_key": "A String",
},
},
"metadata": { # 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. # The metadata of the monitored resource.
"systemLabels": { # Output only. Values for predefined system metadata labels. System labels are a kind of metadata extracted by Google, including "machine_image", "vpc", "subnet_id", "security_group", "name", etc. System label values can be only strings, Boolean values, or a list of strings. For example: { "name": "my-test-instance", "security_group": ["a", "b", "c"], "spot_instance": false }
"a_key": "", # Properties of the object.
},
"userLabels": { # Output only. A map of user-defined metadata labels.
"a_key": "A String",
},
},
"metric": { # A specific metric, identified by specifying values for all of the labels of a MetricDescriptor. # The metric type and any metric labels preserved from the incident's generating condition.
"labels": { # The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.
"a_key": "A String",
},
"type": "A String", # An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount.
},
"name": "A 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.
"openTime": "A String", # The time when the alert was opened.
"policy": { # The state of the policy at the time the alert was generated. # The snapshot of the alert policy that generated this alert.
"displayName": "A String", # The display name of the alert policy.
"name": "A String", # The name of the alert policy resource. In the form of "projects/PROJECT_ID_OR_NUMBER/alertPolicies/ALERT_POLICY_ID".
"severity": "A String", # The severity of the alert policy.
"userLabels": { # The user labels for the alert policy.
"a_key": "A String",
},
},
"resource": { # 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" }} # The monitored resource type and any monitored resource labels preserved from the incident's generating condition.
"labels": { # Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels "project_id", "instance_id", and "zone".
"a_key": "A String",
},
"type": "A String", # Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance. For a list of types, see Monitoring resource types (https://cloud.google.com/monitoring/api/resources) and Logging resource types (https://cloud.google.com/logging/docs/api/v2/resource-list).
},
"state": "A String", # Output only. The current state of the alert.
},
],
"nextPageToken": "A String", # If not empty, indicates that there may be more results that match the request. Use the value in the page_token field in a subsequent request to fetch the next set of results. The token is encrypted and only guaranteed to return correct results for 72 hours after it is created. If empty, all results have been returned.
"totalSize": 42, # The estimated total number of matching results for this query.
}
list_next()
Retrieves the next page of results.
Args:
previous_request: The request for the previous page. (required)
previous_response: The response from the request for the previous page. (required)
Returns:
A request object that you can call 'execute()' on to request the next
page. Returns None if there are no more items in the collection.