public abstract class SnoozeServiceClient
Reference documentation and code samples for the Google Cloud Monitoring v3 API class SnoozeServiceClient.
SnoozeService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Monitoring.V3Assembly
Google.Cloud.Monitoring.V3.dll
Remarks
The SnoozeService API is used to temporarily prevent an alert policy from generating alerts. A Snooze is a description of the criteria under which one or more alert policies should not fire alerts for the specified duration.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the SnoozeService service, which is a host of "monitoring.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default SnoozeService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default SnoozeService scopes are:
GrpcClient
public virtual SnoozeService.SnoozeServiceClient GrpcClient { get; }
The underlying gRPC SnoozeService client
Property Value | |
---|---|
Type | Description |
SnoozeServiceSnoozeServiceClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
Methods
Create()
public static SnoozeServiceClient Create()
Synchronously creates a SnoozeServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SnoozeServiceClientBuilder.
Returns | |
---|---|
Type | Description |
SnoozeServiceClient | The created SnoozeServiceClient. |
CreateAsync(CancellationToken)
public static Task<SnoozeServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a SnoozeServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SnoozeServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskSnoozeServiceClient | The task representing the created SnoozeServiceClient. |
CreateSnooze(ProjectName, Snooze, CallSettings)
public virtual Snooze CreateSnooze(ProjectName parent, Snooze snooze, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Snooze snooze = new Snooze();
// Make the request
Snooze response = snoozeServiceClient.CreateSnooze(parent, snooze);
CreateSnooze(CreateSnoozeRequest, CallSettings)
public virtual Snooze CreateSnooze(CreateSnoozeRequest request, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
request | CreateSnoozeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
CreateSnoozeRequest request = new CreateSnoozeRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Snooze = new Snooze(),
};
// Make the request
Snooze response = snoozeServiceClient.CreateSnooze(request);
CreateSnooze(string, Snooze, CallSettings)
public virtual Snooze CreateSnooze(string parent, Snooze snooze, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | string Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Snooze snooze = new Snooze();
// Make the request
Snooze response = snoozeServiceClient.CreateSnooze(parent, snooze);
CreateSnoozeAsync(ProjectName, Snooze, CallSettings)
public virtual Task<Snooze> CreateSnoozeAsync(ProjectName parent, Snooze snooze, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSnooze | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Snooze snooze = new Snooze();
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(parent, snooze);
CreateSnoozeAsync(ProjectName, Snooze, CancellationToken)
public virtual Task<Snooze> CreateSnoozeAsync(ProjectName parent, Snooze snooze, CancellationToken cancellationToken)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSnooze | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Snooze snooze = new Snooze();
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(parent, snooze);
CreateSnoozeAsync(CreateSnoozeRequest, CallSettings)
public virtual Task<Snooze> CreateSnoozeAsync(CreateSnoozeRequest request, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
request | CreateSnoozeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSnooze | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSnoozeRequest request = new CreateSnoozeRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Snooze = new Snooze(),
};
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(request);
CreateSnoozeAsync(CreateSnoozeRequest, CancellationToken)
public virtual Task<Snooze> CreateSnoozeAsync(CreateSnoozeRequest request, CancellationToken cancellationToken)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
request | CreateSnoozeRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSnooze | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSnoozeRequest request = new CreateSnoozeRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Snooze = new Snooze(),
};
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(request);
CreateSnoozeAsync(string, Snooze, CallSettings)
public virtual Task<Snooze> CreateSnoozeAsync(string parent, Snooze snooze, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | string Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSnooze | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Snooze snooze = new Snooze();
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(parent, snooze);
CreateSnoozeAsync(string, Snooze, CancellationToken)
public virtual Task<Snooze> CreateSnoozeAsync(string parent, Snooze snooze, CancellationToken cancellationToken)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | string Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSnooze | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Snooze snooze = new Snooze();
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(parent, snooze);
GetSnooze(GetSnoozeRequest, CallSettings)
public virtual Snooze GetSnooze(GetSnoozeRequest request, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
request | GetSnoozeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
GetSnoozeRequest request = new GetSnoozeRequest
{
SnoozeName = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]"),
};
// Make the request
Snooze response = snoozeServiceClient.GetSnooze(request);
GetSnooze(SnoozeName, CallSettings)
public virtual Snooze GetSnooze(SnoozeName name, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
name | SnoozeName Required. The ID of the projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
SnoozeName name = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]");
// Make the request
Snooze response = snoozeServiceClient.GetSnooze(name);
GetSnooze(string, CallSettings)
public virtual Snooze GetSnooze(string name, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
name | string Required. The ID of the projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/snoozes/[SNOOZE]";
// Make the request
Snooze response = snoozeServiceClient.GetSnooze(name);
GetSnoozeAsync(GetSnoozeRequest, CallSettings)
public virtual Task<Snooze> GetSnoozeAsync(GetSnoozeRequest request, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
request | GetSnoozeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSnooze | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
GetSnoozeRequest request = new GetSnoozeRequest
{
SnoozeName = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]"),
};
// Make the request
Snooze response = await snoozeServiceClient.GetSnoozeAsync(request);
GetSnoozeAsync(GetSnoozeRequest, CancellationToken)
public virtual Task<Snooze> GetSnoozeAsync(GetSnoozeRequest request, CancellationToken cancellationToken)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
request | GetSnoozeRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSnooze | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
GetSnoozeRequest request = new GetSnoozeRequest
{
SnoozeName = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]"),
};
// Make the request
Snooze response = await snoozeServiceClient.GetSnoozeAsync(request);
GetSnoozeAsync(SnoozeName, CallSettings)
public virtual Task<Snooze> GetSnoozeAsync(SnoozeName name, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
name | SnoozeName Required. The ID of the projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSnooze | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
SnoozeName name = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]");
// Make the request
Snooze response = await snoozeServiceClient.GetSnoozeAsync(name);
GetSnoozeAsync(SnoozeName, CancellationToken)
public virtual Task<Snooze> GetSnoozeAsync(SnoozeName name, CancellationToken cancellationToken)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
name |
|