Compute Engine v1 API - Class ZoneOperationsClient (2.2.0)

public abstract class ZoneOperationsClient

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

ZoneOperations client wrapper, for convenient use.

Inheritance

Object > ZoneOperationsClient

Derived Types

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The ZoneOperations API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual ZoneOperations.ZoneOperationsClient GrpcClient { get; }

The underlying gRPC ZoneOperations client

Property Value
TypeDescription
ZoneOperations.ZoneOperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static ZoneOperationsClient Create()

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

Returns
TypeDescription
ZoneOperationsClient

The created ZoneOperationsClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<ZoneOperationsClient>

The task representing the created ZoneOperationsClient.

Delete(DeleteZoneOperationRequest, CallSettings)

public virtual DeleteZoneOperationResponse Delete(DeleteZoneOperationRequest request, CallSettings callSettings = null)

Deletes the specified zone-specific Operations resource.

Parameters
NameDescription
requestDeleteZoneOperationRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DeleteZoneOperationResponse

The RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = ZoneOperationsClient.Create();
// Initialize request argument(s)
DeleteZoneOperationRequest request = new DeleteZoneOperationRequest
{
    Zone = "",
    Operation = "",
    Project = "",
};
// Make the request
DeleteZoneOperationResponse response = zoneOperationsClient.Delete(request);

Delete(String, String, String, CallSettings)

public virtual DeleteZoneOperationResponse Delete(string project, string zone, string operation, CallSettings callSettings = null)

Deletes the specified zone-specific Operations resource.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for this request.

operationString

Name of the Operations resource to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DeleteZoneOperationResponse

The RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = ZoneOperationsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
string operation = "";
// Make the request
DeleteZoneOperationResponse response = zoneOperationsClient.Delete(project, zone, operation);

DeleteAsync(DeleteZoneOperationRequest, CallSettings)

public virtual Task<DeleteZoneOperationResponse> DeleteAsync(DeleteZoneOperationRequest request, CallSettings callSettings = null)

Deletes the specified zone-specific Operations resource.

Parameters
NameDescription
requestDeleteZoneOperationRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<DeleteZoneOperationResponse>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
DeleteZoneOperationRequest request = new DeleteZoneOperationRequest
{
    Zone = "",
    Operation = "",
    Project = "",
};
// Make the request
DeleteZoneOperationResponse response = await zoneOperationsClient.DeleteAsync(request);

DeleteAsync(DeleteZoneOperationRequest, CancellationToken)

public virtual Task<DeleteZoneOperationResponse> DeleteAsync(DeleteZoneOperationRequest request, CancellationToken cancellationToken)

Deletes the specified zone-specific Operations resource.

Parameters
NameDescription
requestDeleteZoneOperationRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<DeleteZoneOperationResponse>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
DeleteZoneOperationRequest request = new DeleteZoneOperationRequest
{
    Zone = "",
    Operation = "",
    Project = "",
};
// Make the request
DeleteZoneOperationResponse response = await zoneOperationsClient.DeleteAsync(request);

DeleteAsync(String, String, String, CallSettings)

public virtual Task<DeleteZoneOperationResponse> DeleteAsync(string project, string zone, string operation, CallSettings callSettings = null)

Deletes the specified zone-specific Operations resource.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for this request.

operationString

Name of the Operations resource to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<DeleteZoneOperationResponse>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string operation = "";
// Make the request
DeleteZoneOperationResponse response = await zoneOperationsClient.DeleteAsync(project, zone, operation);

DeleteAsync(String, String, String, CancellationToken)

public virtual Task<DeleteZoneOperationResponse> DeleteAsync(string project, string zone, string operation, CancellationToken cancellationToken)

Deletes the specified zone-specific Operations resource.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for this request.

operationString

Name of the Operations resource to delete.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<DeleteZoneOperationResponse>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string operation = "";
// Make the request
DeleteZoneOperationResponse response = await zoneOperationsClient.DeleteAsync(project, zone, operation);

Get(GetZoneOperationRequest, CallSettings)

public virtual Operation Get(GetZoneOperationRequest request, CallSettings callSettings = null)

Retrieves the specified zone-specific Operations resource.

Parameters
NameDescription
requestGetZoneOperationRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation

The RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = ZoneOperationsClient.Create();
// Initialize request argument(s)
GetZoneOperationRequest request = new GetZoneOperationRequest
{
    Zone = "",
    Operation = "",
    Project = "",
};
// Make the request
Operation response = zoneOperationsClient.Get(request);

Get(String, String, String, CallSettings)

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

Retrieves the specified zone-specific Operations resource.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for this request.

operationString

Name of the Operations resource to return.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation

The RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = ZoneOperationsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
string operation = "";
// Make the request
Operation response = zoneOperationsClient.Get(project, zone, operation);

GetAsync(GetZoneOperationRequest, CallSettings)

public virtual Task<Operation> GetAsync(GetZoneOperationRequest request, CallSettings callSettings = null)

Retrieves the specified zone-specific Operations resource.

Parameters
NameDescription
requestGetZoneOperationRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
GetZoneOperationRequest request = new GetZoneOperationRequest
{
    Zone = "",
    Operation = "",
    Project = "",
};
// Make the request
Operation response = await zoneOperationsClient.GetAsync(request);

GetAsync(GetZoneOperationRequest, CancellationToken)

public virtual Task<Operation> GetAsync(GetZoneOperationRequest request, CancellationToken cancellationToken)

Retrieves the specified zone-specific Operations resource.

Parameters
NameDescription
requestGetZoneOperationRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
GetZoneOperationRequest request = new GetZoneOperationRequest
{
    Zone = "",
    Operation = "",
    Project = "",
};
// Make the request
Operation response = await zoneOperationsClient.GetAsync(request);

