public abstract class AdviceClientReference documentation and code samples for the Compute Engine v1 API class AdviceClient.
Advice client wrapper, for convenient use. This client implements API version 2026-09-01.
Derived Types
Namespace
Google.Cloud.Compute.V1Assembly
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 |
|
The default Advice scopes are:
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 |
CalendarModeAdviceRpcRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CalendarModeAdviceResponse |
The RPC response. |
// 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 |
stringProject ID for this request. |
region |
stringName of the region for this request. |
calendarModeAdviceRequestResource |
CalendarModeAdviceRequestThe body resource for this request |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CalendarModeAdviceResponse |
The RPC response. |
// 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 |
CalendarModeAdviceRpcRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCalendarModeAdviceResponse |
A Task containing the RPC response. |
// 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 |
CalendarModeAdviceRpcRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCalendarModeAdviceResponse |
A Task containing the RPC response. |
// 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 |
stringProject ID for this request. |
region |
stringName of the region for this request. |
calendarModeAdviceRequestResource |
CalendarModeAdviceRequestThe body resource for this request |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCalendarModeAdviceResponse |
A Task containing the RPC response. |
// 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 |
stringProject ID for this request. |
region |
stringName of the region for this request. |
calendarModeAdviceRequestResource |
CalendarModeAdviceRequestThe body resource for this request |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCalendarModeAdviceResponse |
A Task containing the RPC response. |
// 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);
Capacity(CapacityAdviceRpcRequest, CallSettings)
public virtual CapacityAdviceResponse Capacity(CapacityAdviceRpcRequest request, CallSettings callSettings = null)Advice on making real-time decisions (such as choosing zone or machine types) during deployment to maximize your chances of obtaining capacity.
| Parameters | |
|---|---|
| Name | Description |
request |
CapacityAdviceRpcRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CapacityAdviceResponse |
The RPC response. |
// Create client
AdviceClient adviceClient = AdviceClient.Create();
// Initialize request argument(s)
CapacityAdviceRpcRequest request = new CapacityAdviceRpcRequest
{
Region = "",
CapacityAdviceRequestResource = new CapacityAdviceRequest(),
Project = "",
};
// Make the request
CapacityAdviceResponse response = adviceClient.Capacity(request);
Capacity(string, string, CapacityAdviceRequest, CallSettings)
public virtual CapacityAdviceResponse Capacity(string project, string region, CapacityAdviceRequest capacityAdviceRequestResource, CallSettings callSettings = null)Advice on making real-time decisions (such as choosing zone or machine types) during deployment to maximize your chances of obtaining capacity.
| Parameters | |
|---|---|
| Name | Description |
project |
stringProject ID for this request. |
region |
stringName of the region for this request. |
capacityAdviceRequestResource |
CapacityAdviceRequestThe body resource for this request |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CapacityAdviceResponse |
The RPC response. |
// Create client
AdviceClient adviceClient = AdviceClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
CapacityAdviceRequest capacityAdviceRequestResource = new CapacityAdviceRequest();
// Make the request
CapacityAdviceResponse response = adviceClient.Capacity(project, region, capacityAdviceRequestResource);
CapacityAsync(CapacityAdviceRpcRequest, CallSettings)
public virtual Task<CapacityAdviceResponse> CapacityAsync(CapacityAdviceRpcRequest request, CallSettings callSettings = null)Advice on making real-time decisions (such as choosing zone or machine types) during deployment to maximize your chances of obtaining capacity.
| Parameters | |
|---|---|
| Name | Description |
request |
CapacityAdviceRpcRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCapacityAdviceResponse |
A Task containing the RPC response. |
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
CapacityAdviceRpcRequest request = new CapacityAdviceRpcRequest
{
Region = "",
CapacityAdviceRequestResource = new CapacityAdviceRequest(),
Project = "",
};
// Make the request
CapacityAdviceResponse response = await adviceClient.CapacityAsync(request);
CapacityAsync(CapacityAdviceRpcRequest, CancellationToken)
public virtual Task<CapacityAdviceResponse> CapacityAsync(CapacityAdviceRpcRequest request, CancellationToken cancellationToken)Advice on making real-time decisions (such as choosing zone or machine types) during deployment to maximize your chances of obtaining capacity.
| Parameters | |
|---|---|
| Name | Description |
request |
CapacityAdviceRpcRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCapacityAdviceResponse |
A Task containing the RPC response. |
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
CapacityAdviceRpcRequest request = new CapacityAdviceRpcRequest
{
Region = "",
CapacityAdviceRequestResource = new CapacityAdviceRequest(),
Project = "",
};
// Make the request
CapacityAdviceResponse response = await adviceClient.CapacityAsync(request);
CapacityAsync(string, string, CapacityAdviceRequest, CallSettings)
public virtual Task<CapacityAdviceResponse> CapacityAsync(string project, string region, CapacityAdviceRequest capacityAdviceRequestResource, CallSettings callSettings = null)Advice on making real-time decisions (such as choosing zone or machine types) during deployment to maximize your chances of obtaining capacity.
| Parameters | |
|---|---|
| Name | Description |
project |
stringProject ID for this request. |
region |
stringName of the region for this request. |
capacityAdviceRequestResource |
CapacityAdviceRequestThe body resource for this request |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCapacityAdviceResponse |
A Task containing the RPC response. |
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
CapacityAdviceRequest capacityAdviceRequestResource = new CapacityAdviceRequest();
// Make the request
CapacityAdviceResponse response = await adviceClient.CapacityAsync(project, region, capacityAdviceRequestResource);
CapacityAsync(string, string, CapacityAdviceRequest, CancellationToken)
public virtual Task<CapacityAdviceResponse> CapacityAsync(string project, string region, CapacityAdviceRequest capacityAdviceRequestResource, CancellationToken cancellationToken)Advice on making real-time decisions (such as choosing zone or machine types) during deployment to maximize your chances of obtaining capacity.
| Parameters | |
|---|---|
| Name | Description |
project |
stringProject ID for this request. |
region |
stringName of the region for this request. |
capacityAdviceRequestResource |
CapacityAdviceRequestThe body resource for this request |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCapacityAdviceResponse |
A Task containing the RPC response. |
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
CapacityAdviceRequest capacityAdviceRequestResource = new CapacityAdviceRequest();
// Make the request
CapacityAdviceResponse response = await adviceClient.CapacityAsync(project, region, capacityAdviceRequestResource);
CapacityHistory(CapacityHistoryAdviceRequest, CallSettings)
public virtual CapacityHistoryResponse CapacityHistory(CapacityHistoryAdviceRequest request, CallSettings callSettings = null)Gets the capacity history.
| Parameters | |
|---|---|
| Name | Description |
request |
CapacityHistoryAdviceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CapacityHistoryResponse |
The RPC response. |
// Create client
AdviceClient adviceClient = AdviceClient.Create();
// Initialize request argument(s)
CapacityHistoryAdviceRequest request = new CapacityHistoryAdviceRequest
{
Region = "",
CapacityHistoryRequestResource = new CapacityHistoryRequest(),
Project = "",
};
// Make the request
CapacityHistoryResponse response = adviceClient.CapacityHistory(request);
CapacityHistory(string, string, CapacityHistoryRequest, CallSettings)
public virtual CapacityHistoryResponse CapacityHistory(string project, string region, CapacityHistoryRequest capacityHistoryRequestResource, CallSettings callSettings = null)Gets the capacity history.
| Parameters | |
|---|---|
| Name | Description |
project |
stringProject ID for this request. |
region |
stringName of the region for this request. |
capacityHistoryRequestResource |
CapacityHistoryRequestThe body resource for this request |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CapacityHistoryResponse |
The RPC response. |
// Create client
AdviceClient adviceClient = AdviceClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
CapacityHistoryRequest capacityHistoryRequestResource = new CapacityHistoryRequest();
// Make the request
CapacityHistoryResponse response = adviceClient.CapacityHistory(project, region, capacityHistoryRequestResource);
CapacityHistoryAsync(CapacityHistoryAdviceRequest, CallSettings)
public virtual Task<CapacityHistoryResponse> CapacityHistoryAsync(CapacityHistoryAdviceRequest request, CallSettings callSettings = null)Gets the capacity history.
| Parameters | |
|---|---|
| Name | Description |
request |
CapacityHistoryAdviceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCapacityHistoryResponse |
A Task containing the RPC response. |
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
CapacityHistoryAdviceRequest request = new CapacityHistoryAdviceRequest
{
Region = "",
CapacityHistoryRequestResource = new CapacityHistoryRequest(),
Project = "",
};
// Make the request
CapacityHistoryResponse response = await adviceClient.CapacityHistoryAsync(request);
CapacityHistoryAsync(CapacityHistoryAdviceRequest, CancellationToken)
public virtual Task<CapacityHistoryResponse> CapacityHistoryAsync(CapacityHistoryAdviceRequest request, CancellationToken cancellationToken)Gets the capacity history.
| Parameters | |
|---|---|
| Name | Description |
request |
CapacityHistoryAdviceRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCapacityHistoryResponse |
A Task containing the RPC response. |
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
CapacityHistoryAdviceRequest request = new CapacityHistoryAdviceRequest
{
Region = "",
CapacityHistoryRequestResource = new CapacityHistoryRequest(),
Project = "",
};
// Make the request
CapacityHistoryResponse response = await adviceClient.CapacityHistoryAsync(request);
CapacityHistoryAsync(string, string, CapacityHistoryRequest, CallSettings)
public virtual Task<CapacityHistoryResponse> CapacityHistoryAsync(string project, string region, CapacityHistoryRequest capacityHistoryRequestResource, CallSettings callSettings = null)Gets the capacity history.
| Parameters | |
|---|---|
| Name | Description |
project |
stringProject ID for this request. |
region |
stringName of the region for this request. |
capacityHistoryRequestResource |
CapacityHistoryRequestThe body resource for this request |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCapacityHistoryResponse |
A Task containing the RPC response. |
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
CapacityHistoryRequest capacityHistoryRequestResource = new CapacityHistoryRequest();
// Make the request
CapacityHistoryResponse response = await adviceClient.CapacityHistoryAsync(project, region, capacityHistoryRequestResource);
CapacityHistoryAsync(string, string, CapacityHistoryRequest, CancellationToken)
public virtual Task<CapacityHistoryResponse> CapacityHistoryAsync(string project, string region, CapacityHistoryRequest capacityHistoryRequestResource, CancellationToken cancellationToken)Gets the capacity history.
| Parameters | |
|---|---|
| Name | Description |
project |
stringProject ID for this request. |
region |
stringName of the region for this request. |
capacityHistoryRequestResource |
CapacityHistoryRequestThe body resource for this request |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCapacityHistoryResponse |
A Task containing the RPC response. |
// Create client
AdviceClient adviceClient = await AdviceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
CapacityHistoryRequest capacityHistoryRequestResource = new CapacityHistoryRequest();
// Make the request
CapacityHistoryResponse response = await adviceClient.CapacityHistoryAsync(project, region, capacityHistoryRequestResource);
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 |
CancellationTokenThe 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. |
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.