Cloud Dataproc V1 API - Class Google::Cloud::Dataproc::V1::ClusterController::Rest::Client (v0.24.1)

Reference documentation and code samples for the Cloud Dataproc V1 API class Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.

REST client for the ClusterController service.

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

Inherits

  • Object

Methods

.configure

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

Configure the ClusterController 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 ClusterController clients
::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.configuredo|config|
config.timeout=10.0
end

#configure

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

Configure the ClusterController 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_cluster

defcreate_cluster(request,options=nil)->::Gapic::Operation
defcreate_cluster(project_id:nil,region:nil,cluster:nil,request_id:nil,action_on_failed_primary_workers:nil)->::Gapic::Operation

Creates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata.

Overloads
defcreate_cluster(request,options=nil)->::Gapic::Operation
Pass arguments to create_cluster via a request object, either of type Google::Cloud::Dataproc::V1::CreateClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::CreateClusterRequest, ::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.
defcreate_cluster(project_id:nil,region:nil,cluster:nil,request_id:nil,action_on_failed_primary_workers:nil)->::Gapic::Operation
Pass arguments to create_cluster 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) — Required. The ID of the Google Cloud Platform project that the cluster belongs to.
  • region (::String) — Required. The Dataproc region in which to handle the request.
  • cluster (::Google::Cloud::Dataproc::V1::Cluster, ::Hash) — Required. The cluster to create.
  • request_id (::String) — Optional. A unique ID used to identify the request. If the server receives two CreateClusterRequests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.

    It is recommended to always set this value to a UUID.

    The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

  • action_on_failed_primary_workers (::Google::Cloud::Dataproc::V1::FailureAction) — Optional. Failure action when primary worker creation fails.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require"google/cloud/dataproc/v1"
# Create a client object. The client can be reused for multiple calls.
client=Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new
# Create a request. To set request fields, pass in keyword arguments.
request=Google::Cloud::Dataproc::V1::CreateClusterRequest.new
# Call the create_cluster method.
result=client.create_clusterrequest
# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done!timeout:60
ifresult.response?
presult.response
else
puts"No response received."
end

#delete_cluster

defdelete_cluster(request,options=nil)->::Gapic::Operation
defdelete_cluster(project_id:nil,region:nil,cluster_name:nil,cluster_uuid:nil,request_id:nil)->::Gapic::Operation

Deletes a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata.

Overloads
defdelete_cluster(request,options=nil)->::Gapic::Operation
Pass arguments to delete_cluster via a request object, either of type DeleteClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::DeleteClusterRequest, ::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.
defdelete_cluster(project_id:nil,region:nil,cluster_name:nil,cluster_uuid:nil,request_id:nil)->::Gapic::Operation
Pass arguments to delete_cluster 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) — Required. The ID of the Google Cloud Platform project that the cluster belongs to.
  • region (::String) — Required. The Dataproc region in which to handle the request.
  • cluster_name (::String) — Required. The cluster name.
  • cluster_uuid (::String) — Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist.
  • request_id (::String) — Optional. A unique ID used to identify the request. If the server receives two DeleteClusterRequests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.

    It is recommended to always set this value to a UUID.

    The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require"google/cloud/dataproc/v1"
# Create a client object. The client can be reused for multiple calls.
client=Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new
# Create a request. To set request fields, pass in keyword arguments.
request=Google::Cloud::Dataproc::V1::DeleteClusterRequest.new
# Call the delete_cluster method.
result=client.delete_clusterrequest
# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done!timeout:60
ifresult.response?
presult.response
else
puts"No response received."
end

#diagnose_cluster

defdiagnose_cluster(request,options=nil)->::Gapic::Operation
defdiagnose_cluster(project_id:nil,region:nil,cluster_name:nil,tarball_gcs_dir:nil,diagnosis_interval:nil,jobs:nil,yarn_application_ids:nil)->::Gapic::Operation

Gets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata. After the operation completes, Operation.response contains DiagnoseClusterResults.

Overloads
defdiagnose_cluster(request,options=nil)->::Gapic::Operation
Pass arguments to diagnose_cluster via a request object, either of type DiagnoseClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest, ::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.
defdiagnose_cluster(project_id:nil,region:nil,cluster_name:nil,tarball_gcs_dir:nil,diagnosis_interval:nil,jobs:nil,yarn_application_ids:nil)->::Gapic::Operation
Pass arguments to diagnose_cluster 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) — Required. The ID of the Google Cloud Platform project that the cluster belongs to.
  • region (::String) — Required. The Dataproc region in which to handle the request.
  • cluster_name (::String) — Required. The cluster name.
  • tarball_gcs_dir (::String) — Optional. The output Cloud Storage directory for the diagnostic tarball. If not specified, a task-specific directory in the cluster's staging bucket will be used.
  • diagnosis_interval (::Google::Type::Interval, ::Hash) — Optional. Time interval in which diagnosis should be carried out on the cluster.
  • jobs (::Array<::String>) — Optional. Specifies a list of jobs on which diagnosis is to be performed. Format: projects/{project}/regions/{region}/jobs/{job}
  • yarn_application_ids (::Array<::String>) — Optional. Specifies a list of yarn applications on which diagnosis is to be performed.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require"google/cloud/dataproc/v1"
