Compute Engine v1 API - Class AdviceClient (3.22.0)

public abstract class AdviceClient

Reference documentation and code samples for the Compute Engine v1 API class AdviceClient.

Advice client wrapper, for convenient use.

Inheritance

object > AdviceClient

Derived Types

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The Advice API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the Advice service, which is a host of "compute.googleapis.com" and a port of 443.

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Advice scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual Advice.AdviceClient GrpcClient { get; }

The underlying gRPC Advice client

Property Value
Type Description
AdviceAdviceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

CalendarMode(CalendarModeAdviceRpcRequest, CallSettings)

public virtual CalendarModeAdviceResponse CalendarMode(CalendarModeAdviceRpcRequest request, CallSettings callSettings = null)

Advise how, where and when to create the requested amount of instances with specified accelerators, within the specified time and location limits. The method recommends creating future reservations for the requested resources.

Parameters
Name Description
request CalendarModeAdviceRpcRequest

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
CalendarModeAdviceResponse

The RPC response.

Example
// Create client
AdviceClient adviceClient = AdviceClient.Create();
// Initialize request argument(s)
CalendarModeAdviceRpcRequest request = new CalendarModeAdviceRpcRequest
{
    Region = "",
    CalendarModeAdviceRequestResource = new CalendarModeAdviceRequest(),
    Project = "",
};
// Make the request
CalendarModeAdviceResponse response = adviceClient.CalendarMode(request);

CalendarMode(string, string, CalendarModeAdviceRequest, CallSettings)

public virtual CalendarModeAdviceResponse CalendarMode(string project, string region, CalendarModeAdviceRequest calendarModeAdviceRequestResource, CallSettings callSettings = null)

Advise how, where and when to create the requested amount of instances with specified accelerators, within the specified time and location limits. The method recommends creating future reservations for the requested resources.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region for this request.

calendarModeAdviceRequestResource CalendarModeAdviceRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CalendarModeAdviceResponse

The RPC response.

Example
// Create client
AdviceClient adviceClient = AdviceClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
CalendarModeAdviceRequest calendarModeAdviceRequestResource = new CalendarModeAdviceRequest();
// Make the request
CalendarModeAdviceResponse response = adviceClient.CalendarMode(project, region, calendarModeAdviceRequestResource);

CalendarModeAsync(CalendarModeAdviceRpcRequest, CallSettings)

public virtual Task<CalendarModeAdviceResponse> CalendarModeAsync(CalendarModeAdviceRpcRequest request, CallSettings callSettings = null)

Advise how, where and when to create the requested amount of instances with specified accelerators, within the specified time and location limits. The method recommends creating future reservations for the requested resources.

Parameters
Name Description
request CalendarModeAdviceRpcRequest

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
TaskCalendarModeAdviceResponse

A Task containing the RPC response.

Example
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
CalendarModeAdviceRpcRequest request = new CalendarModeAdviceRpcRequest
{
    Region = "",
    CalendarModeAdviceRequestResource = new CalendarModeAdviceRequest(),
    Project = "",
};
// Make the request
CalendarModeAdviceResponse response = await adviceClient.CalendarModeAsync(request);

CalendarModeAsync(CalendarModeAdviceRpcRequest, CancellationToken)

public virtual Task<CalendarModeAdviceResponse> CalendarModeAsync(CalendarModeAdviceRpcRequest request, CancellationToken cancellationToken)

Advise how, where and when to create the requested amount of instances with specified accelerators, within the specified time and location limits. The method recommends creating future reservations for the requested resources.

Parameters
Name Description
request CalendarModeAdviceRpcRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskCalendarModeAdviceResponse

A Task containing the RPC response.

Example
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
CalendarModeAdviceRpcRequest request = new CalendarModeAdviceRpcRequest
{
    Region = "",
    CalendarModeAdviceRequestResource = new CalendarModeAdviceRequest(),
    Project = "",
};
// Make the request
CalendarModeAdviceResponse response = await adviceClient.CalendarModeAsync(request);

CalendarModeAsync(string, string, CalendarModeAdviceRequest, CallSettings)

public virtual Task<CalendarModeAdviceResponse> CalendarModeAsync(string project, string region, CalendarModeAdviceRequest calendarModeAdviceRequestResource, CallSettings callSettings = null)

Advise how, where and when to create the requested amount of instances with specified accelerators, within the specified time and location limits. The method recommends creating future reservations for the requested resources.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region for this request.

calendarModeAdviceRequestResource CalendarModeAdviceRequest

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCalendarModeAdviceResponse

A Task containing the RPC response.

Example
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
CalendarModeAdviceRequest calendarModeAdviceRequestResource = new CalendarModeAdviceRequest();
// Make the request
CalendarModeAdviceResponse response = await adviceClient.CalendarModeAsync(project, region, calendarModeAdviceRequestResource);

CalendarModeAsync(string, string, CalendarModeAdviceRequest, CancellationToken)

public virtual Task<CalendarModeAdviceResponse> CalendarModeAsync(string project, string region, CalendarModeAdviceRequest calendarModeAdviceRequestResource, CancellationToken cancellationToken)

Advise how, where and when to create the requested amount of instances with specified accelerators, within the specified time and location limits. The method recommends creating future reservations for the requested resources.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region for this request.

calendarModeAdviceRequestResource CalendarModeAdviceRequest

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskCalendarModeAdviceResponse

A Task containing the RPC response.

Example
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
CalendarModeAdviceRequest calendarModeAdviceRequestResource = new CalendarModeAdviceRequest();
// Make the request
CalendarModeAdviceResponse response = await adviceClient.CalendarModeAsync(project, region, calendarModeAdviceRequestResource);

Create()

public static AdviceClient Create()

Synchronously creates a AdviceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AdviceClientBuilder.

Returns
Type Description
AdviceClient

The created AdviceClient.

CreateAsync(CancellationToken)

public static Task<AdviceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a AdviceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AdviceClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskAdviceClient

The task representing the created AdviceClient.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.