Module: Google::Cloud::Dataproc

Defined in:
lib/google/cloud/dataproc.rb,
lib/google/cloud/dataproc/version.rb

Constant Summary collapse

VERSION =
"2.7.0"

Class Method Summary collapse

Class Method Details

.autoscaling_policy_service(version: :v1, transport: :grpc, &block) ⇒ ::Object

Create a new client object for AutoscalingPolicyService.

By default, this returns an instance of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client for a gRPC client for version V1 of the API. However, you can specify a different API version by passing it in the version parameter. If the AutoscalingPolicyService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the AutoscalingPolicyService service. You can determine whether the method will succeed by calling autoscaling_policy_service_available?.

About AutoscalingPolicyService

The API interface for managing autoscaling policies in the Dataproc API.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/google/cloud/dataproc.rb', line 76

def self.autoscaling_policy_service version: :v1, transport: :grpc, &block
  require "google/cloud/dataproc/#{version.to_s.downcase}"

  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Cloud::Dataproc.const_get(package_name).const_get(:AutoscalingPolicyService)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.autoscaling_policy_service_available?(version: :v1, transport: :grpc) ⇒ boolean

Determines whether the AutoscalingPolicyService service is supported by the current client. If true, you can retrieve a client object by calling autoscaling_policy_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the AutoscalingPolicyService service, or if the versioned client gem needs an update to support the AutoscalingPolicyService service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/google/cloud/dataproc.rb', line 100

def self.autoscaling_policy_service_available? version: :v1, transport: :grpc
  require "google/cloud/dataproc/#{version.to_s.downcase}"
  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Cloud::Dataproc.const_get package_name
  return false unless service_module.const_defined? :AutoscalingPolicyService
  service_module = service_module.const_get :AutoscalingPolicyService
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end

.batch_controller(version: :v1, transport: :grpc, &block) ⇒ ::Object

Create a new client object for BatchController.

By default, this returns an instance of Google::Cloud::Dataproc::V1::BatchController::Client for a gRPC client for version V1 of the API. However, you can specify a different API version by passing it in the version parameter. If the BatchController service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the BatchController service. You can determine whether the method will succeed by calling batch_controller_available?.

About BatchController

The BatchController provides methods to manage batch workloads.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



146
147
148
149
150
151
152
153
154
155
156
# File 'lib/google/cloud/dataproc.rb', line 146

def self.batch_controller version: :v1, transport: :grpc, &block
  require "google/cloud/dataproc/#{version.to_s.downcase}"

  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Cloud::Dataproc.const_get(package_name).const_get(:BatchController)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.batch_controller_available?(version: :v1, transport: :grpc) ⇒ boolean

Determines whether the BatchController service is supported by the current client. If true, you can retrieve a client object by calling batch_controller. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the BatchController service, or if the versioned client gem needs an update to support the BatchController service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/google/cloud/dataproc.rb', line 170

def self.batch_controller_available? version: :v1, transport: :grpc
  require "google/cloud/dataproc/#{version.to_s.downcase}"
  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Cloud::Dataproc.const_get package_name
  return false unless service_module.const_defined? :BatchController
  service_module = service_module.const_get :BatchController
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end

.cluster_controller(version: :v1, transport: :grpc, &block) ⇒ ::Object

Create a new client object for ClusterController.

By default, this returns an instance of Google::Cloud::Dataproc::V1::ClusterController::Client for a gRPC client for version V1 of the API. However, you can specify a different API version by passing it in the version parameter. If the ClusterController service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the ClusterController service. You can determine whether the method will succeed by calling cluster_controller_available?.

About ClusterController

The ClusterControllerService provides methods to manage clusters of Compute Engine instances.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



217
218
219
220
221
222
223
224
225
226
227
# File 'lib/google/cloud/dataproc.rb', line 217

def self.cluster_controller version: :v1, transport: :grpc, &block
  require "google/cloud/dataproc/#{version.to_s.downcase}"

  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Cloud::Dataproc.const_get(package_name).const_get(:ClusterController)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.cluster_controller_available?(version: :v1, transport: :grpc) ⇒ boolean

Determines whether the ClusterController service is supported by the current client. If true, you can retrieve a client object by calling cluster_controller. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ClusterController service, or if the versioned client gem needs an update to support the ClusterController service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/google/cloud/dataproc.rb', line 241