# Create a client object. The client can be reused for multiple calls.
client=Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new
# Create a request. To set request fields, pass in keyword arguments.
request=Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new
# Call the diagnose_cluster method.
result=client.diagnose_clusterrequest
# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done!timeout:60
ifresult.response?
presult.response
else
puts"No response received."
end

#get_cluster

defget_cluster(request,options=nil)->::Google::Cloud::Dataproc::V1::Cluster
defget_cluster(project_id:nil,region:nil,cluster_name:nil)->::Google::Cloud::Dataproc::V1::Cluster

Gets the resource representation for a cluster in a project.

Overloads
defget_cluster(request,options=nil)->::Google::Cloud::Dataproc::V1::Cluster
Pass arguments to get_cluster via a request object, either of type GetClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::GetClusterRequest, ::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.
defget_cluster(project_id:nil,region:nil,cluster_name:nil)->::Google::Cloud::Dataproc::V1::Cluster
Pass arguments to get_cluster 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) — Required. The ID of the Google Cloud Platform project that the cluster belongs to.
  • region (::String) — Required. The Dataproc region in which to handle the request.
  • cluster_name (::String) — Required. The cluster name.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require"google/cloud/dataproc/v1"
# Create a client object. The client can be reused for multiple calls.
client=Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new
# Create a request. To set request fields, pass in keyword arguments.
request=Google::Cloud::Dataproc::V1::GetClusterRequest.new
# Call the get_cluster method.
result=client.get_clusterrequest
# The returned object is of type Google::Cloud::Dataproc::V1::Cluster.
presult

#iam_policy_client

defiam_policy_client()->Google::Iam::V1::IAMPolicy::Rest::Client

Get the associated client for mix-in of the IAMPolicy.

Returns
  • (Google::Iam::V1::IAMPolicy::Rest::Client)

#initialize

definitialize(){|config|...}->Client

Create a new ClusterController REST client object.

Yields
  • (config) — Configure the ClusterController client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client=::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new
# Create a client using a custom configuration
client=::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.newdo|config|
config.timeout=10.0
end

#list_clusters

