Class ServicesClient (1.1.0)

public abstract class ServicesClient

Services client wrapper, for convenient use.

Inheritance

Object > ServicesClient

Derived Types

Namespace

Google.Cloud.AppEngine.V1

Assembly

Google.Cloud.AppEngine.V1.dll

Remarks

Manages services of an application.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Services scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

DeleteServiceOperationsClient

public virtual OperationsClient DeleteServiceOperationsClient { get; }

The long-running operations client for DeleteService.

Property Value
TypeDescription
Google.LongRunning.OperationsClient

GrpcClient

public virtual Services.ServicesClient GrpcClient { get; }

The underlying gRPC Services client

Property Value
TypeDescription
Services.ServicesClient

UpdateServiceOperationsClient

public virtual OperationsClient UpdateServiceOperationsClient { get; }

The long-running operations client for UpdateService.

Property Value
TypeDescription
Google.LongRunning.OperationsClient

Methods

Create()

public static ServicesClient Create()

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

Returns
TypeDescription
ServicesClient

The created ServicesClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<ServicesClient>

The task representing the created ServicesClient.

DeleteService(DeleteServiceRequest, CallSettings)

public virtual Operation<Empty, OperationMetadataV1> DeleteService(DeleteServiceRequest request, CallSettings callSettings = null)

Deletes the specified service and all enclosed versions.

