Cloud Run Admin v2 API - Class ServicesClient (2.8.0)

public abstract class ServicesClient

Reference documentation and code samples for the Cloud Run Admin v2 API class ServicesClient.

Services client wrapper, for convenient use.

Inheritance

object > ServicesClient

Derived Types

Namespace

Google.Cloud.Run.V2

Assembly

Google.Cloud.Run.V2.dll

Remarks

Cloud Run Service Control Plane API

Properties

CreateServiceOperationsClient

public virtual OperationsClient CreateServiceOperationsClient { get; }

The long-running operations client for CreateService.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Services scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default Services scopes are:

DeleteServiceOperationsClient

public virtual OperationsClient DeleteServiceOperationsClient { get; }

The long-running operations client for DeleteService.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual Services.ServicesClient GrpcClient { get; }

The underlying gRPC Services client

Property Value
Type Description
ServicesServicesClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

UpdateServiceOperationsClient

public virtual OperationsClient UpdateServiceOperationsClient { get; }

The long-running operations client for UpdateService.

Property Value
Type Description
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
Type Description
ServicesClient

The created ServicesClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskServicesClient

The task representing the created ServicesClient.

CreateService(LocationName, Service, string, CallSettings)

public virtual Operation<Service, Service> CreateService(LocationName parent, Service service, string serviceId, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
Name Description
parent LocationName

Required. The location and project in which this service should be created. Format: projects/{project}/locations/{location}, where {project} can be project id or number. Only lowercase characters, digits, and hyphens.

service Service

Required. The Service instance to create.

serviceId string

Required. The unique identifier for the Service. It must begin with letter, and cannot end with hyphen; must contain fewer than 50 characters. The name of the service becomes {parent}/services/{service_id}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationServiceService

The RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = gcrv::ServicesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcrv::Service service = new gcrv::Service();
string serviceId = "";
// Make the request
Operation<gcrv::Service, gcrv::Service> response = servicesClient.CreateService(parent, service, serviceId);

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

CreateService(CreateServiceRequest, CallSettings)

public virtual Operation<Service, Service> CreateService(CreateServiceRequest request, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
Name Description
request CreateServiceRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationServiceService

The RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = gcrv::ServicesClient.Create();
// Initialize request argument(s)
gcrv::CreateServiceRequest request = new gcrv::CreateServiceRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Service = new gcrv::Service(),
    ServiceId = "",
    ValidateOnly = false,
};
// Make the request
Operation<gcrv::Service, gcrv::Service> response = servicesClient.CreateService(request);

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

CreateService(string, Service, string, CallSettings)

public virtual Operation<Service, Service> CreateService(string parent, Service service, string serviceId, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
Name Description
parent string

Required. The location and project in which this service should be created. Format: projects/{project}/locations/{location}, where {project} can be project id or number. Only lowercase characters, digits, and hyphens.

service Service

Required. The Service instance to create.

serviceId string

Required. The unique identifier for the Service. It must begin with letter, and cannot end with hyphen; must contain fewer than 50 characters. The name of the service becomes {parent}/services/{service_id}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationServiceService

The RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = gcrv::ServicesClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcrv::Service service = new gcrv::Service();
string serviceId = "";
// Make the request
Operation<gcrv::Service, gcrv::Service> response = servicesClient.CreateService(parent, service, serviceId);

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

CreateServiceAsync(LocationName, Service, string, CallSettings)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(LocationName parent, Service service, string serviceId, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
Name Description
parent LocationName

Required. The location and project in which this service should be created. Format: projects/{project}/locations/{location}, where {project} can be project id or number. Only lowercase characters, digits, and hyphens.

service Service

Required. The Service instance to create.

serviceId string

Required. The unique identifier for the Service. It must begin with letter, and cannot end with hyphen; must contain fewer than 50 characters. The name of the service becomes {parent}/services/{service_id}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcrv::Service service = new gcrv::Service();
string serviceId = "";
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.CreateServiceAsync(parent, service, serviceId);

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

CreateServiceAsync(LocationName, Service, string, CancellationToken)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(LocationName parent, Service service, string serviceId, CancellationToken cancellationToken)

Creates a new Service in a given project and location.

Parameters
Name Description
parent LocationName

Required. The location and project in which this service should be created. Format: projects/{project}/locations/{location}, where {project} can be project id or number. Only lowercase characters, digits, and hyphens.

service Service

Required. The Service instance to create.

serviceId string

Required. The unique identifier for the Service. It must begin with letter, and cannot end with hyphen; must contain fewer than 50 characters. The name of the service becomes {parent}/services/{service_id}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcrv::Service service = new gcrv::Service();
string serviceId = "";
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.CreateServiceAsync(parent, service, serviceId);

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

CreateServiceAsync(CreateServiceRequest, CallSettings)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(CreateServiceRequest request, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
Name Description
request CreateServiceRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
gcrv::CreateServiceRequest request = new gcrv::CreateServiceRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Service = new gcrv::Service(),
    ServiceId = "",
    ValidateOnly = false,
};
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.CreateServiceAsync(request);

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

CreateServiceAsync(CreateServiceRequest, CancellationToken)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(CreateServiceRequest request, CancellationToken cancellationToken)

Creates a new Service in a given project and location.

Parameters
Name Description
request CreateServiceRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
gcrv::CreateServiceRequest request = new gcrv::CreateServiceRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Service = new gcrv::Service(),
    ServiceId = "",
    ValidateOnly = false,
};
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.CreateServiceAsync(request);

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

CreateServiceAsync(string, Service, string, CallSettings)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(string parent, Service service, string serviceId, CallSettings callSettings = null)

Creates a new Service in a given project and location.

Parameters
Name Description
parent string

Required. The location and project in which this service should be created. Format: projects/{project}/locations/{location}, where {project} can be project id or number. Only lowercase characters, digits, and hyphens.

service Service

Required. The Service instance to create.

serviceId string

Required. The unique identifier for the Service. It must begin with letter, and cannot end with hyphen; must contain fewer than 50 characters. The name of the service becomes {parent}/services/{service_id}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcrv::Service service = new gcrv::Service();
string serviceId = "";
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.CreateServiceAsync(parent, service, serviceId);

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

CreateServiceAsync(string, Service, string, CancellationToken)

public virtual Task<Operation<Service, Service>> CreateServiceAsync(string parent, Service service, string serviceId, CancellationToken cancellationToken)

Creates a new Service in a given project and location.

Parameters
Name Description
parent string

Required. The location and project in which this service should be created. Format: projects/{project}/locations/{location}, where {project} can be project id or number. Only lowercase characters, digits, and hyphens.

service Service

Required. The Service instance to create.

serviceId string

Required. The unique identifier for the Service. It must begin with letter, and cannot end with hyphen; must contain fewer than 50 characters. The name of the service becomes {parent}/services/{service_id}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcrv::Service service = new gcrv::Service();
string serviceId = "";
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.CreateServiceAsync(parent, service, serviceId);

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

DeleteService(DeleteServiceRequest, CallSettings)

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

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
Name Description
request DeleteServiceRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationServiceService

The RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = gcrv::ServicesClient.Create();
// Initialize request argument(s)
gcrv::DeleteServiceRequest request = new gcrv::DeleteServiceRequest
{
    ServiceName = gcrv::ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
    ValidateOnly = false,
    Etag = "",
};
// Make the request
Operation<gcrv::Service, gcrv::Service> response = servicesClient.DeleteService(request);

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

DeleteService(ServiceName, CallSettings)

public virtual Operation<Service, Service> DeleteService(ServiceName name, CallSettings callSettings = null)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
Name Description
name ServiceName

Required. The full name of the Service. Format: projects/{project}/locations/{location}/services/{service}, where {project} can be project id or number.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationServiceService

The RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = gcrv::ServicesClient.Create();
// Initialize request argument(s)
gcrv::ServiceName name = gcrv::ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]");
// Make the request
Operation<gcrv::Service, gcrv::Service> response = servicesClient.DeleteService(name);

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

DeleteService(string, CallSettings)

public virtual Operation<Service, Service> DeleteService(string name, CallSettings callSettings = null)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
Name Description
name string

Required. The full name of the Service. Format: projects/{project}/locations/{location}/services/{service}, where {project} can be project id or number.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationServiceService

The RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = gcrv::ServicesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/services/[SERVICE]";
// Make the request
Operation<gcrv::Service, gcrv::Service> response = servicesClient.DeleteService(name);

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

DeleteServiceAsync(DeleteServiceRequest, CallSettings)

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

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
Name Description
request DeleteServiceRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
gcrv::DeleteServiceRequest request = new gcrv::DeleteServiceRequest
{
    ServiceName = gcrv::ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
    ValidateOnly = false,
    Etag = "",
};
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.DeleteServiceAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcrv::Service, gcrv::Service> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::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<gcrv::Service, gcrv::Service> 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
    gcrv::Service retrievedResult = retrievedResponse.Result;
}