deflist_clusters(request,options=nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>
deflist_clusters(project_id:nil,region:nil,filter:nil,page_size:nil,page_token:nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>

Lists all regions/{region}/clusters in a project alphabetically.

Overloads
deflist_clusters(request,options=nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>
Pass arguments to list_clusters via a request object, either of type ListClustersRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::ListClustersRequest, ::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.
deflist_clusters(project_id:nil,region:nil,filter:nil,page_size:nil,page_token:nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>
Pass arguments to list_clusters 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) — Required. The ID of the Google Cloud Platform project that the cluster belongs to.
  • region (::String) — Required. The Dataproc region in which to handle the request.
  • filter (::String) — Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:

    field = value [AND [field = value]] ...

    where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.

    Example filter:

    status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *

  • page_size (::Integer) — Optional. The standard List page size.
  • page_token (::String) — Optional. The standard List page token.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require"google/cloud/dataproc/v1"
# Create a client object. The client can be reused for multiple calls.
client=Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new
# Create a request. To set request fields, pass in keyword arguments.
request=Google::Cloud::Dataproc::V1::ListClustersRequest.new
# Call the list_clusters method.
result=client.list_clustersrequest
# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.eachdo|item|
# Each element is of type ::Google::Cloud::Dataproc::V1::Cluster.
pitem
end

#operations_client

defoperations_client()->::Google::Cloud::Dataproc::V1::ClusterController::Rest::Operations

Get the associated client for long-running operations.

#start_cluster

defstart_cluster(request,options=nil)->::Gapic::Operation
defstart_cluster(project_id:nil,region:nil,cluster_name:nil,cluster_uuid:nil,request_id:nil)->::Gapic::Operation

Starts a cluster in a project.

Overloads
defstart_cluster(request,options=nil)->::Gapic::Operation
Pass arguments to start_cluster via a request object, either of type StartClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::StartClusterRequest, ::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.
defstart_cluster(project_id:nil,region:nil,cluster_name:nil,cluster_uuid:nil,request_id:nil)->::Gapic::Operation
Pass arguments to start_cluster 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) — Required. The ID of the Google Cloud Platform project the cluster belongs to.
  • region (::String) — Required. The Dataproc region in which to handle the request.
  • cluster_name (::String) — Required. The cluster name.
  • cluster_uuid (::String) — Optional. Specifying the cluster_uuid means the RPC will fail (with error NOT_FOUND) if a cluster with the specified UUID does not exist.
  • request_id (::String) — Optional. A unique ID used to identify the request. If the server receives two StartClusterRequests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.

    Recommendation: Set this value to a UUID.

    The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require"google/cloud/dataproc/v1"
# Create a client object. The client can be reused for multiple calls.
client=Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new
# Create a request. To set request fields, pass in keyword arguments.
request=Google::Cloud::Dataproc::V1::StartClusterRequest.new
# Call the start_cluster method.
result=client.start_clusterrequest
# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done!timeout:60
ifresult.response?
presult.response
else
puts"No response received."
end

#stop_cluster

defstop_cluster(request,options=nil)->::Gapic::Operation
defstop_cluster(project_id:nil,region:nil,cluster_name:nil,cluster_uuid:nil,request_id:nil)->::Gapic::Operation

Stops a cluster in a project.

Overloads
defstop_cluster(request,options=nil)->::Gapic::Operation
Pass arguments to stop_cluster via a request object, either of type StopClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::StopClusterRequest, ::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.
defstop_cluster(project_id:nil,region:nil,cluster_name:nil,cluster_uuid:nil,request_id:nil)->::Gapic::Operation
Pass arguments to stop_cluster 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) — Required. The ID of the Google Cloud Platform project the cluster belongs to.
  • region (::String) — Required. The Dataproc region in which to handle the request.
  • cluster_name (::String) — Required. The cluster name.
  • cluster_uuid (::String) — Optional. Specifying the cluster_uuid means the RPC will fail (with error NOT_FOUND) if a cluster with the specified UUID does not exist.
  • request_id (::String) — Optional. A unique ID used to identify the request. If the server receives two StopClusterRequests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.

    Recommendation: Set this value to a UUID.

    The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require"google/cloud/dataproc/v1"
# Create a client object. The client can be reused for multiple calls.
client=Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new
# Create a request. To set request fields, pass in keyword arguments.
request=Google::Cloud::Dataproc::V1::StopClusterRequest.new
# Call the stop_cluster method.
result=client.stop_clusterrequest
# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done!timeout:60
ifresult.response?
presult.response
else
puts"No response received."
end

#universe_domain

defuniverse_domain()->String

The effective universe domain

Returns
  • (String)

#update_cluster

defupdate_cluster(request,options=nil)->::Gapic::Operation
defupdate_cluster(project_id:nil,region:nil,cluster_name:nil,cluster:nil,graceful_decommission_timeout:nil,update_mask:nil,request_id:nil)->::Gapic::Operation

Updates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata. The cluster must be in a RUNNING state or an error is returned.

Overloads
defupdate_cluster(request,options=nil)->::Gapic::Operation
Pass arguments to update_cluster via a request object, either of type UpdateClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1::UpdateClusterRequest, ::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.
defupdate_cluster(project_id:nil,region:nil,cluster_name:nil,cluster:nil,graceful_decommission_timeout:nil,update_mask:nil,request_id:nil)->::Gapic::Operation
Pass arguments to update_cluster 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) — Required. The ID of the Google Cloud Platform project the cluster belongs to.
  • region (::String) — Required. The Dataproc region in which to handle the request.
  • cluster_name (::String) — Required. The cluster name.
  • cluster (::Google::Cloud::Dataproc::V1::Cluster, ::Hash) — Required. The changes to the cluster.
  • graceful_decommission_timeout (::Google::Protobuf::Duration, ::Hash) — Optional. Timeout for graceful YARN decommissioning. Graceful decommissioning allows removing nodes from the cluster without interrupting jobs in progress. Timeout specifies how long to wait for jobs in progress to finish before forcefully removing nodes (and potentially interrupting jobs). Default timeout is 0 (for forceful decommission), and the maximum allowed timeout is 1 day. (see JSON representation of Duration).

    Only supported on Dataproc image versions 1.2 and higher.

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows:
    {
     "config":{
     "workerConfig":{
     "numInstances":"5"
     }
     }
    }
    

    Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows:

    {
     "config":{
     "secondaryWorkerConfig":{
     "numInstances":"5"
     }
     }
    }
    

    Note: Currently, only the following fields can be updated:

    Mask Purpose
    labels Update labels
    config.worker_config.num_instances Resize primary worker group
    config.secondary_worker_config.num_instances Resize secondary worker group
    config.autoscaling_config.policy_uri Use, stop using, or change autoscaling policies
  • request_id (::String) — Optional. A unique ID used to identify the request. If the server receives two UpdateClusterRequests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.

    It is recommended to always set this value to a UUID.

    The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require"google/cloud/dataproc/v1"
# Create a client object. The client can be reused for multiple calls.
client=Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new
# Create a request. To set request fields, pass in keyword arguments.
request=Google::Cloud::Dataproc::V1::UpdateClusterRequest.new
# Call the update_cluster method.
result=client.update_clusterrequest
# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done!timeout:60
ifresult.response?
presult.response
else
puts"No response received."
end

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.