Cloud Run Admin v2 API - Class SourceUploadClient (2.21.0)

public abstract class SourceUploadClient

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

SourceUpload client wrapper, for convenient use.

Inheritance

object > SourceUploadClient

Derived Types

Namespace

Google.Cloud.Run.V2

Assembly

Google.Cloud.Run.V2.dll

Remarks

The Cloud Run Source Upload API allows you to upload source code to deploy Cloud Run resources.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual SourceUpload.SourceUploadClient GrpcClient { get; }

The underlying gRPC SourceUpload client

Property Value
Type Description
SourceUploadSourceUploadClient

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

Methods

Create()

public static SourceUploadClient Create()

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

Returns
Type Description
SourceUploadClient

The created SourceUploadClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskSourceUploadClient

The task representing the created SourceUploadClient.

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
Type Description
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.

UploadSource(LocationName, CallSettings)

public virtual UploadSourceResponse UploadSource(LocationName parent, CallSettings callSettings = null)

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the run.locations.uploadSource permission for all principals.

Parameters
Name Description
parent LocationName

Required. The project and location in which the source archive should be uploaded to, specified in the format projects/*/locations/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
UploadSourceResponse

The RPC response.

Example
// Create client
gcrv::SourceUploadClient sourceUploadClient = gcrv::SourceUploadClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
gcrv::UploadSourceResponse response = sourceUploadClient.UploadSource(parent);

UploadSource(UploadSourceRequest, CallSettings)

public virtual UploadSourceResponse UploadSource(UploadSourceRequest request, CallSettings callSettings = null)

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the run.locations.uploadSource permission for all principals.

Parameters
Name Description
request UploadSourceRequest

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
UploadSourceResponse

The RPC response.

Example
// Create client
gcrv::SourceUploadClient sourceUploadClient = gcrv::SourceUploadClient.Create();
// Initialize request argument(s)
gcrv::UploadSourceRequest request = new gcrv::UploadSourceRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ServiceAsServiceName = gcrv::ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
};
// Make the request
gcrv::UploadSourceResponse response = sourceUploadClient.UploadSource(request);

UploadSource(string, CallSettings)

public virtual UploadSourceResponse UploadSource(string parent, CallSettings callSettings = null)

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the run.locations.uploadSource permission for all principals.

Parameters
Name Description
parent string

Required. The project and location in which the source archive should be uploaded to, specified in the format projects/*/locations/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
UploadSourceResponse

The RPC response.

Example
// Create client
gcrv::SourceUploadClient sourceUploadClient = gcrv::SourceUploadClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
gcrv::UploadSourceResponse response = sourceUploadClient.UploadSource(parent);

UploadSourceAsync(LocationName, CallSettings)

public virtual Task<UploadSourceResponse> UploadSourceAsync(LocationName parent, CallSettings callSettings = null)

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the run.locations.uploadSource permission for all principals.

Parameters
Name Description
parent LocationName

Required. The project and location in which the source archive should be uploaded to, specified in the format projects/*/locations/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskUploadSourceResponse

A Task containing the RPC response.

Example
// Create client
gcrv::SourceUploadClient sourceUploadClient = await gcrv::SourceUploadClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
gcrv::UploadSourceResponse response = await sourceUploadClient.UploadSourceAsync(parent);

UploadSourceAsync(LocationName, CancellationToken)

public virtual Task<UploadSourceResponse> UploadSourceAsync(LocationName parent, CancellationToken cancellationToken)

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the run.locations.uploadSource permission for all principals.

Parameters
Name Description
parent LocationName

Required. The project and location in which the source archive should be uploaded to, specified in the format projects/*/locations/*.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskUploadSourceResponse

A Task containing the RPC response.

Example
// Create client
gcrv::SourceUploadClient sourceUploadClient = await gcrv::SourceUploadClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
gcrv::UploadSourceResponse response = await sourceUploadClient.UploadSourceAsync(parent);

UploadSourceAsync(UploadSourceRequest, CallSettings)

public virtual Task<UploadSourceResponse> UploadSourceAsync(UploadSourceRequest request, CallSettings callSettings = null)

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the run.locations.uploadSource permission for all principals.

Parameters
Name Description
request UploadSourceRequest

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
TaskUploadSourceResponse

A Task containing the RPC response.

Example
// Create client
gcrv::SourceUploadClient sourceUploadClient = await gcrv::SourceUploadClient.CreateAsync();
// Initialize request argument(s)
gcrv::UploadSourceRequest request = new gcrv::UploadSourceRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ServiceAsServiceName = gcrv::ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
};
// Make the request
gcrv::UploadSourceResponse response = await sourceUploadClient.UploadSourceAsync(request);

UploadSourceAsync(UploadSourceRequest, CancellationToken)

public virtual Task<UploadSourceResponse> UploadSourceAsync(UploadSourceRequest request, CancellationToken cancellationToken)

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the run.locations.uploadSource permission for all principals.

Parameters
Name Description
request UploadSourceRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskUploadSourceResponse

A Task containing the RPC response.

Example
// Create client
gcrv::SourceUploadClient sourceUploadClient = await gcrv::SourceUploadClient.CreateAsync();
// Initialize request argument(s)
gcrv::UploadSourceRequest request = new gcrv::UploadSourceRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ServiceAsServiceName = gcrv::ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"),
};
// Make the request
gcrv::UploadSourceResponse response = await sourceUploadClient.UploadSourceAsync(request);

UploadSourceAsync(string, CallSettings)

public virtual Task<UploadSourceResponse> UploadSourceAsync(string parent, CallSettings callSettings = null)

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the run.locations.uploadSource permission for all principals.

Parameters
Name Description
parent string

Required. The project and location in which the source archive should be uploaded to, specified in the format projects/*/locations/*.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskUploadSourceResponse

A Task containing the RPC response.

Example
// Create client
gcrv::SourceUploadClient sourceUploadClient = await gcrv::SourceUploadClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
gcrv::UploadSourceResponse response = await sourceUploadClient.UploadSourceAsync(parent);

UploadSourceAsync(string, CancellationToken)

public virtual Task<UploadSourceResponse> UploadSourceAsync(string parent, CancellationToken cancellationToken)

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the run.locations.uploadSource permission for all principals.

Parameters
Name Description
parent string

Required. The project and location in which the source archive should be uploaded to, specified in the format projects/*/locations/*.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskUploadSourceResponse

A Task containing the RPC response.

Example
// Create client
gcrv::SourceUploadClient sourceUploadClient = await gcrv::SourceUploadClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
gcrv::UploadSourceResponse response = await sourceUploadClient.UploadSourceAsync(parent);