lib/google/cloud/dataproc/v1/cluster_controller/client.rb in google-cloud-dataproc-v1-0.6.2 vs lib/google/cloud/dataproc/v1/cluster_controller/client.rb in google-cloud-dataproc-v1-0.6.3

- old
+ new

@@ -40,18 +40,17 @@ # Configure the ClusterController Client class. # # See {::Google::Cloud::Dataproc::V1::ClusterController::Client::Configuration} # for a description of the configuration fields. # - # ## Example + # @example # - # To modify the configuration for all ClusterController clients: + # # Modify the configuration for all ClusterController clients + # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config| + # config.timeout = 10.0 + # end # - # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config| - # config.timeout = 10.0 - # end - # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # @@ -123,24 +122,20 @@ end ## # Create a new ClusterController client object. # - # ## Examples + # @example # - # To create a new ClusterController client with the default - # configuration: + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new # - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + # config.timeout = 10.0 + # end # - # To create a new ClusterController client with a custom - # configuration: - # - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - # config.timeout = 10.0 - # end - # # @yield [config] Configure the ClusterController client. # @yieldparam config [Client::Configuration] # def initialize # These require statements are intentionally placed here to initialize @@ -155,14 +150,13 @@ # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials - # Use self-signed JWT if the scope and endpoint are unchanged from default, + # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.scope == Client.configure.scope && - @config.endpoint == Client.configure.endpoint && + enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope @@ -266,11 +260,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, metadata: metadata, retry_policy: @config.rpcs.create_cluster.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @cluster_controller_stub.call_rpc :create_cluster, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? @@ -419,11 +415,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, metadata: metadata, retry_policy: @config.rpcs.update_cluster.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @cluster_controller_stub.call_rpc :update_cluster, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? @@ -509,11 +507,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.stop_cluster.timeout, metadata: metadata, retry_policy: @config.rpcs.stop_cluster.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @cluster_controller_stub.call_rpc :stop_cluster, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? @@ -599,11 +599,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.start_cluster.timeout, metadata: metadata, retry_policy: @config.rpcs.start_cluster.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @cluster_controller_stub.call_rpc :start_cluster, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? @@ -691,11 +693,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_cluster.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @cluster_controller_stub.call_rpc :delete_cluster, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? @@ -765,11 +769,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, metadata: metadata, retry_policy: @config.rpcs.get_cluster.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @cluster_controller_stub.call_rpc :get_cluster, request, options: options do |response, operation| yield response, operation if block_given? return response @@ -859,11 +865,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, metadata: metadata, retry_policy: @config.rpcs.list_clusters.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @cluster_controller_stub.call_rpc :list_clusters, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cluster_controller_stub, :list_clusters, request, response, operation, options yield response, operation if block_given? @@ -939,11 +947,13 @@ metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.diagnose_cluster.timeout, metadata: metadata, retry_policy: @config.rpcs.diagnose_cluster.retry_policy - options.apply_defaults metadata: @config.metadata, + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, retry_policy: @config.retry_policy @cluster_controller_stub.call_rpc :diagnose_cluster, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? @@ -964,25 +974,24 @@ # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. # - # # Examples + # @example # - # To modify the global config, setting the timeout for create_cluster - # to 20 seconds, and all remaining timeouts to 10 seconds: + # # Modify the global config, setting the timeout for + # # create_cluster to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_cluster.timeout = 20.0 + # end # - # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_cluster.timeout = 20.0 - # end - # - # To apply the above configuration only to a new client: - # - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_cluster.timeout = 20.0 - # end + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_cluster.timeout = 20.0 + # end # # @!attribute [rw] endpoint # The hostname or hostname:port of the service endpoint. # Defaults to `"dataproc.googleapis.com"`. # @return [::String]