Compute Engine v1 API - Class RegionInstanceGroupsClient (2.11.0)

public abstract class RegionInstanceGroupsClient

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

RegionInstanceGroups client wrapper, for convenient use.

Inheritance

object > RegionInstanceGroupsClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The RegionInstanceGroups API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
IReadOnlyListstring
Remarks

GrpcClient

public virtual RegionInstanceGroups.RegionInstanceGroupsClient GrpcClient { get; }

The underlying gRPC RegionInstanceGroups client

Property Value
TypeDescription
RegionInstanceGroupsRegionInstanceGroupsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

SetNamedPortsOperationsClient

public virtual OperationsClient SetNamedPortsOperationsClient { get; }

The long-running operations client for SetNamedPorts.

Property Value
TypeDescription
OperationsClient

Methods

Create()

public static RegionInstanceGroupsClient Create()

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

Returns
TypeDescription
RegionInstanceGroupsClient

The created RegionInstanceGroupsClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskRegionInstanceGroupsClient

The task representing the created RegionInstanceGroupsClient.

Get(GetRegionInstanceGroupRequest, CallSettings)

public virtual InstanceGroup Get(GetRegionInstanceGroupRequest request, CallSettings callSettings = null)

Returns the specified instance group resource.

Parameters
NameDescription
requestGetRegionInstanceGroupRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
InstanceGroup

The RPC response.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = RegionInstanceGroupsClient.Create();
// Initialize request argument(s)
GetRegionInstanceGroupRequest request = new GetRegionInstanceGroupRequest
{
    InstanceGroup = "",
    Region = "",
    Project = "",
};
// Make the request
InstanceGroup response = regionInstanceGroupsClient.Get(request);

Get(string, string, string, CallSettings)

public virtual InstanceGroup Get(string project, string region, string instanceGroup, CallSettings callSettings = null)

Returns the specified instance group resource.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

Name of the region scoping this request.

instanceGroupstring

Name of the instance group resource to return.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
InstanceGroup

The RPC response.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = RegionInstanceGroupsClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceGroup = "";
// Make the request
InstanceGroup response = regionInstanceGroupsClient.Get(project, region, instanceGroup);

GetAsync(GetRegionInstanceGroupRequest, CallSettings)

public virtual Task<InstanceGroup> GetAsync(GetRegionInstanceGroupRequest request, CallSettings callSettings = null)

Returns the specified instance group resource.

Parameters
NameDescription
requestGetRegionInstanceGroupRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskInstanceGroup

A Task containing the RPC response.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
GetRegionInstanceGroupRequest request = new GetRegionInstanceGroupRequest
{
    InstanceGroup = "",
    Region = "",
    Project = "",
};
// Make the request
InstanceGroup response = await regionInstanceGroupsClient.GetAsync(request);

GetAsync(GetRegionInstanceGroupRequest, CancellationToken)

public virtual Task<InstanceGroup> GetAsync(GetRegionInstanceGroupRequest request, CancellationToken cancellationToken)

Returns the specified instance group resource.

Parameters
NameDescription
requestGetRegionInstanceGroupRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskInstanceGroup

A Task containing the RPC response.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
GetRegionInstanceGroupRequest request = new GetRegionInstanceGroupRequest
{
    InstanceGroup = "",
    Region = "",
    Project = "",
};
// Make the request
InstanceGroup response = await regionInstanceGroupsClient.GetAsync(request);

GetAsync(string, string, string, CallSettings)

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

Returns the specified instance group resource.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

Name of the region scoping this request.

instanceGroupstring

Name of the instance group resource to return.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskInstanceGroup

A Task containing the RPC response.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceGroup = "";
// Make the request
InstanceGroup response = await regionInstanceGroupsClient.GetAsync(project, region, instanceGroup);

GetAsync(string, string, string, CancellationToken)

public virtual Task<InstanceGroup> GetAsync(string project, string region, string instanceGroup, CancellationToken cancellationToken)

Returns the specified instance group resource.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

Name of the region scoping this request.

instanceGroupstring

Name of the instance group resource to return.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskInstanceGroup

