Show / Hide Table of Contents

Class ProjectsResource.AlertPoliciesResource

The "alertPolicies" collection of methods.

Inheritance
object
ProjectsResource.AlertPoliciesResource
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Monitoring.v3
Assembly: Google.Apis.Monitoring.v3.dll
Syntax
public class ProjectsResource.AlertPoliciesResource

Constructors

AlertPoliciesResource(IClientService)

Constructs a new resource.

Declaration
public AlertPoliciesResource(IClientService service)
Parameters
Type Name Description
IClientService service

Methods

Create(AlertPolicy, string)

Creates a new alerting policy.Design your application to single-thread API calls that modify the state of alerting policies in a single project. This includes calls to CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy.

Declaration
public virtual ProjectsResource.AlertPoliciesResource.CreateRequest Create(AlertPolicy body, string name)
Parameters
Type Name Description
AlertPolicy body

The body of the request.

string name

Required. 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.

Returns
Type Description
ProjectsResource.AlertPoliciesResource.CreateRequest

Delete(string)

Deletes an alerting policy.Design your application to single-thread API calls that modify the state of alerting policies in a single project. This includes calls to CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy.

Declaration
public virtual ProjectsResource.AlertPoliciesResource.DeleteRequest Delete(string name)
Parameters
Type Name Description
string name

Required. The alerting policy to delete. The format is: projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] For more information, see AlertPolicy.

Returns
Type Description
ProjectsResource.AlertPoliciesResource.DeleteRequest

Get(string)

Gets a single alerting policy.

Declaration
public virtual ProjectsResource.AlertPoliciesResource.GetRequest Get(string name)
Parameters
Type Name Description
string name

Required. The alerting policy to retrieve. The format is: projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]

Returns
Type Description
ProjectsResource.AlertPoliciesResource.GetRequest

List(string)

Lists the existing alerting policies for the workspace.

Declaration
public virtual ProjectsResource.AlertPoliciesResource.ListRequest List(string name)
Parameters
Type Name Description
string name

Required. 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 operation, instead.

Returns
Type Description
ProjectsResource.AlertPoliciesResource.ListRequest

Patch(AlertPolicy, string)

Updates an alerting policy. You can either replace the entire policy with a new one or replace only certain fields in the current alerting policy by specifying the fields to be updated via updateMask. Returns the updated alerting policy.Design your application to single-thread API calls that modify the state of alerting policies in a single project. This includes calls to CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy.

Declaration
public virtual ProjectsResource.AlertPoliciesResource.PatchRequest Patch(AlertPolicy body, string name)
Parameters
Type Name Description
AlertPolicy body

The body of the request.

string name

Identifier. Required if the policy exists. The resource name for this policy. The format is: projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] [ALERT_POLICY_ID] is assigned by Cloud Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request.

Returns
Type Description
ProjectsResource.AlertPoliciesResource.PatchRequest
In this article
Back to top Generated by DocFX