Google Cloud Monitoring v3 API - Class SnoozeServiceClient (3.3.0)

public abstract class SnoozeServiceClient

Reference documentation and code samples for the Google Cloud Monitoring v3 API class SnoozeServiceClient.

SnoozeService client wrapper, for convenient use.

Inheritance

object > SnoozeServiceClient

Derived Types

Namespace

Google.Cloud.Monitoring.V3

Assembly

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
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default SnoozeService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

GrpcClient

public virtual SnoozeService.SnoozeServiceClient GrpcClient { get; }

The underlying gRPC SnoozeService client

Property Value
TypeDescription
SnoozeServiceSnoozeServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
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
TypeDescription
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
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
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
NameDescription
parentProjectName

Required. The project in which a Snooze should be created. The format is:

projects/[PROJECT_ID_OR_NUMBER]

snoozeSnooze

Required. The Snooze to create. Omit the name field, as it will be filled in by the API.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Snooze

The RPC response.

Example
// 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
NameDescription
requestCreateSnoozeRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Snooze

The RPC response.

Example
// 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
NameDescription
parentstring

Required. The project in which a Snooze should be created. The format is:

projects/[PROJECT_ID_OR_NUMBER]

snoozeSnooze

Required. The Snooze to create. Omit the name field, as it will be filled in by the API.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Snooze

The RPC response.

Example
// 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
NameDescription
parentProjectName

Required. The project in which a Snooze should be created. The format is:

projects/[PROJECT_ID_OR_NUMBER]

snoozeSnooze

Required. The Snooze to create. Omit the name field, as it will be filled in by the API.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSnooze

A Task containing the RPC response.

Example
// 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
NameDescription
parentProjectName

Required. The project in which a Snooze should be created. The format is:

projects/[PROJECT_ID_OR_NUMBER]

snoozeSnooze

Required. The Snooze to create. Omit the name field, as it will be filled in by the API.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSnooze

A Task containing the RPC response.

Example
// 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
NameDescription
requestCreateSnoozeRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSnooze

A Task containing the RPC response.

Example
// 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
NameDescription
requestCreateSnoozeRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSnooze

A Task containing the RPC response.

Example
// 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
NameDescription
parentstring

Required. The project in which a Snooze should be created. The format is:

projects/[PROJECT_ID_OR_NUMBER]

snoozeSnooze

Required. The Snooze to create. Omit the name field, as it will be filled in by the API.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSnooze

A Task containing the RPC response.

Example
// 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
NameDescription
parentstring

Required. The project in which a Snooze should be created. The format is:

projects/[PROJECT_ID_OR_NUMBER]

snoozeSnooze

Required. The Snooze to create. Omit the name field, as it will be filled in by the API.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSnooze

A Task containing the RPC response.

Example
// 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
NameDescription
requestGetSnoozeRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Snooze

The RPC response.

Example
// 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
NameDescription
nameSnoozeName

Required. The ID of the Snooze to retrieve. The format is:

projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID]

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Snooze

The RPC response.

Example
// 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
NameDescription
namestring

Required. The ID of the Snooze to retrieve. The format is:

projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID]

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Snooze

The RPC response.

Example
// 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
NameDescription
requestGetSnoozeRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSnooze

A Task containing the RPC response.

Example
// 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
NameDescription
requestGetSnoozeRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSnooze

A Task containing the RPC response.

Example
// 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
NameDescription
nameSnoozeName

Required. The ID of the Snooze to retrieve. The format is:

projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID]

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSnooze

A Task containing the RPC response.

Example
// 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
NameDescription
name