DeleteServiceAsync(DeleteServiceRequest, CancellationToken)

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

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
Name Description
request DeleteServiceRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
gcrv::DeleteServiceRequest request = new gcrv::DeleteServiceRequest
{
    ServiceName = gcrv::ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
    ValidateOnly = false,
    Etag = "",
};
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.DeleteServiceAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcrv::Service, gcrv::Service> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::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<gcrv::Service, gcrv::Service> 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
    gcrv::Service retrievedResult = retrievedResponse.Result;
}

DeleteServiceAsync(ServiceName, CallSettings)

public virtual Task<Operation<Service, Service>> DeleteServiceAsync(ServiceName name, CallSettings callSettings = null)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
Name Description
name ServiceName

Required. The full name of the Service. Format: projects/{project}/locations/{location}/services/{service}, where {project} can be project id or number.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
gcrv::ServiceName name = gcrv::ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]");
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.DeleteServiceAsync(name);

// Poll until the returned long-running operation is complete
Operation<gcrv::Service, gcrv::Service> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::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<gcrv::Service, gcrv::Service> 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
    gcrv::Service retrievedResult = retrievedResponse.Result;
}

DeleteServiceAsync(ServiceName, CancellationToken)

public virtual Task<Operation<Service, Service>> DeleteServiceAsync(ServiceName name, CancellationToken cancellationToken)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
Name Description
name ServiceName