GetAsync(String, String, String, CallSettings)

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

Retrieves the specified zone-specific Operations resource.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for this request.

operationString

Name of the Operations resource to return.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string operation = "";
// Make the request
Operation response = await zoneOperationsClient.GetAsync(project, zone, operation);

GetAsync(String, String, String, CancellationToken)

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

Retrieves the specified zone-specific Operations resource.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for this request.

operationString

Name of the Operations resource to return.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string operation = "";
// Make the request
Operation response = await zoneOperationsClient.GetAsync(project, zone, operation);

List(ListZoneOperationsRequest, CallSettings)

public virtual PagedEnumerable<OperationList, Operation> List(ListZoneOperationsRequest request, CallSettings callSettings = null)

Retrieves a list of Operation resources contained within the specified zone.

Parameters
NameDescription
requestListZoneOperationsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<OperationList, Operation>

A pageable sequence of Operation resources.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = ZoneOperationsClient.Create();
// Initialize request argument(s)
ListZoneOperationsRequest request = new ListZoneOperationsRequest
{
    Zone = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<OperationList, Operation> response = zoneOperationsClient.List(request);

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

public virtual PagedEnumerable<OperationList, Operation> List(string project, string zone, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves a list of Operation resources contained within the specified zone.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for request.

pageTokenString

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

pageSizeNullable<Int32>

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
PagedEnumerable<OperationList, Operation>

A pageable sequence of Operation resources.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = ZoneOperationsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
// Make the request
PagedEnumerable<OperationList, Operation> response = zoneOperationsClient.List(project, zone);

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

public virtual PagedAsyncEnumerable<OperationList, Operation> ListAsync(ListZoneOperationsRequest request, CallSettings callSettings = null)

Retrieves a list of Operation resources contained within the specified zone.

Parameters
NameDescription
requestListZoneOperationsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<OperationList, Operation>

A pageable asynchronous sequence of Operation resources.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
ListZoneOperationsRequest request = new ListZoneOperationsRequest
{
    Zone = "",
    OrderBy = "",
    Project = "",
    Filter = "",
    ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<OperationList, Operation> response = zoneOperationsClient.ListAsync(request);

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

public virtual PagedAsyncEnumerable<OperationList, Operation> ListAsync(string project, string zone, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves a list of Operation resources contained within the specified zone.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for request.

pageTokenString

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

pageSizeNullable<Int32>

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
PagedAsyncEnumerable<OperationList, Operation>

A pageable asynchronous sequence of Operation resources.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
// Make the request
PagedAsyncEnumerable<OperationList, Operation> response = zoneOperationsClient.ListAsync(project, zone);

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

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.

Wait(WaitZoneOperationRequest, CallSettings)

public virtual Operation Wait(WaitZoneOperationRequest request, CallSettings callSettings = null)

Waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be DONE or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE.

Parameters
NameDescription
requestWaitZoneOperationRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation

The RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = ZoneOperationsClient.Create();
// Initialize request argument(s)
WaitZoneOperationRequest request = new WaitZoneOperationRequest
{
    Zone = "",
    Operation = "",
    Project = "",
};
// Make the request
Operation response = zoneOperationsClient.Wait(request);

Wait(String, String, String, CallSettings)

public virtual Operation Wait(string project, string zone, string operation, CallSettings callSettings = null)

Waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be DONE or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for this request.

operationString

Name of the Operations resource to return.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation

The RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = ZoneOperationsClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
string operation = "";
// Make the request
Operation response = zoneOperationsClient.Wait(project, zone, operation);

WaitAsync(WaitZoneOperationRequest, CallSettings)

public virtual Task<Operation> WaitAsync(WaitZoneOperationRequest request, CallSettings callSettings = null)

Waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be DONE or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE.

Parameters
NameDescription
requestWaitZoneOperationRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
WaitZoneOperationRequest request = new WaitZoneOperationRequest
{
    Zone = "",
    Operation = "",
    Project = "",
};
// Make the request
Operation response = await zoneOperationsClient.WaitAsync(request);

WaitAsync(WaitZoneOperationRequest, CancellationToken)

public virtual Task<Operation> WaitAsync(WaitZoneOperationRequest request, CancellationToken cancellationToken)

Waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be DONE or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE.

Parameters
NameDescription
requestWaitZoneOperationRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
WaitZoneOperationRequest request = new WaitZoneOperationRequest
{
    Zone = "",
    Operation = "",
    Project = "",
};
// Make the request
Operation response = await zoneOperationsClient.WaitAsync(request);

WaitAsync(String, String, String, CallSettings)

public virtual Task<Operation> WaitAsync(string project, string zone, string operation, CallSettings callSettings = null)

Waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be DONE or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for this request.

operationString

Name of the Operations resource to return.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string operation = "";
// Make the request
Operation response = await zoneOperationsClient.WaitAsync(project, zone, operation);

WaitAsync(String, String, String, CancellationToken)

public virtual Task<Operation> WaitAsync(string project, string zone, string operation, CancellationToken cancellationToken)

Waits for the specified Operation resource to return as DONE or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be DONE or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not DONE.

Parameters
NameDescription
projectString

Project ID for this request.

zoneString

Name of the zone for this request.

operationString

Name of the Operations resource to return.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation>

A Task containing the RPC response.

Example
// Create client
ZoneOperationsClient zoneOperationsClient = await ZoneOperationsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string operation = "";
// Make the request
Operation response = await zoneOperationsClient.WaitAsync(project, zone, operation);