def self.cluster_controller_available? version: :v1, transport: :grpc
  require "google/cloud/dataproc/#{version.to_s.downcase}"
  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Cloud::Dataproc.const_get package_name
  return false unless service_module.const_defined? :ClusterController
  service_module = service_module.const_get :ClusterController
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end

.configure {|::Google::Cloud.configure.dataproc| ... } ⇒ ::Google::Cloud::Config

Configure the google-cloud-dataproc library.

The following configuration parameters are supported:

  • credentials (type: String, Hash, Google::Auth::Credentials) - The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object.
  • lib_name (type: String) - The library name as recorded in instrumentation and logging.
  • lib_version (type: String) - The library version as recorded in instrumentation and logging.
  • interceptors (type: Array<GRPC::ClientInterceptor>) - An array of interceptors that are run before calls are executed.
  • timeout (type: Numeric) - Default timeout in seconds.
  • metadata (type: Hash{Symbol=>String}) - Additional headers to be sent with the call.
  • retry_policy (type: Hash) - The retry policy. The value is a hash with the following keys:
    • :initial_delay (type: Numeric) - The initial delay in seconds.
    • :max_delay (type: Numeric) - The max delay in seconds.
    • :multiplier (type: Numeric) - The incremental backoff multiplier.
    • :retry_codes (type: Array<String>) - The error codes that should trigger a retry.

Yields:

Returns:

  • (::Google::Cloud::Config)

    The default configuration used by this library



640
641
642
643
644
# File 'lib/google/cloud/dataproc.rb', line 640

def self.configure
  yield ::Google::Cloud.configure.dataproc if block_given?

  ::Google::Cloud.configure.dataproc
end

.job_controller(version: :v1, transport: :grpc, &block) ⇒ ::Object

Create a new client object for JobController.

By default, this returns an instance of Google::Cloud::Dataproc::V1::JobController::Client for a gRPC client for version V1 of the API. However, you can specify a different API version by passing it in the version parameter. If the JobController service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the JobController service. You can determine whether the method will succeed by calling job_controller_available?.

About JobController

The JobController provides methods to manage jobs.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



287
288
289
290
291
292
293
294
295
296
297
# File 'lib/google/cloud/dataproc.rb', line 287

def self.job_controller version: :v1, transport: :grpc, &block
  require "google/cloud/dataproc/#{version.to_s.downcase}"

  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Cloud::Dataproc.const_get(package_name).const_get(:JobController)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.job_controller_available?(version: :v1, transport: :grpc) ⇒ boolean

Determines whether the JobController service is supported by the current client. If true, you can retrieve a client object by calling job_controller. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the JobController service, or if the versioned client gem needs an update to support the JobController service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/google/cloud/dataproc.rb', line 311

def self.job_controller_available? version: :v1, transport: :grpc
  require "google/cloud/dataproc/#{version.to_s.downcase}"
  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Cloud::Dataproc.const_get package_name
  return false unless service_module.const_defined? :JobController
  service_module = service_module.const_get :JobController
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end

.node_group_controller(version: :v1, transport: :grpc, &block) ⇒ ::Object

Create a new client object for NodeGroupController.

By default, this returns an instance of Google::Cloud::Dataproc::V1::NodeGroupController::Client for a gRPC client for version V1 of the API. However, you can specify a different API version by passing it in the version parameter. If the NodeGroupController service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the NodeGroupController service. You can determine whether the method will succeed by calling node_group_controller_available?.

About NodeGroupController

The NodeGroupControllerService provides methods to manage node groups of Compute Engine managed instances.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



358
359
360
361
362
363
364
365
366
367
368
# File 'lib/google/cloud/dataproc.rb', line 358

def self.node_group_controller version: :v1, transport: :grpc, &block
  require "google/cloud/dataproc/#{version.to_s.downcase}"

  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Cloud::Dataproc.const_get(package_name).const_get(:NodeGroupController)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.node_group_controller_available?(version: :v1, transport: :grpc) ⇒ boolean

Determines whether the NodeGroupController service is supported by the current client. If true, you can retrieve a client object by calling node_group_controller. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the NodeGroupController service, or if the versioned client gem needs an update to support the NodeGroupController service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/google/cloud/dataproc.rb', line 382

def self.node_group_controller_available? version: :v1, transport: :grpc
  require "google/cloud/dataproc/#{version.to_s.downcase}"
  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Cloud::Dataproc.const_get package_name
  return false unless service_module.const_defined? :NodeGroupController
  service_module = service_module.const_get :NodeGroupController
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end

.session_controller(version: :v1, transport: :grpc, &block) ⇒ ::Object