Parameters
NameDescription
requestDeleteServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.LongRunning.Operation<Empty, OperationMetadataV1>

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
DeleteServiceRequest request = new DeleteServiceRequest { Name = "", };
// Make the request
Operation<Empty, OperationMetadataV1> response = servicesClient.DeleteService(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadataV1> retrievedResponse = servicesClient.PollOnceDeleteService(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteServiceAsync(DeleteServiceRequest, CallSettings)

public virtual Task<Operation<Empty, OperationMetadataV1>> DeleteServiceAsync(DeleteServiceRequest request, CallSettings callSettings = null)

Deletes the specified service and all enclosed versions.

Parameters
NameDescription
requestDeleteServiceRequest

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<Google.LongRunning.Operation<Empty, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
DeleteServiceRequest request = new DeleteServiceRequest { Name = "", };
// Make the request
Operation<Empty, OperationMetadataV1> response = await servicesClient.DeleteServiceAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadataV1> retrievedResponse = await servicesClient.PollOnceDeleteServiceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteServiceAsync(DeleteServiceRequest, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadataV1>> DeleteServiceAsync(DeleteServiceRequest request, CancellationToken cancellationToken)

Deletes the specified service and all enclosed versions.

Parameters
NameDescription
requestDeleteServiceRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.LongRunning.Operation<Empty, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
DeleteServiceRequest request = new DeleteServiceRequest { Name = "", };
// Make the request
Operation<Empty, OperationMetadataV1> response = await servicesClient.DeleteServiceAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadataV1> retrievedResponse = await servicesClient.PollOnceDeleteServiceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

GetService(GetServiceRequest, CallSettings)

public virtual Service GetService(GetServiceRequest request, CallSettings callSettings = null)

Gets the current configuration of the specified service.

Parameters
NameDescription
requestGetServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Service

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
GetServiceRequest request = new GetServiceRequest { Name = "", };
// Make the request
Service response = servicesClient.GetService(request);

GetServiceAsync(GetServiceRequest, CallSettings)

public virtual Task<Service> GetServiceAsync(GetServiceRequest request, CallSettings callSettings = null)

Gets the current configuration of the specified service.

Parameters
NameDescription
requestGetServiceRequest

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<Service>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
GetServiceRequest request = new GetServiceRequest { Name = "", };
// Make the request
Service response = await servicesClient.GetServiceAsync(request);

GetServiceAsync(GetServiceRequest, CancellationToken)

public virtual Task<Service> GetServiceAsync(GetServiceRequest request, CancellationToken cancellationToken)

Gets the current configuration of the specified service.

Parameters
NameDescription
requestGetServiceRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Service>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
GetServiceRequest request = new GetServiceRequest { Name = "", };
// Make the request
Service response = await servicesClient.GetServiceAsync(request);

ListServices(ListServicesRequest, CallSettings)

public virtual PagedEnumerable<ListServicesResponse, Service> ListServices(ListServicesRequest request, CallSettings callSettings = null)

Lists all the services in the application.

Parameters
NameDescription
requestListServicesRequest

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<ListServicesResponse, Service>

A pageable sequence of Service resources.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
ListServicesRequest request = new ListServicesRequest { Parent = "", };
// Make the request
PagedEnumerable<ListServicesResponse, Service> response = servicesClient.ListServices(request);

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

ListServicesAsync(ListServicesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListServicesResponse, Service> ListServicesAsync(ListServicesRequest request, CallSettings callSettings = null)

Lists all the services in the application.

Parameters
NameDescription
requestListServicesRequest

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<ListServicesResponse, Service>

A pageable asynchronous sequence of Service resources.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
ListServicesRequest request = new ListServicesRequest { Parent = "", };
// Make the request
PagedAsyncEnumerable<ListServicesResponse, Service> response = servicesClient.ListServicesAsync(request);

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

PollOnceDeleteService(String, CallSettings)

public virtual Operation<Empty, OperationMetadataV1> PollOnceDeleteService(string operationName, CallSettings callSettings = null)

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

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
Google.LongRunning.Operation<Empty, OperationMetadataV1>

The result of polling the operation.

PollOnceDeleteServiceAsync(String, CallSettings)

public virtual Task<Operation<Empty, OperationMetadataV1>> PollOnceDeleteServiceAsync(string operationName, CallSettings callSettings = null)

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

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
Task<Google.LongRunning.Operation<Empty, OperationMetadataV1>>

A task representing the result of polling the operation.

PollOnceUpdateService(String, CallSettings)

public virtual Operation<Service, OperationMetadataV1> PollOnceUpdateService(string operationName, CallSettings callSettings = null)

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

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
Google.LongRunning.Operation<Service, OperationMetadataV1>

The result of polling the operation.

PollOnceUpdateServiceAsync(String, CallSettings)

public virtual Task<Operation<Service, OperationMetadataV1>> PollOnceUpdateServiceAsync(string operationName, CallSettings callSettings = null)

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

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
Task<Google.LongRunning.Operation<Service, OperationMetadataV1>>

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.

UpdateService(UpdateServiceRequest, CallSettings)

public virtual Operation<Service, OperationMetadataV1> UpdateService(UpdateServiceRequest request, CallSettings callSettings = null)

Updates the configuration of the specified service.

Parameters
NameDescription
requestUpdateServiceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.LongRunning.Operation<Service, OperationMetadataV1>

The RPC response.

Example
// Create client
ServicesClient servicesClient = ServicesClient.Create();
// Initialize request argument(s)
UpdateServiceRequest request = new UpdateServiceRequest
{
    Name = "",
    Service = new Service(),
    UpdateMask = new FieldMask(),
    MigrateTraffic = false,
};
// Make the request
Operation<Service, OperationMetadataV1> response = servicesClient.UpdateService(request);

// Poll until the returned long-running operation is complete
Operation<Service, OperationMetadataV1> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Service 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
Operation<Service, OperationMetadataV1> retrievedResponse = servicesClient.PollOnceUpdateService(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Service retrievedResult = retrievedResponse.Result;
}

UpdateServiceAsync(UpdateServiceRequest, CallSettings)

public virtual Task<Operation<Service, OperationMetadataV1>> UpdateServiceAsync(UpdateServiceRequest request, CallSettings callSettings = null)

Updates the configuration of the specified service.

Parameters
NameDescription
requestUpdateServiceRequest

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<Google.LongRunning.Operation<Service, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
UpdateServiceRequest request = new UpdateServiceRequest
{
    Name = "",
    Service = new Service(),
    UpdateMask = new FieldMask(),
    MigrateTraffic = false,
};
// Make the request
Operation<Service, OperationMetadataV1> response = await servicesClient.UpdateServiceAsync(request);

// Poll until the returned long-running operation is complete
Operation<Service, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Service 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
Operation<Service, OperationMetadataV1> retrievedResponse = await servicesClient.PollOnceUpdateServiceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Service retrievedResult = retrievedResponse.Result;
}

UpdateServiceAsync(UpdateServiceRequest, CancellationToken)

public virtual Task<Operation<Service, OperationMetadataV1>> UpdateServiceAsync(UpdateServiceRequest request, CancellationToken cancellationToken)

Updates the configuration of the specified service.

Parameters
NameDescription
requestUpdateServiceRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.LongRunning.Operation<Service, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
ServicesClient servicesClient = await ServicesClient.CreateAsync();
// Initialize request argument(s)
UpdateServiceRequest request = new UpdateServiceRequest
{
    Name = "",
    Service = new Service(),
    UpdateMask = new FieldMask(),
    MigrateTraffic = false,
};
// Make the request
Operation<Service, OperationMetadataV1> response = await servicesClient.UpdateServiceAsync(request);

// Poll until the returned long-running operation is complete
Operation<Service, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Service 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
Operation<Service, OperationMetadataV1> retrievedResponse = await servicesClient.PollOnceUpdateServiceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Service retrievedResult = retrievedResponse.Result;
}