Dataflow v1beta3 API - Class TemplatesServiceClient (2.0.0-beta06)

public abstract class TemplatesServiceClient

Reference documentation and code samples for the Dataflow v1beta3 API class TemplatesServiceClient.

TemplatesService client wrapper, for convenient use.

Inheritance

object > TemplatesServiceClient

Namespace

Google.Cloud.Dataflow.V1Beta3

Assembly

Google.Cloud.Dataflow.V1Beta3.dll

Remarks

Provides a method to create Cloud Dataflow jobs from templates.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default TemplatesService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual TemplatesService.TemplatesServiceClient GrpcClient { get; }

The underlying gRPC TemplatesService client

Property Value
Type Description
TemplatesServiceTemplatesServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static TemplatesServiceClient Create()

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

Returns
Type Description
TemplatesServiceClient

The created TemplatesServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskTemplatesServiceClient

The task representing the created TemplatesServiceClient.

CreateJobFromTemplate(CreateJobFromTemplateRequest, CallSettings)

public virtual Job CreateJobFromTemplate(CreateJobFromTemplateRequest request, CallSettings callSettings = null)

Creates a Cloud Dataflow job from a template.

Parameters
Name Description
request CreateJobFromTemplateRequest

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
Job

The RPC response.

Example
// Create client
TemplatesServiceClient templatesServiceClient = TemplatesServiceClient.Create();
// Initialize request argument(s)
CreateJobFromTemplateRequest request = new CreateJobFromTemplateRequest
{
    ProjectId = "",
    GcsPath = "",
    Parameters = { { "", "" }, },
    JobName = "",
    Environment = new RuntimeEnvironment(),
    Location = "",
};
// Make the request
Job response = templatesServiceClient.CreateJobFromTemplate(request);

CreateJobFromTemplateAsync(CreateJobFromTemplateRequest, CallSettings)

public virtual Task<Job> CreateJobFromTemplateAsync(CreateJobFromTemplateRequest request, CallSettings callSettings = null)

Creates a Cloud Dataflow job from a template.

Parameters
Name Description
request CreateJobFromTemplateRequest

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
TaskJob

A Task containing the RPC response.

Example
// Create client
TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
// Initialize request argument(s)
CreateJobFromTemplateRequest request = new CreateJobFromTemplateRequest
{
    ProjectId = "",
    GcsPath = "",
    Parameters = { { "", "" }, },
    JobName = "",
    Environment = new RuntimeEnvironment(),
    Location = "",
};
// Make the request
Job response = await templatesServiceClient.CreateJobFromTemplateAsync(request);

CreateJobFromTemplateAsync(CreateJobFromTemplateRequest, CancellationToken)

public virtual Task<Job> CreateJobFromTemplateAsync(CreateJobFromTemplateRequest request, CancellationToken cancellationToken)

Creates a Cloud Dataflow job from a template.

Parameters
Name Description
request CreateJobFromTemplateRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
// Initialize request argument(s)
CreateJobFromTemplateRequest request = new CreateJobFromTemplateRequest
{
    ProjectId = "",
    GcsPath = "",
    Parameters = { { "", "" }, },
    JobName = "",
    Environment = new RuntimeEnvironment(),
    Location = "",
};
// Make the request
Job response = await templatesServiceClient.CreateJobFromTemplateAsync(request);

GetTemplate(GetTemplateRequest, CallSettings)

public virtual GetTemplateResponse GetTemplate(GetTemplateRequest request, CallSettings callSettings = null)

Get the template associated with a template.

Parameters
Name Description
request GetTemplateRequest

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
GetTemplateResponse

The RPC response.

Example
// Create client
TemplatesServiceClient templatesServiceClient = TemplatesServiceClient.Create();
// Initialize request argument(s)
GetTemplateRequest request = new GetTemplateRequest
{
    ProjectId = "",
    GcsPath = "",
    View = GetTemplateRequest.Types.TemplateView.MetadataOnly,
    Location = "",
};
// Make the request
GetTemplateResponse response = templatesServiceClient.GetTemplate(request);

