Reference documentation and code samples for the Capacity Planner V1BETA API class Google::Cloud::CapacityPlanner::V1beta::CapacityPlanningService::Rest::Client.
REST client for the CapacityPlanningService service.
This API allows users to plan for GCP capacity associated with their projects. Users can request additional capacity for GCP resources such as VMs, PDs, etc.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the CapacityPlanningService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all CapacityPlanningService clients ::Google::Cloud::CapacityPlanner::V1beta::CapacityPlanningService::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the CapacityPlanningService 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)
#get_capacity_plan
def get_capacity_plan(request, options = nil) -> ::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan
def get_capacity_plan(name: nil) -> ::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan
Returns information about the capacity plan.
def get_capacity_plan(request, options = nil) -> ::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan
get_capacity_plan
via a request object, either of type
GetCapacityPlanRequest or an equivalent Hash.
- request (::Google::Cloud::CapacityPlanner::V1beta::GetCapacityPlanRequest, ::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_capacity_plan(name: nil) -> ::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan
get_capacity_plan
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 name of the capacity plan to retrieve. Format: projects/{project}/capacityPlans/{capacity_plan}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/capacity_planner/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::CapacityPlanner::V1beta::CapacityPlanningService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CapacityPlanner::V1beta::GetCapacityPlanRequest.new # Call the get_capacity_plan method. result = client.get_capacity_plan request # The returned object is of type Google::Cloud::CapacityPlanner::V1beta::CapacityPlan. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new CapacityPlanningService REST client object.
- (config) — Configure the CapacityPlanningService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::CapacityPlanner::V1beta::CapacityPlanningService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::CapacityPlanner::V1beta::CapacityPlanningService::Rest::Client.new do |config| config.timeout = 10.0 end
#logger
def logger() -> Logger
The logger used for request/response debug logging.
- (Logger)
#query_capacity_plan_insights
def query_capacity_plan_insights(request, options = nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryCapacityPlanInsightsResponse
def query_capacity_plan_insights(parent: nil, capacity_plan_filters: nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryCapacityPlanInsightsResponse
Query capacity plan insights that are in the parent parameter and match your specified filters.
def query_capacity_plan_insights(request, options = nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryCapacityPlanInsightsResponse
query_capacity_plan_insights
via a request object, either of type
QueryCapacityPlanInsightsRequest or an equivalent Hash.
- request (::Google::Cloud::CapacityPlanner::V1beta::QueryCapacityPlanInsightsRequest, ::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 query_capacity_plan_insights(parent: nil, capacity_plan_filters: nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryCapacityPlanInsightsResponse
query_capacity_plan_insights
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 parent resource container. Format: projects/{project}
- capacity_plan_filters (::Google::Cloud::CapacityPlanner::V1beta::CapacityPlanFilters, ::Hash) — Required. The filters to apply to the capacity plan.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::CapacityPlanner::V1beta::QueryCapacityPlanInsightsResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/capacity_planner/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::CapacityPlanner::V1beta::CapacityPlanningService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CapacityPlanner::V1beta::QueryCapacityPlanInsightsRequest.new # Call the query_capacity_plan_insights method. result = client.query_capacity_plan_insights request # The returned object is of type Google::Cloud::CapacityPlanner::V1beta::QueryCapacityPlanInsightsResponse. p result
#query_capacity_plans
def query_capacity_plans(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan>
def query_capacity_plans(parent: nil, page_size: nil, page_token: nil, location: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan>
Returns a list of the capacity plans that are in the parent parameter and match your specified filters. (The maximum list length is limited by the pageSize parameter.)
def query_capacity_plans(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan>
query_capacity_plans
via a request object, either of type
QueryCapacityPlansRequest or an equivalent Hash.
- request (::Google::Cloud::CapacityPlanner::V1beta::QueryCapacityPlansRequest, ::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 query_capacity_plans(parent: nil, page_size: nil, page_token: nil, location: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan>
query_capacity_plans
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 parent resource container. Format: projects/{project} or folders/{folder} or organizations/{organization}
- page_size (::Integer) — Optional. The maximum number of plans to return per page. The service may return fewer than this value. If unspecified, the server will use a sensible default. The maximum value is 1000; values above 1000 will be coerced to 1000.
-
page_token (::String) — Optional. A page token, received from a previous
QueryCapacityPlans
call. Provide this to retrieve the subsequent page. - location (::String) — Optional. The Google Cloud Platform location of capacity plans. If unspecified, all locations will be included.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::CapacityPlanner::V1beta::CapacityPlan>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/capacity_planner/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::CapacityPlanner::V1beta::CapacityPlanningService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CapacityPlanner::V1beta::QueryCapacityPlansRequest.new # Call the query_capacity_plans method. result = client.query_capacity_plans 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::CapacityPlanner::V1beta::CapacityPlan. p item end
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)