Create a new client object for SessionController.

By default, this returns an instance of Google::Cloud::Dataproc::V1::SessionController::Client for a gRPC client for version V1 of the API. However, you can specify a different API version by passing it in the version parameter. If the SessionController service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the SessionController service. You can determine whether the method will succeed by calling session_controller_available?.

About SessionController

The SessionController provides methods to manage interactive sessions.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



428
429
430
431
432
433
434
435
436
437
438
# File 'lib/google/cloud/dataproc.rb', line 428

def self.session_controller version: :v1, transport: :grpc, &block
  require "google/cloud/dataproc/#{version.to_s.downcase}"

  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Cloud::Dataproc.const_get(package_name).const_get(:SessionController)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.session_controller_available?(version: :v1, transport: :grpc) ⇒ boolean

Determines whether the SessionController service is supported by the current client. If true, you can retrieve a client object by calling session_controller. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the SessionController service, or if the versioned client gem needs an update to support the SessionController service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/google/cloud/dataproc.rb', line 452

def self.session_controller_available? version: :v1, transport: :grpc
  require "google/cloud/dataproc/#{version.to_s.downcase}"
  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Cloud::Dataproc.const_get package_name
  return false unless service_module.const_defined? :SessionController
  service_module = service_module.const_get :SessionController
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end

.session_template_controller(version: :v1, transport: :grpc, &block) ⇒ ::Object

Create a new client object for SessionTemplateController.

By default, this returns an instance of Google::Cloud::Dataproc::V1::SessionTemplateController::Client for a gRPC client for version V1 of the API. However, you can specify a different API version by passing it in the version parameter. If the SessionTemplateController service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the SessionTemplateController service. You can determine whether the method will succeed by calling session_template_controller_available?.

About SessionTemplateController

The SessionTemplateController provides methods to manage session templates.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



498
499
500
501
502
503
504
505
506
507
508
# File 'lib/google/cloud/dataproc.rb', line 498

def self.session_template_controller version: :v1, transport: :grpc, &block
  require "google/cloud/dataproc/#{version.to_s.downcase}"

  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Cloud::Dataproc.const_get(package_name).const_get(:SessionTemplateController)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.session_template_controller_available?(version: :v1, transport: :grpc) ⇒ boolean

Determines whether the SessionTemplateController service is supported by the current client. If true, you can retrieve a client object by calling session_template_controller. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the SessionTemplateController service, or if the versioned client gem needs an update to support the SessionTemplateController service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/google/cloud/dataproc.rb', line 522

def self.session_template_controller_available? version: :v1, transport: :grpc
  require "google/cloud/dataproc/#{version.to_s.downcase}"
  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Cloud::Dataproc.const_get package_name
  return false unless service_module.const_defined? :SessionTemplateController
  service_module = service_module.const_get :SessionTemplateController
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end

.workflow_template_service(version: :v1, transport: :grpc, &block) ⇒ ::Object

Create a new client object for WorkflowTemplateService.

By default, this returns an instance of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client for a gRPC client for version V1 of the API. However, you can specify a different API version by passing it in the version parameter. If the WorkflowTemplateService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the WorkflowTemplateService service. You can determine whether the method will succeed by calling workflow_template_service_available?.

About WorkflowTemplateService

The API interface for managing Workflow Templates in the Dataproc API.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



569
570
571
572
573
574
575
576
577
578
579
# File 'lib/google/cloud/dataproc.rb', line 569

def self.workflow_template_service version: :v1, transport: :grpc, &block
  require "google/cloud/dataproc/#{version.to_s.downcase}"

  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Cloud::Dataproc.const_get(package_name).const_get(:WorkflowTemplateService)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.workflow_template_service_available?(version: :v1, transport: :grpc) ⇒ boolean

Determines whether the WorkflowTemplateService service is supported by the current client. If true, you can retrieve a client object by calling workflow_template_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the WorkflowTemplateService service, or if the versioned client gem needs an update to support the WorkflowTemplateService service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1)

    The API version to connect to. Optional. Defaults to :v1.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
# File 'lib/google/cloud/dataproc.rb', line 593

def self.workflow_template_service_available? version: :v1, transport: :grpc
  require "google/cloud/dataproc/#{version.to_s.downcase}"
  package_name = Google::Cloud::Dataproc
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Cloud::Dataproc.const_get package_name
  return false unless service_module.const_defined? :WorkflowTemplateService
  service_module = service_module.const_get :WorkflowTemplateService
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end