GetTemplateAsync(GetTemplateRequest, CallSettings)

public virtual Task<GetTemplateResponse> GetTemplateAsync(GetTemplateRequest request, CallSettings callSettings = null)

Get the template associated with a template.

Parameters
Name Description
request GetTemplateRequest

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
TaskGetTemplateResponse

A Task containing the RPC response.

Example
// Create client
TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
// Initialize request argument(s)
GetTemplateRequest request = new GetTemplateRequest
{
    ProjectId = "",
    GcsPath = "",
    View = GetTemplateRequest.Types.TemplateView.MetadataOnly,
    Location = "",
};
// Make the request
GetTemplateResponse response = await templatesServiceClient.GetTemplateAsync(request);

GetTemplateAsync(GetTemplateRequest, CancellationToken)

public virtual Task<GetTemplateResponse> GetTemplateAsync(GetTemplateRequest request, CancellationToken cancellationToken)

Get the template associated with a template.

Parameters
Name Description
request GetTemplateRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGetTemplateResponse

A Task containing the RPC response.

Example
// Create client
TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
// Initialize request argument(s)
GetTemplateRequest request = new GetTemplateRequest
{
    ProjectId = "",
    GcsPath = "",
    View = GetTemplateRequest.Types.TemplateView.MetadataOnly,
    Location = "",
};
// Make the request
GetTemplateResponse response = await templatesServiceClient.GetTemplateAsync(request);

LaunchTemplate(LaunchTemplateRequest, CallSettings)

public virtual LaunchTemplateResponse LaunchTemplate(LaunchTemplateRequest request, CallSettings callSettings = null)

Launch a template.

Parameters
Name Description
request LaunchTemplateRequest

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
LaunchTemplateResponse

The RPC response.

Example
// Create client
TemplatesServiceClient templatesServiceClient = TemplatesServiceClient.Create();
// Initialize request argument(s)
LaunchTemplateRequest request = new LaunchTemplateRequest
{
    ProjectId = "",
    ValidateOnly = false,
    GcsPath = "",
    LaunchParameters = new LaunchTemplateParameters(),
    Location = "",
};
// Make the request
LaunchTemplateResponse response = templatesServiceClient.LaunchTemplate(request);

LaunchTemplateAsync(LaunchTemplateRequest, CallSettings)

public virtual Task<LaunchTemplateResponse> LaunchTemplateAsync(LaunchTemplateRequest request, CallSettings callSettings = null)

Launch a template.

Parameters
Name Description
request LaunchTemplateRequest

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
TaskLaunchTemplateResponse

A Task containing the RPC response.

Example
// Create client
TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
// Initialize request argument(s)
LaunchTemplateRequest request = new LaunchTemplateRequest
{
    ProjectId = "",
    ValidateOnly = false,
    GcsPath = "",
    LaunchParameters = new LaunchTemplateParameters(),
    Location = "",
};
// Make the request
LaunchTemplateResponse response = await templatesServiceClient.LaunchTemplateAsync(request);

LaunchTemplateAsync(LaunchTemplateRequest, CancellationToken)

public virtual Task<LaunchTemplateResponse> LaunchTemplateAsync(LaunchTemplateRequest request, CancellationToken cancellationToken)

Launch a template.

Parameters
Name Description
request LaunchTemplateRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskLaunchTemplateResponse

A Task containing the RPC response.

Example
// Create client
TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
// Initialize request argument(s)
LaunchTemplateRequest request = new LaunchTemplateRequest
{
    ProjectId = "",
    ValidateOnly = false,
    GcsPath = "",
    LaunchParameters = new LaunchTemplateParameters(),
    Location = "",
};
// Make the request
LaunchTemplateResponse response = await templatesServiceClient.LaunchTemplateAsync(request);

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.