Reference documentation and code samples for the Cloud Dataproc V1 API class Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.
REST client for the AutoscalingPolicyService service.
The API interface for managing autoscaling policies in the Dataproc API.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the AutoscalingPolicyService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all AutoscalingPolicyService clients ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the AutoscalingPolicyService 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_autoscaling_policy
def create_autoscaling_policy(request, options = nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
def create_autoscaling_policy(parent: nil, policy: nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
Creates new autoscaling policy.
def create_autoscaling_policy(request, options = nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
create_autoscaling_policy
via a request object, either of type
CreateAutoscalingPolicyRequest or an equivalent Hash.
- request (::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest, ::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_autoscaling_policy(parent: nil, policy: nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
create_autoscaling_policy
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).
-
parent (::String) —
Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
For
projects.regions.autoscalingPolicies.create
, the resource name of the region has the following format:projects/{project_id}/regions/{region}
For
projects.locations.autoscalingPolicies.create
, the resource name of the location has the following format:projects/{project_id}/locations/{location}
- policy (::Google::Cloud::Dataproc::V1::AutoscalingPolicy, ::Hash) — Required. The autoscaling policy to create.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dataproc::V1::AutoscalingPolicy)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/dataproc/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new # Call the create_autoscaling_policy method. result = client.create_autoscaling_policy request # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. p result
#delete_autoscaling_policy
def delete_autoscaling_policy(request, options = nil) -> ::Google::Protobuf::Empty
def delete_autoscaling_policy(name: nil) -> ::Google::Protobuf::Empty
Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.
def delete_autoscaling_policy(request, options = nil) -> ::Google::Protobuf::Empty
delete_autoscaling_policy
via a request object, either of type
DeleteAutoscalingPolicyRequest or an equivalent Hash.
- request (::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest, ::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 delete_autoscaling_policy(name: nil) -> ::Google::Protobuf::Empty
delete_autoscaling_policy
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).
-
name (::String) —
Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.
For
projects.regions.autoscalingPolicies.delete
, the resource name of the policy has the following format:projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}
For
projects.locations.autoscalingPolicies.delete
, the resource name of the policy has the following format:projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/dataproc/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new # Call the delete_autoscaling_policy method. result = client.delete_autoscaling_policy request # The returned object is of type Google::Protobuf::Empty. p result
#get_autoscaling_policy
def get_autoscaling_policy(request, options = nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
def get_autoscaling_policy(name: nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
Retrieves autoscaling policy.
def get_autoscaling_policy(request, options = nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
get_autoscaling_policy
via a request object, either of type
GetAutoscalingPolicyRequest or an equivalent Hash.
- request (::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest, ::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_autoscaling_policy(name: nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
get_autoscaling_policy
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).
-
name (::String) —
Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.
For
projects.regions.autoscalingPolicies.get
, the resource name of the policy has the following format:projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}
For
projects.locations.autoscalingPolicies.get
, the resource name of the policy has the following format:projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dataproc::V1::AutoscalingPolicy)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/dataproc/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new # Call the get_autoscaling_policy method. result = client.get_autoscaling_policy request # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. p result
#iam_policy_client
def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Rest::Client
Get the associated client for mix-in of the IAMPolicy.
- (Google::Iam::V1::IAMPolicy::Rest::Client)
#initialize
def initialize() { |config| ... } -> Client
Create a new AutoscalingPolicyService REST client object.
- (config) — Configure the AutoscalingPolicyService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| config.timeout = 10.0 end
#list_autoscaling_policies
def list_autoscaling_policies(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>
def list_autoscaling_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>
Lists autoscaling policies in the project.
def list_autoscaling_policies(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>
list_autoscaling_policies
via a request object, either of type
ListAutoscalingPoliciesRequest or an equivalent Hash.
- request (::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest, ::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_autoscaling_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>
list_autoscaling_policies
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).
-
parent (::String) —
Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
For
projects.regions.autoscalingPolicies.list
, the resource name of the region has the following format:projects/{project_id}/regions/{region}
For
projects.locations.autoscalingPolicies.list
, the resource name of the location has the following format:projects/{project_id}/locations/{location}
- page_size (::Integer) — Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100.
- page_token (::String) — Optional. The page token, returned by a previous call, to request the next page of results.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/dataproc/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new # Call the list_autoscaling_policies method. result = client.list_autoscaling_policies request # 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.each do |item| # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy. p item end
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)
#update_autoscaling_policy
def update_autoscaling_policy(request, options = nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
def update_autoscaling_policy(policy: nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
Updates (replaces) autoscaling policy.
Disabled check for update_mask, because all updates will be full replacements.
def update_autoscaling_policy(request, options = nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
update_autoscaling_policy
via a request object, either of type
UpdateAutoscalingPolicyRequest or an equivalent Hash.
- request (::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest, ::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_autoscaling_policy(policy: nil) -> ::Google::Cloud::Dataproc::V1::AutoscalingPolicy
update_autoscaling_policy
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).
- policy (::Google::Cloud::Dataproc::V1::AutoscalingPolicy, ::Hash) — Required. The updated autoscaling policy.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dataproc::V1::AutoscalingPolicy)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/dataproc/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new # Call the update_autoscaling_policy method. result = client.update_autoscaling_policy request # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. p result