public abstract class AlertPolicyServiceClient
Reference documentation and code samples for the Google Cloud Monitoring v3 API class AlertPolicyServiceClient.
AlertPolicyService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Monitoring.V3Assembly
Google.Cloud.Monitoring.V3.dll
Remarks
The AlertPolicyService API is used to manage (list, create, delete, edit) alert policies in Cloud Monitoring. An alerting policy is a description of the conditions under which some aspect of your system is considered to be "unhealthy" and the ways to notify people or services about this state. In addition to using this API, alert policies can also be managed through Cloud Monitoring, which can be reached by clicking the "Monitoring" tab in Cloud console.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the AlertPolicyService service, which is a host of "monitoring.googleapis.com" and a port of 443.
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default AlertPolicyService scopes.
Type | Description |
IReadOnlyList<String> |
The default AlertPolicyService scopes are:
GrpcClient
public virtual AlertPolicyService.AlertPolicyServiceClient GrpcClient { get; }
The underlying gRPC AlertPolicyService client
Type | Description |
AlertPolicyService.AlertPolicyServiceClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Type | Description |
ServiceMetadata |
Methods
Create()
public static AlertPolicyServiceClient Create()
Synchronously creates a AlertPolicyServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AlertPolicyServiceClientBuilder .
Type | Description |
AlertPolicyServiceClient | The created AlertPolicyServiceClient. |
CreateAlertPolicy(IResourceName, AlertPolicy, CallSettings)
public virtual AlertPolicy CreateAlertPolicy(IResourceName name, AlertPolicy alertPolicy, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
name | IResourceName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
AlertPolicy | The RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.Create();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = alertPolicyServiceClient.CreateAlertPolicy(name, alertPolicy);
CreateAlertPolicy(FolderName, AlertPolicy, CallSettings)
public virtual AlertPolicy CreateAlertPolicy(FolderName name, AlertPolicy alertPolicy, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
name | FolderName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
AlertPolicy | The RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.Create();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = alertPolicyServiceClient.CreateAlertPolicy(name, alertPolicy);
CreateAlertPolicy(OrganizationName, AlertPolicy, CallSettings)
public virtual AlertPolicy CreateAlertPolicy(OrganizationName name, AlertPolicy alertPolicy, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
name | OrganizationName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
AlertPolicy | The RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.Create();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = alertPolicyServiceClient.CreateAlertPolicy(name, alertPolicy);
CreateAlertPolicy(ProjectName, AlertPolicy, CallSettings)
public virtual AlertPolicy CreateAlertPolicy(ProjectName name, AlertPolicy alertPolicy, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
name | ProjectName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
AlertPolicy | The RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.Create();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = alertPolicyServiceClient.CreateAlertPolicy(name, alertPolicy);
CreateAlertPolicy(CreateAlertPolicyRequest, CallSettings)
public virtual AlertPolicy CreateAlertPolicy(CreateAlertPolicyRequest request, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
request | CreateAlertPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
AlertPolicy | The RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.Create();
// Initialize request argument(s)
CreateAlertPolicyRequest request = new CreateAlertPolicyRequest
{
AlertPolicy = new AlertPolicy(),
ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
AlertPolicy response = alertPolicyServiceClient.CreateAlertPolicy(request);
CreateAlertPolicy(String, AlertPolicy, CallSettings)
public virtual AlertPolicy CreateAlertPolicy(string name, AlertPolicy alertPolicy, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
name | String Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
AlertPolicy | The RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = alertPolicyServiceClient.CreateAlertPolicy(name, alertPolicy);
CreateAlertPolicyAsync(IResourceName, AlertPolicy, CallSettings)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(IResourceName name, AlertPolicy alertPolicy, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
name | IResourceName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(name, alertPolicy);
CreateAlertPolicyAsync(IResourceName, AlertPolicy, CancellationToken)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(IResourceName name, AlertPolicy alertPolicy, CancellationToken cancellationToken)
Creates a new alerting policy.
Name | Description |
name | IResourceName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(name, alertPolicy);
CreateAlertPolicyAsync(FolderName, AlertPolicy, CallSettings)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(FolderName name, AlertPolicy alertPolicy, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
name | FolderName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(name, alertPolicy);
CreateAlertPolicyAsync(FolderName, AlertPolicy, CancellationToken)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(FolderName name, AlertPolicy alertPolicy, CancellationToken cancellationToken)
Creates a new alerting policy.
Name | Description |
name | FolderName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(name, alertPolicy);
CreateAlertPolicyAsync(OrganizationName, AlertPolicy, CallSettings)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(OrganizationName name, AlertPolicy alertPolicy, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
name | OrganizationName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(name, alertPolicy);
CreateAlertPolicyAsync(OrganizationName, AlertPolicy, CancellationToken)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(OrganizationName name, AlertPolicy alertPolicy, CancellationToken cancellationToken)
Creates a new alerting policy.
Name | Description |
name | OrganizationName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(name, alertPolicy);
CreateAlertPolicyAsync(ProjectName, AlertPolicy, CallSettings)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(ProjectName name, AlertPolicy alertPolicy, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
name | ProjectName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(name, alertPolicy);
CreateAlertPolicyAsync(ProjectName, AlertPolicy, CancellationToken)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(ProjectName name, AlertPolicy alertPolicy, CancellationToken cancellationToken)
Creates a new alerting policy.
Name | Description |
name | ProjectName Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(name, alertPolicy);
CreateAlertPolicyAsync(CreateAlertPolicyRequest, CallSettings)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(CreateAlertPolicyRequest request, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
request | CreateAlertPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAlertPolicyRequest request = new CreateAlertPolicyRequest
{
AlertPolicy = new AlertPolicy(),
ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(request);
CreateAlertPolicyAsync(CreateAlertPolicyRequest, CancellationToken)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(CreateAlertPolicyRequest request, CancellationToken cancellationToken)
Creates a new alerting policy.
Name | Description |
request | CreateAlertPolicyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAlertPolicyRequest request = new CreateAlertPolicyRequest
{
AlertPolicy = new AlertPolicy(),
ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(request);
CreateAlertPolicyAsync(String, AlertPolicy, CallSettings)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(string name, AlertPolicy alertPolicy, CallSettings callSettings = null)
Creates a new alerting policy.
Name | Description |
name | String Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(name, alertPolicy);
CreateAlertPolicyAsync(String, AlertPolicy, CancellationToken)
public virtual Task<AlertPolicy> CreateAlertPolicyAsync(string name, AlertPolicy alertPolicy, CancellationToken cancellationToken)
Creates a new alerting policy.
Name | Description |
name | String Required. The project 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 |
alertPolicy | AlertPolicy Required. The requested alerting policy. You should omit the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<AlertPolicy> | A Task containing the RPC response. |
// Create client
AlertPolicyServiceClient alertPolicyServiceClient = await AlertPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
AlertPolicy alertPolicy = new AlertPolicy();
// Make the request
AlertPolicy response = await alertPolicyServiceClient.CreateAlertPolicyAsync(name, alertPolicy);
CreateAsync(CancellationToken)
public static Task<AlertPolicyServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a AlertPolicyServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AlertPolicyServiceClientBuilder .
Name |