Service Client: Google::Monitoring::V3::AlertService::AlertPolicyServiceClient
Client stub representing the remote AlertPolicyService gRPC service. Delegates call dispatching to Google::gRPC::Client.
target
The endpoint target address. Defaults to monitoring.googleapis.com:443.
credentials
The authentication credentials provider. Defaults to application default credentials via Google::Auth.
NAME
Google::Monitoring::V3::AlertService - Compiled Protocol Buffers messages for google/monitoring/v3/alert_service.proto
SYNOPSIS
use Google::Monitoring::V3::AlertService;
my $msg = Google::Monitoring::V3::AlertService::CreateAlertPolicyRequest->new({
name => $name,
alert_policy => $alert_policy,
});
# Read or update a field
my $val = $msg->name();
# Binary wire-format roundtrip
my $bytes = $msg->serialize();
my $decoded = Google::Monitoring::V3::AlertService::CreateAlertPolicyRequest->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/monitoring/v3/alert_service.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().
MESSAGES
Google::Monitoring::V3::AlertService::CreateAlertPolicyRequest
The protocol for the `CreateAlertPolicy` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in which to create the alerting policy. The format is:
projects/[PROJECT_ID_OR_NUMBER]Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. |name| must be a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will return. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the container.
$msg->alert_policy()/$msg->alert_policy($value)Type:
Message(Google::Monitoring::V3::Alert::AlertPolicy)Required. The requested alerting policy. You should omit the `name` field in this policy. The name will be returned in the new policy, including a new `[ALERT_POLICY_ID]` value.
Google::Monitoring::V3::AlertService::GetAlertPolicyRequest
The protocol for the `GetAlertPolicy` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. The alerting policy to retrieve. The format is:
projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
Google::Monitoring::V3::AlertService::ListAlertPoliciesRequest
The protocol for the `ListAlertPolicies` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. The [project](https://cloud.google.com/monitoring/api/v3#project_name) whose alert policies are to be listed. The format is:
projects/[PROJECT_ID_OR_NUMBER]Note that this field names the parent container in which the alerting policies to be listed are stored. To retrieve a single alerting policy by name, use the [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy] operation, instead.
$msg->filter()/$msg->filter($value)Type:
StringOptional. If provided, this field specifies the criteria that must be met by alert policies to be included in the response.
For more details, see [sorting and filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
$msg->order_by()/$msg->order_by($value)Type:
StringOptional. A comma-separated list of fields by which to sort the result. Supports the same set of field references as the `filter` field. Entries can be prefixed with a minus sign to sort by the field in descending order.
For more details, see [sorting and filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
$msg->page_size()/$msg->page_size($value)Type:
Int32Optional. The maximum number of results to return in a single response.
$msg->page_token()/$msg->page_token($value)Type:
StringOptional. If this field is not empty then it must contain the `nextPageToken` value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call.
Google::Monitoring::V3::AlertService::ListAlertPoliciesResponse
The protocol for the `ListAlertPolicies` response.
Inherits from Protobuf::Message.
Accessors
$msg->alert_policies()/$msg->alert_policies($value)Type:
Message(Google::Monitoring::V3::Alert::AlertPolicy)The returned alert policies.
$msg->next_page_token()/$msg->next_page_token($value)Type:
StringIf there might be more results than were returned, then this field is set to a non-empty value. To see the additional results, use that value as `page_token` in the next call to this method.
$msg->total_size()/$msg->total_size($value)Type:
Int32The total number of alert policies in all pages. This number is only an estimate, and may change in subsequent pages. https://aip.dev/158
Google::Monitoring::V3::AlertService::UpdateAlertPolicyRequest
The protocol for the `UpdateAlertPolicy` request.
Inherits from Protobuf::Message.
Accessors
$msg->update_mask()/$msg->update_mask($value)Type:
Message(Google::Protobuf::FieldMask::FieldMask)Optional. A list of alerting policy field names. If this field is not empty, each listed field in the existing alerting policy is set to the value of the corresponding field in the supplied policy (`alert_policy`), or to the field's default value if the field is not in the supplied alerting policy. Fields not listed retain their previous value.
Examples of valid field masks include `display_name`, `documentation`, `documentation.content`, `documentation.mime_type`, `user_labels`, `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc.
If this field is empty, then the supplied alerting policy replaces the existing policy. It is the same as deleting the existing policy and adding the supplied policy, except for the following:
+ The new policy will have the same `[ALERT_POLICY_ID]` as the former policy. This gives you continuity with the former policy in your notifications and incidents. + Conditions in the new policy will keep their former `[CONDITION_ID]` if the supplied condition includes the `name` field with that `[CONDITION_ID]`. If the supplied condition omits the `name` field, then a new `[CONDITION_ID]` is created.
$msg->alert_policy()/$msg->alert_policy($value)Type:
Message(Google::Monitoring::V3::Alert::AlertPolicy)Required. The updated alerting policy or the updated values for the fields listed in `update_mask`. If `update_mask` is not empty, any fields in this policy that are not in `update_mask` are ignored.
Google::Monitoring::V3::AlertService::DeleteAlertPolicyRequest
The protocol for the `DeleteAlertPolicy` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. The alerting policy to delete. The format is:
projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy].
SEE ALSO
Protobuf, Protobuf::Message, Google::Monitoring::V3::AlertService::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.