Class TemplatesServiceClient (1.0.0-beta03)

public abstract 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
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default TemplatesService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual TemplatesService.TemplatesServiceClient GrpcClient { get; }

The underlying gRPC TemplatesService client

Property Value
TypeDescription
TemplatesService.TemplatesServiceClient

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
TypeDescription
TemplatesServiceClient

The created TemplatesServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<TemplatesServiceClient>

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
NameDescription
requestCreateJobFromTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateJobFromTemplateRequest

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

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
NameDescription
requestCreateJobFromTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Job>

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
NameDescription
requestGetTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetTemplateRequest

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

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
NameDescription
requestGetTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<GetTemplateResponse>

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
NameDescription
requestLaunchTemplateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestLaunchTemplateRequest

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

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
NameDescription
requestLaunchTemplateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<LaunchTemplateResponse>

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