Compute Engine v1 API - Class InstanceSettingsServiceClient (2.17.0)

public abstract class InstanceSettingsServiceClient

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

InstanceSettingsService client wrapper, for convenient use.

Inheritance

object > InstanceSettingsServiceClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The InstanceSettings API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the InstanceSettingsService 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 InstanceSettingsService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual InstanceSettingsService.InstanceSettingsServiceClient GrpcClient { get; }

The underlying gRPC InstanceSettingsService client

Property Value
Type Description
InstanceSettingsServiceInstanceSettingsServiceClient

PatchOperationsClient

public virtual OperationsClient PatchOperationsClient { get; }

The long-running operations client for Patch.

Property Value
Type Description
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static InstanceSettingsServiceClient Create()

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

Returns
Type Description
InstanceSettingsServiceClient

The created InstanceSettingsServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskInstanceSettingsServiceClient

The task representing the created InstanceSettingsServiceClient.

Get(GetInstanceSettingRequest, CallSettings)

public virtual InstanceSettings Get(GetInstanceSettingRequest request, CallSettings callSettings = null)

Get Instance settings.

Parameters
Name Description
request GetInstanceSettingRequest

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
InstanceSettings

The RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = InstanceSettingsServiceClient.Create();
// Initialize request argument(s)
GetInstanceSettingRequest request = new GetInstanceSettingRequest
{
    Zone = "",
    Project = "",
};
// Make the request
InstanceSettings response = instanceSettingsServiceClient.Get(request);

Get(string, string, CallSettings)

public virtual InstanceSettings Get(string project, string zone, CallSettings callSettings = null)

Get Instance settings.

Parameters
Name Description
project string

Project ID for this request.

zone string

Name of the zone for this request.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
InstanceSettings

The RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = InstanceSettingsServiceClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
// Make the request
InstanceSettings response = instanceSettingsServiceClient.Get(project, zone);

GetAsync(GetInstanceSettingRequest, CallSettings)

public virtual Task<InstanceSettings> GetAsync(GetInstanceSettingRequest request, CallSettings callSettings = null)

Get Instance settings.

Parameters
Name Description
request GetInstanceSettingRequest

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
TaskInstanceSettings

A Task containing the RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = await InstanceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
GetInstanceSettingRequest request = new GetInstanceSettingRequest
{
    Zone = "",
    Project = "",
};
// Make the request
InstanceSettings response = await instanceSettingsServiceClient.GetAsync(request);

GetAsync(GetInstanceSettingRequest, CancellationToken)

public virtual Task<InstanceSettings> GetAsync(GetInstanceSettingRequest request, CancellationToken cancellationToken)

Get Instance settings.

Parameters
Name Description
request GetInstanceSettingRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskInstanceSettings

A Task containing the RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = await InstanceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
GetInstanceSettingRequest request = new GetInstanceSettingRequest
{
    Zone = "",
    Project = "",
};
// Make the request
InstanceSettings response = await instanceSettingsServiceClient.GetAsync(request);

GetAsync(string, string, CallSettings)

public virtual Task<InstanceSettings> GetAsync(string project, string zone, CallSettings callSettings = null)

Get Instance settings.

Parameters
Name Description
project string

Project ID for this request.

zone string

Name of the zone for this request.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskInstanceSettings

A Task containing the RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = await InstanceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
// Make the request
InstanceSettings response = await instanceSettingsServiceClient.GetAsync(project, zone);

GetAsync(string, string, CancellationToken)

public virtual Task<InstanceSettings> GetAsync(string project, string zone, CancellationToken cancellationToken)

Get Instance settings.

Parameters
Name Description
project string

Project ID for this request.

zone string

Name of the zone for this request.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskInstanceSettings

A Task containing the RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = await InstanceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
// Make the request
InstanceSettings response = await instanceSettingsServiceClient.GetAsync(project, zone);

Patch(PatchInstanceSettingRequest, CallSettings)

public virtual Operation<Operation, Operation> Patch(PatchInstanceSettingRequest request, CallSettings callSettings = null)

