Compute Engine v1 API - Class RegionInstanceTemplatesClient (2.13.0)

public abstract class RegionInstanceTemplatesClient

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

RegionInstanceTemplates client wrapper, for convenient use.

Inheritance

object > RegionInstanceTemplatesClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The RegionInstanceTemplates API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default RegionInstanceTemplates scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

DeleteOperationsClient

public virtual OperationsClient DeleteOperationsClient { get; }

The long-running operations client for Delete.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual RegionInstanceTemplates.RegionInstanceTemplatesClient GrpcClient { get; }

The underlying gRPC RegionInstanceTemplates client

Property Value
TypeDescription
RegionInstanceTemplatesRegionInstanceTemplatesClient

InsertOperationsClient

public virtual OperationsClient InsertOperationsClient { get; }

The long-running operations client for Insert.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static RegionInstanceTemplatesClient Create()

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

Returns
TypeDescription
RegionInstanceTemplatesClient

The created RegionInstanceTemplatesClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskRegionInstanceTemplatesClient

The task representing the created RegionInstanceTemplatesClient.

Delete(DeleteRegionInstanceTemplateRequest, CallSettings)

public virtual Operation<Operation, Operation> Delete(DeleteRegionInstanceTemplateRequest request, CallSettings callSettings = null)

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone.

Parameters
NameDescription
requestDeleteRegionInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = RegionInstanceTemplatesClient.Create();
// Initialize request argument(s)
DeleteRegionInstanceTemplateRequest request = new DeleteRegionInstanceTemplateRequest
{
    RequestId = "",
    Region = "",
    Project = "",
    InstanceTemplate = "",
};
// Make the request
lro::Operation<Operation, Operation> response = regionInstanceTemplatesClient.Delete(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 = regionInstanceTemplatesClient.PollOnceDelete(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;
}

Delete(string, string, string, CallSettings)

public virtual Operation<Operation, Operation> Delete(string project, string region, string instanceTemplate, CallSettings callSettings = null)

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the region for this request.

instanceTemplatestring

The name of the instance template to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = RegionInstanceTemplatesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceTemplate = "";
// Make the request
lro::Operation<Operation, Operation> response = regionInstanceTemplatesClient.Delete(project, region, instanceTemplate);

// 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 = regionInstanceTemplatesClient.PollOnceDelete(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;
}

DeleteAsync(DeleteRegionInstanceTemplateRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> DeleteAsync(DeleteRegionInstanceTemplateRequest request, CallSettings callSettings = null)

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone.

Parameters
NameDescription
requestDeleteRegionInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
DeleteRegionInstanceTemplateRequest request = new DeleteRegionInstanceTemplateRequest
{
    RequestId = "",
    Region = "",
    Project = "",
    InstanceTemplate = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceTemplatesClient.DeleteAsync(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 regionInstanceTemplatesClient.PollOnceDeleteAsync(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;
}

DeleteAsync(DeleteRegionInstanceTemplateRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> DeleteAsync(DeleteRegionInstanceTemplateRequest request, CancellationToken cancellationToken)

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone.

Parameters
NameDescription
requestDeleteRegionInstanceTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
DeleteRegionInstanceTemplateRequest request = new DeleteRegionInstanceTemplateRequest
{
    RequestId = "",
    Region = "",
    Project = "",
    InstanceTemplate = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceTemplatesClient.DeleteAsync(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 regionInstanceTemplatesClient.PollOnceDeleteAsync(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;
}

DeleteAsync(string, string, string, CallSettings)

public virtual Task<Operation<Operation, Operation>> DeleteAsync(string project, string region, string instanceTemplate, CallSettings callSettings = null)

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the region for this request.

instanceTemplatestring

The name of the instance template to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceTemplate = "";
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceTemplatesClient.DeleteAsync(project, region, instanceTemplate);

// 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 regionInstanceTemplatesClient.PollOnceDeleteAsync(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;
}

DeleteAsync(string, string, string, CancellationToken)

public virtual Task<Operation<Operation, Operation>> DeleteAsync(string project, string region, string instanceTemplate, CancellationToken cancellationToken)

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the region for this request.

instanceTemplatestring

The name of the instance template to delete.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceTemplate = "";
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceTemplatesClient.DeleteAsync(project, region, instanceTemplate);

// 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 regionInstanceTemplatesClient.PollOnceDeleteAsync(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;
}

Get(GetRegionInstanceTemplateRequest, CallSettings)

public virtual InstanceTemplate Get(GetRegionInstanceTemplateRequest request, CallSettings callSettings = null)

Returns the specified instance template.

Parameters
NameDescription
requestGetRegionInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
InstanceTemplate

The RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = RegionInstanceTemplatesClient.Create();
// Initialize request argument(s)
GetRegionInstanceTemplateRequest request = new GetRegionInstanceTemplateRequest
{
    Region = "",
    Project = "",
    InstanceTemplate = "",
};
// Make the request
InstanceTemplate response = regionInstanceTemplatesClient.Get(request);

Get(string, string, string, CallSettings)

public virtual InstanceTemplate Get(string project, string region, string instanceTemplate, CallSettings callSettings = null)

Returns the specified instance template.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the region for this request.

instanceTemplatestring

The name of the instance template.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
InstanceTemplate

The RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = RegionInstanceTemplatesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceTemplate = "";
// Make the request
InstanceTemplate response = regionInstanceTemplatesClient.Get(project, region, instanceTemplate);

GetAsync(GetRegionInstanceTemplateRequest, CallSettings)

public virtual Task<InstanceTemplate> GetAsync(GetRegionInstanceTemplateRequest request, CallSettings callSettings = null)

Returns the specified instance template.

Parameters
NameDescription
requestGetRegionInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskInstanceTemplate

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
GetRegionInstanceTemplateRequest request = new GetRegionInstanceTemplateRequest
{
    Region = "",
    Project = "",
    InstanceTemplate = "",
};
// Make the request
InstanceTemplate response = await regionInstanceTemplatesClient.GetAsync(request);

GetAsync(GetRegionInstanceTemplateRequest, CancellationToken)

public virtual Task<InstanceTemplate> GetAsync(GetRegionInstanceTemplateRequest request, CancellationToken cancellationToken)

Returns the specified instance template.

Parameters
NameDescription
requestGetRegionInstanceTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskInstanceTemplate

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
GetRegionInstanceTemplateRequest request = new GetRegionInstanceTemplateRequest
{
    Region = "",
    Project = "",
    InstanceTemplate = "",
};
// Make the request
InstanceTemplate response = await regionInstanceTemplatesClient.GetAsync(request);

GetAsync(string, string, string, CallSettings)

public virtual Task<InstanceTemplate> GetAsync(string project, string region, string instanceTemplate, CallSettings callSettings = null)

Returns the specified instance template.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the region for this request.

instanceTemplatestring

The name of the instance template.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskInstanceTemplate

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceTemplate = "";
// Make the request
InstanceTemplate response = await regionInstanceTemplatesClient.GetAsync(project, region, instanceTemplate);

GetAsync(string, string, string, CancellationToken)

public virtual Task<InstanceTemplate> GetAsync(string project, string region, string instanceTemplate, CancellationToken cancellationToken)

Returns the specified instance template.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the region for this request.

instanceTemplatestring

The name of the instance template.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskInstanceTemplate

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceTemplate = "";
// Make the request
InstanceTemplate response = await regionInstanceTemplatesClient.GetAsync(project, region, instanceTemplate);

Insert(InsertRegionInstanceTemplateRequest, CallSettings)

public virtual Operation<Operation, Operation> Insert(InsertRegionInstanceTemplateRequest request, CallSettings callSettings = null)

Creates an instance template in the specified project and region using the global instance template whose URL is included in the request.

Parameters
NameDescription
requestInsertRegionInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = RegionInstanceTemplatesClient.Create();
// Initialize request argument(s)
InsertRegionInstanceTemplateRequest request = new InsertRegionInstanceTemplateRequest
{
    InstanceTemplateResource = new InstanceTemplate(),
    RequestId = "",
    Region = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = regionInstanceTemplatesClient.Insert(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 = regionInstanceTemplatesClient.PollOnceInsert(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;
}

Insert(string, string, InstanceTemplate, CallSettings)

public virtual Operation<Operation, Operation> Insert(string project, string region, InstanceTemplate instanceTemplateResource, CallSettings callSettings = null)

Creates an instance template in the specified project and region using the global instance template whose URL is included in the request.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the region for this request.

instanceTemplateResourceInstanceTemplate

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = RegionInstanceTemplatesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
InstanceTemplate instanceTemplateResource = new InstanceTemplate();
// Make the request
lro::Operation<Operation, Operation> response = regionInstanceTemplatesClient.Insert(project, region, instanceTemplateResource);

// 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 = regionInstanceTemplatesClient.PollOnceInsert(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;
}

InsertAsync(InsertRegionInstanceTemplateRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> InsertAsync(InsertRegionInstanceTemplateRequest request, CallSettings callSettings = null)

Creates an instance template in the specified project and region using the global instance template whose URL is included in the request.

Parameters
NameDescription
requestInsertRegionInstanceTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
InsertRegionInstanceTemplateRequest request = new InsertRegionInstanceTemplateRequest
{
    InstanceTemplateResource = new InstanceTemplate(),
    RequestId = "",
    Region = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceTemplatesClient.InsertAsync(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 regionInstanceTemplatesClient.PollOnceInsertAsync(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;
}

InsertAsync(InsertRegionInstanceTemplateRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> InsertAsync(InsertRegionInstanceTemplateRequest request, CancellationToken cancellationToken)

Creates an instance template in the specified project and region using the global instance template whose URL is included in the request.

Parameters
NameDescription
requestInsertRegionInstanceTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
InsertRegionInstanceTemplateRequest request = new InsertRegionInstanceTemplateRequest
{
    InstanceTemplateResource = new InstanceTemplate(),
    RequestId = "",
    Region = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceTemplatesClient.InsertAsync(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 regionInstanceTemplatesClient.PollOnceInsertAsync(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;
}

InsertAsync(string, string, InstanceTemplate, CallSettings)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, string region, InstanceTemplate instanceTemplateResource, CallSettings callSettings = null)

Creates an instance template in the specified project and region using the global instance template whose URL is included in the request.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the region for this request.

instanceTemplateResourceInstanceTemplate

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
InstanceTemplate instanceTemplateResource = new InstanceTemplate();
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceTemplatesClient.InsertAsync(project, region, instanceTemplateResource);

// 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 regionInstanceTemplatesClient.PollOnceInsertAsync(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;
}

InsertAsync(string, string, InstanceTemplate, CancellationToken)

public virtual Task<Operation<Operation, Operation>> InsertAsync(string project, string region, InstanceTemplate instanceTemplateResource, CancellationToken cancellationToken)

Creates an instance template in the specified project and region using the global instance template whose URL is included in the request.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the region for this request.

instanceTemplateResourceInstanceTemplate

The body resource for this request

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
InstanceTemplate instanceTemplateResource = new InstanceTemplate();
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceTemplatesClient.InsertAsync(project, region, instanceTemplateResource);

// 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 regionInstanceTemplatesClient.PollOnceInsertAsync(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;
}

List(ListRegionInstanceTemplatesRequest, CallSettings)

public virtual PagedEnumerable<InstanceTemplateList, InstanceTemplate> List(ListRegionInstanceTemplatesRequest request, CallSettings callSettings = null)

Retrieves a list of instance templates that are contained within the specified project and region.

Parameters
NameDescription
requestListRegionInstanceTemplatesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableInstanceTemplateListInstanceTemplate

A pageable sequence of InstanceTemplate resources.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = RegionInstanceTemplatesClient.Create();
// Initialize request argument(s)
ListRegionInstanceTemplatesRequest request = new ListRegionInstanceTemplatesRequest
{
    Region = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<InstanceTemplateList, InstanceTemplate> response = regionInstanceTemplatesClient.List(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (InstanceTemplate item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (InstanceTemplateList page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceTemplate item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<InstanceTemplate> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (InstanceTemplate item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

List(string, string, string, int?, CallSettings)

public virtual PagedEnumerable<InstanceTemplateList, InstanceTemplate> List(string project, string region, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves a list of instance templates that are contained within the specified project and region.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the regions for this request.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableInstanceTemplateListInstanceTemplate

A pageable sequence of InstanceTemplate resources.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = RegionInstanceTemplatesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
// Make the request
PagedEnumerable<InstanceTemplateList, InstanceTemplate> response = regionInstanceTemplatesClient.List(project, region);

// Iterate over all response items, lazily performing RPCs as required
foreach (InstanceTemplate item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (InstanceTemplateList page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceTemplate item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<InstanceTemplate> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (InstanceTemplate item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAsync(ListRegionInstanceTemplatesRequest, CallSettings)

public virtual PagedAsyncEnumerable<InstanceTemplateList, InstanceTemplate> ListAsync(ListRegionInstanceTemplatesRequest request, CallSettings callSettings = null)

Retrieves a list of instance templates that are contained within the specified project and region.

Parameters
NameDescription
requestListRegionInstanceTemplatesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableInstanceTemplateListInstanceTemplate

A pageable asynchronous sequence of InstanceTemplate resources.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
ListRegionInstanceTemplatesRequest request = new ListRegionInstanceTemplatesRequest
{
    Region = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<InstanceTemplateList, InstanceTemplate> response = regionInstanceTemplatesClient.ListAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((InstanceTemplate item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((InstanceTemplateList page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceTemplate item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<InstanceTemplate> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (InstanceTemplate item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAsync(string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<InstanceTemplateList, InstanceTemplate> ListAsync(string project, string region, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves a list of instance templates that are contained within the specified project and region.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

The name of the regions for this request.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableInstanceTemplateListInstanceTemplate

A pageable asynchronous sequence of InstanceTemplate resources.

Example
// Create client
RegionInstanceTemplatesClient regionInstanceTemplatesClient = await RegionInstanceTemplatesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
// Make the request
PagedAsyncEnumerable<InstanceTemplateList, InstanceTemplate> response = regionInstanceTemplatesClient.ListAsync(project, region);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((InstanceTemplate item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((InstanceTemplateList page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceTemplate item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<InstanceTemplate> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (InstanceTemplate item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PollOnceDelete(string, CallSettings)

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

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The result of polling the operation.

PollOnceDeleteAsync(string, CallSettings)

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

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A task representing the result of polling the operation.

PollOnceInsert(string, CallSettings)

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

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The result of polling the operation.

PollOnceInsertAsync(string, CallSettings)

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

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
TypeDescription
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.