Reference documentation and code samples for the Capacity Planner V1BETA API class Google::Cloud::CapacityPlanner::V1beta::UsageService::Rest::Client.
REST client for the UsageService service.
Provides access to historical and forecasted usage data.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the UsageService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all UsageService clients ::Google::Cloud::CapacityPlanner::V1beta::UsageService::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the UsageService 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)
#export_forecasts
def export_forecasts(request, options = nil) -> ::Gapic::Operation
def export_forecasts(parent: nil, machine_family: nil, machine_shape: nil, disk_type: nil, gpu_type: nil, tpu_type: nil, resource_type: nil, prediction_interval: nil, aggregation_method: nil, start_date: nil, end_date: nil, output_config: nil) -> ::Gapic::OperationExports forecasted usage data requested by user into either an existing Cloud Storage bucket or a BigQuery table.
def export_forecasts(request, options = nil) -> ::Gapic::Operationexport_forecasts via a request object, either of type
ExportForecastsRequest or an equivalent Hash.
- request (::Google::Cloud::CapacityPlanner::V1beta::ExportForecastsRequest, ::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 export_forecasts(parent: nil, machine_family: nil, machine_shape: nil, disk_type: nil, gpu_type: nil, tpu_type: nil, resource_type: nil, prediction_interval: nil, aggregation_method: nil, start_date: nil, end_date: nil, output_config: nil) -> ::Gapic::Operationexport_forecasts 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 compute engine resource and location for the time series values to return. The format is: projects/{project}/locations/{location} or organizations/{organization}/locations/{location} or folders/{folder}/locations/{location}
-
machine_family (::String) — Optional. The machine family to use to select the
Forecastvalues to return. Possible values include "n1", and "n2d". - machine_shape (::Google::Cloud::CapacityPlanner::V1beta::MachineShape, ::Hash) — Optional. The machine shape for the time series values to export.
-
disk_type (::String) — Optional. The disk_type for the
Forecastvalues to return with request persistent-disk resource_type. -
gpu_type (::String) — Optional. The GPU type for the
Forecastvalues to return. Sample values are "nvidia-tesla-t4", and "nvidia-tesla-a100". See https://cloud.google.com/compute/docs/gpus for a list. Empty gpu_type will return results matching all GPUs. -
tpu_type (::String) — Optional. The TPU type for the
Forecastvalues to return. Empty tpu_type will return results matching all TPUs. -
resource_type (::String) — Required. The resource for the
Forecastvalues to return. Possible values include "gce-vcpus", "gce-ram", "gce-local-ssd", "gce-persistent-disk", "gce-gpu" and "gce-tpu". -
prediction_interval (::Google::Cloud::CapacityPlanner::V1beta::Forecast::PredictionInterval) — Optional. The prediction interval to use to select the
Forecastvalues to return. PREDICTION_INTERVAL_UNSPECIFIED will return results matching all prediction intervals. - aggregation_method (::Google::Cloud::CapacityPlanner::V1beta::UsageHistory::AggregationMethod) — Optional. Aggregation Method of the historical usage for which the forecast is generated.
- start_date (::Google::Type::Date, ::Hash) — Optional. The start date of forecasts.
- end_date (::Google::Type::Date, ::Hash) — Optional. The end date of forecasts.
- output_config (::Google::Cloud::CapacityPlanner::V1beta::OutputConfig, ::Hash) — Required. Output configuration indicating where the results will be output to.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::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::UsageService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CapacityPlanner::V1beta::ExportForecastsRequest.new # Call the export_forecasts method. result = client.export_forecasts request # 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 if result.response? p result.response else puts "No response received." end
#export_reservations_usage
def export_reservations_usage(request, options = nil) -> ::Gapic::Operation
def export_reservations_usage(machine_family: nil, machine_shape: nil, gpu_type: nil, parent: nil, location_level: nil, cloud_resource_type: nil, usage_aggregation_method: nil, share_type: nil, start_date: nil, end_date: nil, output_config: nil) -> ::Gapic::OperationExports reservations usage data requested by user into either an existing Cloud Storage bucket or a new/existing BigQuery table.
def export_reservations_usage(request, options = nil) -> ::Gapic::Operationexport_reservations_usage via a request object, either of type
ExportReservationsUsageRequest or an equivalent Hash.
- request (::Google::Cloud::CapacityPlanner::V1beta::ExportReservationsUsageRequest, ::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 export_reservations_usage(machine_family: nil, machine_shape: nil, gpu_type: nil, parent: nil, location_level: nil, cloud_resource_type: nil, usage_aggregation_method: nil, share_type: nil, start_date: nil, end_date: nil, output_config: nil) -> ::Gapic::Operationexport_reservations_usage 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).
-
machine_family (::String) — Optional. The machine family to query reservations and usage by. For
example: n1, n2d.
Note: The following parameters are mutually exclusive:
machine_family,machine_shape,gpu_type. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. -
machine_shape (::Google::Cloud::CapacityPlanner::V1beta::MachineShape, ::Hash) — Optional. The machine_shape as a filter to select matching reservations
and its usage.
Note: The following parameters are mutually exclusive:
machine_shape,machine_family,gpu_type. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. -
gpu_type (::String) — Optional. The GPU type to query reservations and usage by. For example:
NVIDIA T4.
Note: The following parameters are mutually exclusive:
gpu_type,machine_family,machine_shape. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - parent (::String) — Required. The compute engine resource and location of the reservationsusage. The format is: projects/{project}/locations/{location} or organizations/{organization}/locations/{location} or folders/{folder}/locations/{location}
- location_level (::Google::Cloud::CapacityPlanner::V1beta::TimeSeries::LocationType) — Optional. The location level of the reservations usage timeseries.
-
cloud_resource_type (::String) — Required. The resource for the
ReservationsUsagevalues to return. Possible values include "gce-vcpus", "gce-ram", "gce-local-ssd", and "gce-gpu". - usage_aggregation_method (::Google::Cloud::CapacityPlanner::V1beta::UsageHistory::AggregationMethod) — Required. The method that should be used to convert sampled reservations data to daily usage values.
- share_type (::Google::Cloud::CapacityPlanner::V1beta::ExportReservationsUsageRequest::ShareType) — Optional. Type of share settings to filter reservations in response. If unspecified, all types are included.
- start_date (::Google::Type::Date, ::Hash) — Optional. The start date of reservations usage.
- end_date (::Google::Type::Date, ::Hash) — Optional. The end date of reservations usage.
- output_config (::Google::Cloud::CapacityPlanner::V1beta::OutputConfig, ::Hash) — Required. Output configuration indicating where the results will be output to.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::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::UsageService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CapacityPlanner::V1beta::ExportReservationsUsageRequest.new # Call the export_reservations_usage method. result = client.export_reservations_usage request # 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 if result.response? p result.response else puts "No response received." end
#export_usage_histories
def export_usage_histories(request, options = nil) -> ::Gapic::Operation
def export_usage_histories(parent: nil, is_spot: nil, machine_family: nil, machine_shape: nil, disk_type: nil, gpu_type: nil, tpu_type: nil, resource_type: nil, usage_aggregation_method: nil, start_date: nil, end_date: nil, output_config: nil) -> ::Gapic::OperationExports historical usage data requested by user into either an existing Cloud Storage bucket or a BigQuery table.
def export_usage_histories(request, options = nil) -> ::Gapic::Operationexport_usage_histories via a request object, either of type
ExportUsageHistoriesRequest or an equivalent Hash.
- request (::Google::Cloud::CapacityPlanner::V1beta::ExportUsageHistoriesRequest, ::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 export_usage_histories(parent: nil, is_spot: nil, machine_family: nil, machine_shape: nil, disk_type: nil, gpu_type: nil, tpu_type: nil, resource_type: nil, usage_aggregation_method: nil, start_date: nil, end_date: nil, output_config: nil) -> ::Gapic::Operationexport_usage_histories 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 compute engine resource and location for the time series values to return. The format is: projects/{project}/locations/{location} or organizations/{organization}/locations/{location} or folders/{folder}/locations/{location}
- is_spot (::Boolean) — Optional. Set true to export usage for spot resources.
-
machine_family (::String) — Optional. The machine family for the
UsageHistoryvalues to return. Possible values include "n1", and "n2d". See https://cloud.google.com/compute/docs/machine-types for more examples. - machine_shape (::Google::Cloud::CapacityPlanner::V1beta::MachineShape, ::Hash) — Optional. The machine shape for the time series values to export.
-
disk_type (::String) — Optional. The disk_type for the
UsageHistoryvalues to return request with persistent-disk resource_type. Possible values include "pd-ssd", "pd-standard", "pd-balanced", and "pd-extreme". -
gpu_type (::String) — Optional. The GPU type for the
UsageHistoryvalues to return. Sample values are "nvidia-tesla-t4", and "nvidia-tesla-a100". See https://cloud.google.com/compute/docs/gpus for a list. Empty gpu_type will return results matching all GPUs. -
tpu_type (::String) — Optional. The TPU type for the
UsageHistoryvalues to return. Empty tpu_type will return results matching all TPUs. -
resource_type (::String) — Required. The resource for the
UsageHistoryvalues to return. Possible values include "gce-vcpus", "gce-ram", "gce-local-ssd", "gce-persistent-disk", "gce-gpu" and "gce-tpu". - usage_aggregation_method (::Google::Cloud::CapacityPlanner::V1beta::UsageHistory::AggregationMethod) — Optional. The method that should be used to convert sampled usage data to daily usage values. AGGREGATION_METHOD_UNSPECIFIED will return results matching all the aggregation methods.
- start_date (::Google::Type::Date, ::Hash) — Optional. The start date of usage.
- end_date (::Google::Type::Date, ::Hash) — Optional. The end date of usage.
- output_config (::Google::Cloud::CapacityPlanner::V1beta::OutputConfig, ::Hash) — Required. Output configuration indicating where the results will be output to.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::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::UsageService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CapacityPlanner::V1beta::ExportUsageHistoriesRequest.new # Call the export_usage_histories method. result = client.export_usage_histories request # 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 if result.response? p result.response else puts "No response received." end
#initialize
def initialize() { |config| ... } -> ClientCreate a new UsageService REST client object.
- (config) — Configure the UsageService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::CapacityPlanner::V1beta::UsageService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::CapacityPlanner::V1beta::UsageService::Rest::Client.new do |config| config.timeout = 10.0 end
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::CapacityPlanner::V1beta::UsageService::Rest::OperationsGet the associated client for long-running operations.
#query_forecasts
def query_forecasts(request, options = nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryForecastsResponse
def query_forecasts(parent: nil, machine_family: nil, machine_shape: nil, disk_type: nil, confidential_mode: nil, gpu_type: nil, tpu_type: nil, cloud_resource_type: nil, forecast_type: nil, prediction_interval: nil, aggregation_method: nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryForecastsResponseReturns a list of the forecasts that are in the parent parameter and match your specified filters.
def query_forecasts(request, options = nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryForecastsResponsequery_forecasts via a request object, either of type
QueryForecastsRequest or an equivalent Hash.
- request (::Google::Cloud::CapacityPlanner::V1beta::QueryForecastsRequest, ::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_forecasts(parent: nil, machine_family: nil, machine_shape: nil, disk_type: nil, confidential_mode: nil, gpu_type: nil, tpu_type: nil, cloud_resource_type: nil, forecast_type: nil, prediction_interval: nil, aggregation_method: nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryForecastsResponsequery_forecasts 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 compute engine resource and location for the time series
values to return. The format is:
projects/{project}/locations/{location} or organizations/{organization}/locations/{location} or folders/{folder}/locations/{location}
-
machine_family (::String) — The machine family to use to select the
Forecastvalues to return. Possible values include "n1", and "n2d". Empty machine_family will return results matching all machine families. - machine_shape (::Google::Cloud::CapacityPlanner::V1beta::MachineShape, ::Hash) — Optional. The machine shape for the time series values to return.
-
disk_type (::String) — Optional. The disk_type for the
Forecastvalues to return with request persistent-disk cloud_resource_type. Empty disk_type will return results matching all disk types. - confidential_mode (::Boolean) — Optional. Whether the persistent disk is in confidential mode.
-
gpu_type (::String) — Optional. The GPU type for the
Forecastvalues to return. Sample values are "nvidia-tesla-t4", and "nvidia-tesla-a100". See https://cloud.google.com/compute/docs/gpus for a list. Empty gpu_type will return results matching all GPUs. -
tpu_type (::String) — Optional. The TPU type for the
Forecastvalues to return. Empty tpu_type will return results matching all TPUs. -
cloud_resource_type (::String) — Required. The resource for the
Forecastvalues to return. Possible values include "gce-vcpus", "gce-ram", "gce-local-ssd", "gce-persistent-disk", "gce-gpu" and "gce-tpu". Empty cloud_resource_type will return results matching all resources. -
forecast_type (::Google::Cloud::CapacityPlanner::V1beta::Forecast::ForecastType) — The type of forecast to use to select the
Forecastvalues to return. FORECAST_TYPE_UNSPECIFIED will return results matching all the forecast types. -
prediction_interval (::Google::Cloud::CapacityPlanner::V1beta::Forecast::PredictionInterval) — The prediction interval to use to select the
Forecastvalues to return. PREDICTION_INTERVAL_UNSPECIFIED will return results matching all prediction intervals. - aggregation_method (::Google::Cloud::CapacityPlanner::V1beta::UsageHistory::AggregationMethod) — Aggregation Method of the historical usage for which the forecast is generated
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::CapacityPlanner::V1beta::QueryForecastsResponse)
- 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::UsageService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CapacityPlanner::V1beta::QueryForecastsRequest.new # Call the query_forecasts method. result = client.query_forecasts request # The returned object is of type Google::Cloud::CapacityPlanner::V1beta::QueryForecastsResponse. p result
#query_reservations
def query_reservations(request, options = nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryReservationsResponse
def query_reservations(parent: nil, location_level: nil, machine_family: nil, machine_shape: nil, gpu_type: nil, cloud_resource_type: nil, reservation_type: nil, share_type: nil, ownership_type: nil, reservation_data_level: nil, include_unapproved_reservations: nil, aggregation_method: nil, start_date: nil, end_date: nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryReservationsResponseReturns a list of the reservations that are in the parent parameter and match your specified filters.
def query_reservations(request, options = nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryReservationsResponsequery_reservations via a request object, either of type
QueryReservationsRequest or an equivalent Hash.
- request (::Google::Cloud::CapacityPlanner::V1beta::QueryReservationsRequest, ::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_reservations(parent: nil, location_level: nil, machine_family: nil, machine_shape: nil, gpu_type: nil, cloud_resource_type: nil, reservation_type: nil, share_type: nil, ownership_type: nil, reservation_data_level: nil, include_unapproved_reservations: nil, aggregation_method: nil, start_date: nil, end_date: nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryReservationsResponsequery_reservations 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 compute engine resource and location for the time series
values to return. The format is:
projects/{project}/locations/{location} or organizations/{organization}/locations/{location} or folders/{folder}/locations/{location}
- location_level (::Google::Cloud::CapacityPlanner::V1beta::TimeSeries::LocationType) — Optional. The location level of the reservations usage timeseries.
- machine_family (::String) — Optional. The machine family to use to select the aggregate reserved values to return. Possible values include "n1", and "n2d" etc. Empty machine_family will return results matching all machine families.
- machine_shape (::Google::Cloud::CapacityPlanner::V1beta::MachineShape, ::Hash) — Optional. The machine_shape as a filter to select matching reservations.
- gpu_type (::String) — Optional. The GPU type for the reserved values to return. Sample values are "nvidia-tesla-t4", and "nvidia-tesla-a100". See https://cloud.google.com/compute/docs/gpus for a list. Empty gpu_type will return results matching all GPUs.
- cloud_resource_type (::String) — Required. The resource for the reserved values to return. Possible values include "gce-vcpus", "gce-ram", "gce-local-ssd", "gce-gpu" and "gce-vm".
- reservation_type (::Google::Cloud::CapacityPlanner::V1beta::QueryReservationsRequest::ReservationType) — Required. The Reservation type for example, future reservation request and allocation. If unspecified, all types are included.
- share_type (::Google::Cloud::CapacityPlanner::V1beta::QueryReservationsRequest::ShareType) — Optional. Types of share settings to filter reservations in response. If unspecified, all types are included.
- ownership_type (::Google::Cloud::CapacityPlanner::V1beta::QueryReservationsRequest::OwnershipType) — Optional. Types of ownerships to filter reservations based on. In case of OWNED, it filters reservations which are owned by selected parent project/folder/organization. If unspecified, all types are included.
- reservation_data_level (::Google::Cloud::CapacityPlanner::V1beta::QueryReservationsRequest::ReservationDataLevel) — Required. Reservations output data format.
- include_unapproved_reservations (::Boolean) — Optional. Whether to include pending for approval reservations in the response. This field is only applicable for future reservations.
- aggregation_method (::Google::Cloud::CapacityPlanner::V1beta::UsageHistory::AggregationMethod) — Optional. Aggregation Method of the historical reservation usage
- start_date (::Google::Type::Date, ::Hash) — Optional. The start date of reservations usage.
- end_date (::Google::Type::Date, ::Hash) — Optional. The end date of reservations usage.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::CapacityPlanner::V1beta::QueryReservationsResponse)
- 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::UsageService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CapacityPlanner::V1beta::QueryReservationsRequest.new # Call the query_reservations method. result = client.query_reservations request # The returned object is of type Google::Cloud::CapacityPlanner::V1beta::QueryReservationsResponse. p result
#query_usage_histories
def query_usage_histories(request, options = nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryUsageHistoriesResponse
def query_usage_histories(parent: nil, location_level: nil, is_spot: nil, machine_family: nil, machine_shape: nil, disk_type: nil, confidential_mode: nil, gpu_type: nil, tpu_type: nil, cloud_resource_type: nil, usage_aggregation_method: nil, start_date: nil, end_date: nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryUsageHistoriesResponseReturns a list of the usage histories that are in the parent parameter and match your specified filters.
def query_usage_histories(request, options = nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryUsageHistoriesResponsequery_usage_histories via a request object, either of type
QueryUsageHistoriesRequest or an equivalent Hash.
- request (::Google::Cloud::CapacityPlanner::V1beta::QueryUsageHistoriesRequest, ::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_usage_histories(parent: nil, location_level: nil, is_spot: nil, machine_family: nil, machine_shape: nil, disk_type: nil, confidential_mode: nil, gpu_type: nil, tpu_type: nil, cloud_resource_type: nil, usage_aggregation_method: nil, start_date: nil, end_date: nil) -> ::Google::Cloud::CapacityPlanner::V1beta::QueryUsageHistoriesResponsequery_usage_histories 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 compute engine resource and location for the time series values to return. The format is:
projects/{project}/locations/{location} or organizations/{organization}/locations/{location} or folders/{folder}/locations/{location} - location_level (::Google::Cloud::CapacityPlanner::V1beta::TimeSeries::LocationType) — Optional. The location level of the reservations usage timeseries.
- is_spot (::Boolean) — Optional. The is_spot flag is used to fetch the usage data for preemptible Resources.
-
machine_family (::String) — The machine family for the
UsageHistoryvalues to return. Possible values include "n1", and "n2d". See https://cloud.google.com/compute/docs/machine-types for more examples. Empty machine_family will return results matching all machine families. -
machine_shape (::Google::Cloud::CapacityPlanner::V1beta::MachineShape, ::Hash) — Optional. The machine shape for the
UsageHistoryvalues to return. -
disk_type (::String) — Optional. The disk_type for the
UsageHistoryvalues to return request with persistent-disk cloud_resource_type. Empty disk_type will return results matching all disk types. - confidential_mode (::Boolean) — Optional. Whether the persistent disk is in confidential mode.
-
gpu_type (::String) — Optional. The GPU type for the
UsageHistoryvalues to return. Sample values are "nvidia-tesla-t4", and "nvidia-tesla-a100". See https://cloud.google.com/compute/docs/gpus for a list. Empty gpu_type will return results matching all GPUs. -
tpu_type (::String) — Optional. The TPU type for the
UsageHistoryvalues to return. Empty tpu_type will return results matching all TPUs. -
cloud_resource_type (::String) — Required. The resource for the
UsageHistoryvalues to return. Possible values include "gce-vcpus", "gce-ram", "gce-local-ssd", "gce-persistent-disk", "gce-gpu" and "gce-tpu". Empty cloud_resource_type will return results matching all resources. - usage_aggregation_method (::Google::Cloud::CapacityPlanner::V1beta::UsageHistory::AggregationMethod) — The method that should be used to convert sampled usage data to daily usage values. AGGREGATION_METHOD_UNSPECIFIED will return results matching all the aggregation methods.
- start_date (::Google::Type::Date, ::Hash) — Optional. The start date of reservations usage.
- end_date (::Google::Type::Date, ::Hash) — Optional. The end date of reservations usage.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::CapacityPlanner::V1beta::QueryUsageHistoriesResponse)
- 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::UsageService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::CapacityPlanner::V1beta::QueryUsageHistoriesRequest.new # Call the query_usage_histories method. result = client.query_usage_histories request # The returned object is of type Google::Cloud::CapacityPlanner::V1beta::QueryUsageHistoriesResponse. p result
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)