Patch Instance settings

Parameters
Name Description
request PatchInstanceSettingRequest

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
OperationOperationOperation

The RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = InstanceSettingsServiceClient.Create();
// Initialize request argument(s)
PatchInstanceSettingRequest request = new PatchInstanceSettingRequest
{
    Zone = "",
    RequestId = "",
    Project = "",
    InstanceSettingsResource = new InstanceSettings(),
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = instanceSettingsServiceClient.Patch(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = instanceSettingsServiceClient.PollOncePatch(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

Patch(string, string, InstanceSettings, CallSettings)

public virtual Operation<Operation, Operation> Patch(string project, string zone, InstanceSettings instanceSettingsResource, CallSettings callSettings = null)

Patch Instance settings

Parameters
Name Description
project string

Project ID for this request.

zone string

The zone scoping this request. It should conform to RFC1035.

instanceSettingsResource InstanceSettings

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = InstanceSettingsServiceClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
InstanceSettings instanceSettingsResource = new InstanceSettings();
// Make the request
lro::Operation<Operation, Operation> response = instanceSettingsServiceClient.Patch(project, zone, instanceSettingsResource);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = instanceSettingsServiceClient.PollOncePatch(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

PatchAsync(PatchInstanceSettingRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchAsync(PatchInstanceSettingRequest request, CallSettings callSettings = null)

Patch Instance settings

Parameters
Name Description
request PatchInstanceSettingRequest

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
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = await InstanceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
PatchInstanceSettingRequest request = new PatchInstanceSettingRequest
{
    Zone = "",
    RequestId = "",
    Project = "",
    InstanceSettingsResource = new InstanceSettings(),
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await instanceSettingsServiceClient.PatchAsync(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await instanceSettingsServiceClient.PollOncePatchAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

PatchAsync(PatchInstanceSettingRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchAsync(PatchInstanceSettingRequest request, CancellationToken cancellationToken)

Patch Instance settings

Parameters
Name Description
request PatchInstanceSettingRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = await InstanceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
PatchInstanceSettingRequest request = new PatchInstanceSettingRequest
{
    Zone = "",
    RequestId = "",
    Project = "",
    InstanceSettingsResource = new InstanceSettings(),
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await instanceSettingsServiceClient.PatchAsync(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await instanceSettingsServiceClient.PollOncePatchAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

PatchAsync(string, string, InstanceSettings, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchAsync(string project, string zone, InstanceSettings instanceSettingsResource, CallSettings callSettings = null)

Patch Instance settings

Parameters
Name Description
project string

Project ID for this request.

zone string

The zone scoping this request. It should conform to RFC1035.

instanceSettingsResource InstanceSettings

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = await InstanceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
InstanceSettings instanceSettingsResource = new InstanceSettings();
// Make the request
lro::Operation<Operation, Operation> response = await instanceSettingsServiceClient.PatchAsync(project, zone, instanceSettingsResource);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await instanceSettingsServiceClient.PollOncePatchAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

PatchAsync(string, string, InstanceSettings, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchAsync(string project, string zone, InstanceSettings instanceSettingsResource, CancellationToken cancellationToken)

Patch Instance settings

Parameters
Name Description
project string

Project ID for this request.

zone string

The zone scoping this request. It should conform to RFC1035.

instanceSettingsResource InstanceSettings

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
InstanceSettingsServiceClient instanceSettingsServiceClient = await InstanceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
InstanceSettings instanceSettingsResource = new InstanceSettings();
// Make the request
lro::Operation<Operation, Operation> response = await instanceSettingsServiceClient.PatchAsync(project, zone, instanceSettingsResource);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await instanceSettingsServiceClient.PollOncePatchAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

PollOncePatch(string, CallSettings)

public virtual Operation<Operation, Operation> PollOncePatch(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of Patch.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The result of polling the operation.

PollOncePatchAsync(string, CallSettings)

public virtual Task<Operation<Operation, Operation>> PollOncePatchAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of Patch .

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A task representing the result of polling the operation.

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.