Required. The full name of the Service. Format: projects/{project}/locations/{location}/services/{service}, where {project} can be project id or number.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
gcrv::ServiceName name = gcrv::ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]");
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.DeleteServiceAsync(name);

// Poll until the returned long-running operation is complete
Operation<gcrv::Service, gcrv::Service> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::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<gcrv::Service, gcrv::Service> 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
    gcrv::Service retrievedResult = retrievedResponse.Result;
}

DeleteServiceAsync(string, CallSettings)

public virtual Task<Operation<Service, Service>> DeleteServiceAsync(string name, CallSettings callSettings = null)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
Name Description
name string

Required. The full name of the Service. Format: projects/{project}/locations/{location}/services/{service}, where {project} can be project id or number.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/services/[SERVICE]";
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.DeleteServiceAsync(name);

// Poll until the returned long-running operation is complete
Operation<gcrv::Service, gcrv::Service> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::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<gcrv::Service, gcrv::Service> 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
    gcrv::Service retrievedResult = retrievedResponse.Result;
}

DeleteServiceAsync(string, CancellationToken)

public virtual Task<Operation<Service, Service>> DeleteServiceAsync(string name, CancellationToken cancellationToken)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Parameters
Name Description
name string

Required. The full name of the Service. Format: projects/{project}/locations/{location}/services/{service}, where {project} can be project id or number.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationServiceService

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/services/[SERVICE]";
// Make the request
Operation<gcrv::Service, gcrv::Service> response = await servicesClient.DeleteServiceAsync(name);

// Poll until the returned long-running operation is complete
Operation<gcrv::Service, gcrv::Service> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::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<gcrv::Service, gcrv::Service> 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
    gcrv::Service retrievedResult = retrievedResponse.Result;
}

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.

Parameters
Name Description
request GetIamPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = gcrv::ServicesClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = servicesClient.GetIamPolicy(request);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.

Parameters
Name Description
request GetIamPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await servicesClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.

Parameters
Name Description
request GetIamPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = await gcrv::ServicesClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await servicesClient.GetIamPolicyAsync(request);

GetService(GetServiceRequest, CallSettings)

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

Gets information about a Service.

Parameters
Name Description
request GetServiceRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Service

The RPC response.

Example
// Create client
gcrv::ServicesClient servicesClient = gcrv::ServicesClient.Create();
// Initialize request argument(s)
gcrv::GetServiceRequest request = new gcrv::GetServiceRequest
{
    ServiceName = gcrv::ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
};
// Make the request
gcrv::Service response = servicesClient.GetService(request);

GetService(ServiceName, CallSettings)

public virtual Service GetService(ServiceName name, CallSettings callSettings = null)

Gets information about a Service.