Class Google::Cloud::Dataflow::V1beta3::Jobs::Client (v0.2.0)

Client for the Jobs service.

Provides a method to create and modify Google Cloud Dataflow jobs. A Job is a multi-stage computation graph run by the Cloud Dataflow service.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the Jobs Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all Jobs clients
::Google::Cloud::Dataflow::V1beta3::Jobs::Client.configure do |config|
  config.timeout = 10.0
end

#aggregated_list_jobs

def aggregated_list_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::Job>
def aggregated_list_jobs(filter: nil, project_id: nil, view: nil, page_size: nil, page_token: nil, location: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::Job>

List the jobs of a project across all regions.

Overloads
def aggregated_list_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::Job>
Pass arguments to aggregated_list_jobs via a request object, either of type ListJobsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataflow::V1beta3::ListJobsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def aggregated_list_jobs(filter: nil, project_id: nil, view: nil, page_size: nil, page_token: nil, location: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::Job>
Pass arguments to aggregated_list_jobs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • filter (::Google::Cloud::Dataflow::V1beta3::ListJobsRequest::Filter) — The kind of filter to use.
  • project_id (::String) — The project which owns the jobs.
  • view (::Google::Cloud::Dataflow::V1beta3::JobView) — Deprecated. ListJobs always returns summaries now. Use GetJob for other JobViews.
  • page_size (::Integer) — If there are many jobs, limit response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit.
  • page_token (::String) — Set this to the 'next_page_token' field of a previous response to request additional results in a long list.
  • location (::String) — The regional endpoint that contains this job.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::ListJobsRequest.new

# Call the aggregated_list_jobs method.
result = client.aggregated_list_jobs request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Dataflow::V1beta3::Job.
  p response
end

#check_active_jobs

def check_active_jobs(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::CheckActiveJobsResponse
def check_active_jobs(project_id: nil) -> ::Google::Cloud::Dataflow::V1beta3::CheckActiveJobsResponse

Check for existence of active jobs in the given project across all regions.

Overloads
def check_active_jobs(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::CheckActiveJobsResponse
Pass arguments to check_active_jobs via a request object, either of type CheckActiveJobsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataflow::V1beta3::CheckActiveJobsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def check_active_jobs(project_id: nil) -> ::Google::Cloud::Dataflow::V1beta3::CheckActiveJobsResponse
Pass arguments to check_active_jobs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • project_id (::String) — The project which owns the jobs.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::CheckActiveJobsRequest.new

# Call the check_active_jobs method.
result = client.check_active_jobs request

# The returned object is of type Google::Cloud::Dataflow::V1beta3::CheckActiveJobsResponse.
p result

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the Jobs Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_job

def create_job(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::Job
def create_job(project_id: nil, job: nil, view: nil, replace_job_id: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::Job

Creates a Cloud Dataflow job.

To create a job, we recommend using projects.locations.jobs.create with a regional endpoint. Using projects.jobs.create is not recommended, as your job will always start in us-central1.

Overloads
def create_job(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::Job
Pass arguments to create_job via a request object, either of type CreateJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataflow::V1beta3::CreateJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_job(project_id: nil, job: nil, view: nil, replace_job_id: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::Job
Pass arguments to create_job via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::CreateJobRequest.new

# Call the create_job method.
result = client.create_job request

# The returned object is of type Google::Cloud::Dataflow::V1beta3::Job.
p result

#get_job

def get_job(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::Job
def get_job(project_id: nil, job_id: nil, view: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::Job

Gets the state of the specified Cloud Dataflow job.

To get the state of a job, we recommend using projects.locations.jobs.get with a regional endpoint. Using projects.jobs.get is not recommended, as you can only get the state of jobs that are running in us-central1.

Overloads
def get_job(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::Job
Pass arguments to get_job via a request object, either of type GetJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataflow::V1beta3::GetJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_job(project_id: nil, job_id: nil, view: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::Job
Pass arguments to get_job via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::GetJobRequest.new

# Call the get_job method.
result = client.get_job request

# The returned object is of type Google::Cloud::Dataflow::V1beta3::Job.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new Jobs client object.

Yields
  • (config) — Configure the Jobs client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Dataflow::V1beta3::Jobs::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Dataflow::V1beta3::Jobs::Client.new do |config|
  config.timeout = 10.0
end

#list_jobs

def list_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::Job>
def list_jobs(filter: nil, project_id: nil, view: nil, page_size: nil, page_token: nil, location: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::Job>

List the jobs of a project.

To list the jobs of a project in a region, we recommend using projects.locations.jobs.list with a regional endpoint. To list the all jobs across all regions, use projects.jobs.aggregated. Using projects.jobs.list is not recommended, as you can only get the list of jobs that are running in us-central1.

Overloads
def list_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::Job>
Pass arguments to list_jobs via a request object, either of type ListJobsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataflow::V1beta3::ListJobsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_jobs(filter: nil, project_id: nil, view: nil, page_size: nil, page_token: nil, location: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::Job>
Pass arguments to list_jobs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • filter (::Google::Cloud::Dataflow::V1beta3::ListJobsRequest::Filter) — The kind of filter to use.
  • project_id (::String) — The project which owns the jobs.
  • view (::Google::Cloud::Dataflow::V1beta3::JobView) — Deprecated. ListJobs always returns summaries now. Use GetJob for other JobViews.
  • page_size (::Integer) — If there are many jobs, limit response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit.
  • page_token (::String) — Set this to the 'next_page_token' field of a previous response to request additional results in a long list.
  • location (::String) — The regional endpoint that contains this job.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::ListJobsRequest.new

# Call the list_jobs method.
result = client.list_jobs request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Dataflow::V1beta3::Job.
  p response
end

#snapshot_job

def snapshot_job(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::Snapshot
def snapshot_job(project_id: nil, job_id: nil, ttl: nil, location: nil, snapshot_sources: nil, description: nil) -> ::Google::Cloud::Dataflow::V1beta3::Snapshot

Snapshot the state of a streaming job.

Overloads
def snapshot_job(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::Snapshot
Pass arguments to snapshot_job via a request object, either of type SnapshotJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataflow::V1beta3::SnapshotJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def snapshot_job(project_id: nil, job_id: nil, ttl: nil, location: nil, snapshot_sources: nil, description: nil) -> ::Google::Cloud::Dataflow::V1beta3::Snapshot
Pass arguments to snapshot_job via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • project_id (::String) — The project which owns the job to be snapshotted.
  • job_id (::String) — The job to be snapshotted.
  • ttl (::Google::Protobuf::Duration, ::Hash) — TTL for the snapshot.
  • location (::String) — The location that contains this job.
  • snapshot_sources (::Boolean) — If true, perform snapshots for sources which support this.
  • description (::String) — User specified description of the snapshot. Maybe empty.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::SnapshotJobRequest.new

# Call the snapshot_job method.
result = client.snapshot_job request

# The returned object is of type Google::Cloud::Dataflow::V1beta3::Snapshot.
p result

#update_job

def update_job(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::Job
def update_job(project_id: nil, job_id: nil, job: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::Job

Updates the state of an existing Cloud Dataflow job.

To update the state of an existing job, we recommend using projects.locations.jobs.update with a regional endpoint. Using projects.jobs.update is not recommended, as you can only update the state of jobs that are running in us-central1.

Overloads
def update_job(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::Job
Pass arguments to update_job via a request object, either of type UpdateJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataflow::V1beta3::UpdateJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_job(project_id: nil, job_id: nil, job: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::Job
Pass arguments to update_job via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • project_id (::String) — The ID of the Cloud Platform project that the job belongs to.
  • job_id (::String) — The job ID.
  • job (::Google::Cloud::Dataflow::V1beta3::Job, ::Hash) — The updated job. Only the job state is updatable; other fields will be ignored.
  • location (::String) — The regional endpoint that contains this job.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::UpdateJobRequest.new

# Call the update_job method.
result = client.update_job request

# The returned object is of type Google::Cloud::Dataflow::V1beta3::Job.
p result