A Task containing the RPC response.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceGroup = "";
// Make the request
InstanceGroup response = await regionInstanceGroupsClient.GetAsync(project, region, instanceGroup);

List(ListRegionInstanceGroupsRequest, CallSettings)

public virtual PagedEnumerable<RegionInstanceGroupList, InstanceGroup> List(ListRegionInstanceGroupsRequest request, CallSettings callSettings = null)

Retrieves the list of instance group resources contained within the specified region.

Parameters
NameDescription
requestListRegionInstanceGroupsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableRegionInstanceGroupListInstanceGroup

A pageable sequence of InstanceGroup resources.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = RegionInstanceGroupsClient.Create();
// Initialize request argument(s)
ListRegionInstanceGroupsRequest request = new ListRegionInstanceGroupsRequest
{
    Region = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<RegionInstanceGroupList, InstanceGroup> response = regionInstanceGroupsClient.List(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (InstanceGroup 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 (RegionInstanceGroupList page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceGroup 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<InstanceGroup> 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 (InstanceGroup 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<RegionInstanceGroupList, InstanceGroup> List(string project, string region, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the list of instance group resources contained within the specified region.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

Name of the region scoping 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
PagedEnumerableRegionInstanceGroupListInstanceGroup

A pageable sequence of InstanceGroup resources.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = RegionInstanceGroupsClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
// Make the request
PagedEnumerable<RegionInstanceGroupList, InstanceGroup> response = regionInstanceGroupsClient.List(project, region);

// Iterate over all response items, lazily performing RPCs as required
foreach (InstanceGroup 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 (RegionInstanceGroupList page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceGroup 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<InstanceGroup> 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 (InstanceGroup 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(ListRegionInstanceGroupsRequest, CallSettings)

public virtual PagedAsyncEnumerable<RegionInstanceGroupList, InstanceGroup> ListAsync(ListRegionInstanceGroupsRequest request, CallSettings callSettings = null)

Retrieves the list of instance group resources contained within the specified region.

Parameters
NameDescription
requestListRegionInstanceGroupsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableRegionInstanceGroupListInstanceGroup

A pageable asynchronous sequence of InstanceGroup resources.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
ListRegionInstanceGroupsRequest request = new ListRegionInstanceGroupsRequest
{
    Region = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<RegionInstanceGroupList, InstanceGroup> response = regionInstanceGroupsClient.ListAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((InstanceGroup 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((RegionInstanceGroupList page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceGroup 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<InstanceGroup> 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 (InstanceGroup 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<RegionInstanceGroupList, InstanceGroup> ListAsync(string project, string region, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the list of instance group resources contained within the specified region.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

Name of the region scoping 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
PagedAsyncEnumerableRegionInstanceGroupListInstanceGroup

A pageable asynchronous sequence of InstanceGroup resources.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
// Make the request
PagedAsyncEnumerable<RegionInstanceGroupList, InstanceGroup> response = regionInstanceGroupsClient.ListAsync(project, region);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((InstanceGroup 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((RegionInstanceGroupList page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceGroup 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<InstanceGroup> 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 (InstanceGroup 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;

ListInstances(ListInstancesRegionInstanceGroupsRequest, CallSettings)

public virtual PagedEnumerable<RegionInstanceGroupsListInstances, InstanceWithNamedPorts> ListInstances(ListInstancesRegionInstanceGroupsRequest request, CallSettings callSettings = null)

Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.

Parameters
NameDescription
requestListInstancesRegionInstanceGroupsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableRegionInstanceGroupsListInstancesInstanceWithNamedPorts

A pageable sequence of InstanceWithNamedPorts resources.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = RegionInstanceGroupsClient.Create();
// Initialize request argument(s)
ListInstancesRegionInstanceGroupsRequest request = new ListInstancesRegionInstanceGroupsRequest
{
    RegionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(),
    InstanceGroup = "",
    Region = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<RegionInstanceGroupsListInstances, InstanceWithNamedPorts> response = regionInstanceGroupsClient.ListInstances(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (InstanceWithNamedPorts 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 (RegionInstanceGroupsListInstances page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceWithNamedPorts 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<InstanceWithNamedPorts> 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 (InstanceWithNamedPorts 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;

ListInstances(string, string, string, RegionInstanceGroupsListInstancesRequest, string, int?, CallSettings)

public virtual PagedEnumerable<RegionInstanceGroupsListInstances, InstanceWithNamedPorts> ListInstances(string project, string region, string instanceGroup, RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

Name of the region scoping this request.

instanceGroupstring

Name of the regional instance group for which we want to list the instances.

regionInstanceGroupsListInstancesRequestResourceRegionInstanceGroupsListInstancesRequest

The body resource 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
PagedEnumerableRegionInstanceGroupsListInstancesInstanceWithNamedPorts

A pageable sequence of InstanceWithNamedPorts resources.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = RegionInstanceGroupsClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceGroup = "";
RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest();
// Make the request
PagedEnumerable<RegionInstanceGroupsListInstances, InstanceWithNamedPorts> response = regionInstanceGroupsClient.ListInstances(project, region, instanceGroup, regionInstanceGroupsListInstancesRequestResource);

// Iterate over all response items, lazily performing RPCs as required
foreach (InstanceWithNamedPorts 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 (RegionInstanceGroupsListInstances page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceWithNamedPorts 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<InstanceWithNamedPorts> 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 (InstanceWithNamedPorts 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;

ListInstancesAsync(ListInstancesRegionInstanceGroupsRequest, CallSettings)

public virtual PagedAsyncEnumerable<RegionInstanceGroupsListInstances, InstanceWithNamedPorts> ListInstancesAsync(ListInstancesRegionInstanceGroupsRequest request, CallSettings callSettings = null)

Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.

Parameters
NameDescription
requestListInstancesRegionInstanceGroupsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableRegionInstanceGroupsListInstancesInstanceWithNamedPorts

A pageable asynchronous sequence of InstanceWithNamedPorts resources.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
ListInstancesRegionInstanceGroupsRequest request = new ListInstancesRegionInstanceGroupsRequest
{
    RegionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(),
    InstanceGroup = "",
    Region = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<RegionInstanceGroupsListInstances, InstanceWithNamedPorts> response = regionInstanceGroupsClient.ListInstancesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((InstanceWithNamedPorts 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((RegionInstanceGroupsListInstances page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceWithNamedPorts 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<InstanceWithNamedPorts> 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 (InstanceWithNamedPorts 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;

ListInstancesAsync(string, string, string, RegionInstanceGroupsListInstancesRequest, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<RegionInstanceGroupsListInstances, InstanceWithNamedPorts> ListInstancesAsync(string project, string region, string instanceGroup, RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

Name of the region scoping this request.

instanceGroupstring

Name of the regional instance group for which we want to list the instances.

regionInstanceGroupsListInstancesRequestResourceRegionInstanceGroupsListInstancesRequest

The body resource 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
PagedAsyncEnumerableRegionInstanceGroupsListInstancesInstanceWithNamedPorts

A pageable asynchronous sequence of InstanceWithNamedPorts resources.

Example
// Create client
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceGroup = "";
RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest();
// Make the request
PagedAsyncEnumerable<RegionInstanceGroupsListInstances, InstanceWithNamedPorts> response = regionInstanceGroupsClient.ListInstancesAsync(project, region, instanceGroup, regionInstanceGroupsListInstancesRequestResource);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((InstanceWithNamedPorts 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((RegionInstanceGroupsListInstances page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (InstanceWithNamedPorts 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<InstanceWithNamedPorts> 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 (InstanceWithNamedPorts 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;

PollOnceSetNamedPorts(string, CallSettings)

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

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

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.

PollOnceSetNamedPortsAsync(string, CallSettings)

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

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

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.

SetNamedPorts(SetNamedPortsRegionInstanceGroupRequest, CallSettings)

public virtual Operation<Operation, Operation> SetNamedPorts(SetNamedPortsRegionInstanceGroupRequest request, CallSettings callSettings = null)

Sets the named ports for the specified regional instance group.

Parameters
NameDescription
requestSetNamedPortsRegionInstanceGroupRequest

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
RegionInstanceGroupsClient regionInstanceGroupsClient = RegionInstanceGroupsClient.Create();
// Initialize request argument(s)
SetNamedPortsRegionInstanceGroupRequest request = new SetNamedPortsRegionInstanceGroupRequest
{
    RegionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(),
    RequestId = "",
    InstanceGroup = "",
    Region = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = regionInstanceGroupsClient.SetNamedPorts(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 = regionInstanceGroupsClient.PollOnceSetNamedPorts(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;
}

SetNamedPorts(string, string, string, RegionInstanceGroupsSetNamedPortsRequest, CallSettings)

public virtual Operation<Operation, Operation> SetNamedPorts(string project, string region, string instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, CallSettings callSettings = null)

Sets the named ports for the specified regional instance group.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

Name of the region scoping this request.

instanceGroupstring

The name of the regional instance group where the named ports are updated.

regionInstanceGroupsSetNamedPortsRequestResourceRegionInstanceGroupsSetNamedPortsRequest

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
RegionInstanceGroupsClient regionInstanceGroupsClient = RegionInstanceGroupsClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceGroup = "";
RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest();
// Make the request
lro::Operation<Operation, Operation> response = regionInstanceGroupsClient.SetNamedPorts(project, region, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource);

// 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 = regionInstanceGroupsClient.PollOnceSetNamedPorts(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;
}

SetNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> SetNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest request, CallSettings callSettings = null)

Sets the named ports for the specified regional instance group.

Parameters
NameDescription
requestSetNamedPortsRegionInstanceGroupRequest

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
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
SetNamedPortsRegionInstanceGroupRequest request = new SetNamedPortsRegionInstanceGroupRequest
{
    RegionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(),
    RequestId = "",
    InstanceGroup = "",
    Region = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceGroupsClient.SetNamedPortsAsync(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 regionInstanceGroupsClient.PollOnceSetNamedPortsAsync(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;
}

SetNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> SetNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest request, CancellationToken cancellationToken)

Sets the named ports for the specified regional instance group.

Parameters
NameDescription
requestSetNamedPortsRegionInstanceGroupRequest

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
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
SetNamedPortsRegionInstanceGroupRequest request = new SetNamedPortsRegionInstanceGroupRequest
{
    RegionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(),
    RequestId = "",
    InstanceGroup = "",
    Region = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceGroupsClient.SetNamedPortsAsync(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 regionInstanceGroupsClient.PollOnceSetNamedPortsAsync(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;
}

SetNamedPortsAsync(string, string, string, RegionInstanceGroupsSetNamedPortsRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> SetNamedPortsAsync(string project, string region, string instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, CallSettings callSettings = null)

Sets the named ports for the specified regional instance group.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

Name of the region scoping this request.

instanceGroupstring

The name of the regional instance group where the named ports are updated.

regionInstanceGroupsSetNamedPortsRequestResourceRegionInstanceGroupsSetNamedPortsRequest

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
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceGroup = "";
RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest();
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceGroupsClient.SetNamedPortsAsync(project, region, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource);

// 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 regionInstanceGroupsClient.PollOnceSetNamedPortsAsync(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;
}

SetNamedPortsAsync(string, string, string, RegionInstanceGroupsSetNamedPortsRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> SetNamedPortsAsync(string project, string region, string instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, CancellationToken cancellationToken)

Sets the named ports for the specified regional instance group.

Parameters
NameDescription
projectstring

Project ID for this request.

regionstring

Name of the region scoping this request.

instanceGroupstring

The name of the regional instance group where the named ports are updated.

regionInstanceGroupsSetNamedPortsRequestResourceRegionInstanceGroupsSetNamedPortsRequest

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
RegionInstanceGroupsClient regionInstanceGroupsClient = await RegionInstanceGroupsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
string instanceGroup = "";
RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest();
// Make the request
lro::Operation<Operation, Operation> response = await regionInstanceGroupsClient.SetNamedPortsAsync(project, region, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource);

// 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 regionInstanceGroupsClient.PollOnceSetNamedPortsAsync(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;
}

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.