Package google.cloud.billing.costestimation.v1beta

Stay organized with collections Save and categorize content based on your preferences.

Index

CostEstimationService

Estimates costs for workloads on Google Cloud.

EstimateCostScenarioForBillingAccount

rpc EstimateCostScenarioForBillingAccount(EstimateCostScenarioForBillingAccountRequest) returns (EstimateCostScenarioForBillingAccountResponse)

Use custom pricing in the estimate, using a CostScenario with a defined billingAccount.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/cloud-billing

For more information, see the Authentication Overview.

EstimateCostScenarioWithListPrice

rpc EstimateCostScenarioWithListPrice(EstimateCostScenarioWithListPriceRequest) returns (EstimateCostScenarioWithListPriceResponse)

Estimate list prices using a CostScenario without a defined billingAccount.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/cloud-billing

For more information, see the Authentication Overview.

CloudStorageWorkload

Specifies usage of Cloud Storage resources.

Fields
storage_class

string

The storage class of the data and operation. For example: "standard" or "nearline".

data_stored

Usage

Data storage usage. The amount of data stored in buckets. For example: units such as "GiBy/s" or "TBy/mo".

operation_a

Usage

Class A operation usage in Cloud Storage, such as listing the objects in buckets. See the operations pricing tables for a list of which operations fall into each class. For example: units such as "1/s".

operation_b

Usage

Class B operation usage in Cloud Storage, such as getIamPolicy. See the operations pricing tables for a list of which operations fall into each class. For example: units such as "1/s".

data_retrieval

Usage

Data retrieval usage. A retrieval cost applies when data or metadata is read, copied, or rewritten . For example: units such as "GiBy/s" or "By/s".

Union field location.

location can be only one of the following:

region

Regional

Specify a single region.

multi_region

MultiRegional

Specify multi regions.

dual_region

DualRegional

Specify dual regions.

Commitment

Commitments give you the ability to pay a recurring fee in exchange for a benefit, such as a discount for your use. For example, this object might contain details of a spend-based committed use discount (CUD).

Within a CostScenario, adding a commitment includes the cost of the commitment and any discounts.

Fields
name

string

Required. A name for this commitment.

All commitments in a CostScenario must have unique names. Each name must be a maximum of 32 characters.

vm_resource_based_cud

VmResourceBasedCud

A resource-based committed use discount (CUD).

CommitmentCostEstimate

Estimated cost for a commitment.

Fields
name

string

The name of the commitment, as specified in the CostScenario.

sku_cost_estimates[]

SkuCostEstimate

Estimated costs for each SKU in the commitment.

commitment_total_cost_estimate

CostEstimate

Total estimated costs for the commitment.

ComputeVmWorkload

Specificies usage of a set of identical compute VM instances.

Fields
region

string

The region where the VMs run. For example: "us-central1".

machine_type

MachineType

The machine type.

guest_accelerator

GuestAccelerator

Guest accelerators attached to each machine.

preemptible

bool

Defines whether each instance is preemptible.

enable_confidential_compute

bool

Defines whether each instance has confidential compute enabled.

licenses[]

string

Premium image licenses used by each instance.

persistent_disks[]

PersistentDisk

Persistent disks attached to each instance. Must include a boot disk.

instances_running

Usage

VM usage. This is specified as a unitless quantity which indicates the number of instances running.

CostEstimate

An estimated cost.

Fields
pre_credit_cost_estimate

Money

The estimated cost prior to applying credits.

credit_estimates[]

CreditEstimate

The estimated credits applied.

net_cost_estimate

Money

The estimated net cost after applying credits.

CostEstimationResult

The result of a estimating the costs of a CostScenario.

Fields
segment_cost_estimates[]

SegmentCostEstimate

Required. Estimated costs for each idealized month of a CostScenario.

skus[]

Sku

Required. Information about SKUs used in the estimate.

currency_code

string

Required. The ISO 4217 currency code for the cost estimate.

CostScenario

Encapsulates all the information needed to perform a cost estimate. It includes a specification of the Google Cloud usage whose costs are estimated, and configuration options.

Fields
workloads[]

Workload

The Google Cloud usage whose costs are estimated.

A maximum of 100 workloads can be provided.

commitments[]

Commitment

New commitments to estimate the costs for.

The cost of the commitments will be included in the estimate result and discounts the commitment entitles will be included in the workload cost estimates.

A maximum of 100 workloads can be provided.

scenario_config

ScenarioConfig

Configuration for the scenario.

CreditEstimate

An estimated credit applied to the costs on a SKU.

Fields
credit_amount

Money

The estimated credit amount.

credit_type

string

The credit type.

credit_description

string

The credit description.

CustomMachineType

Specification of a custom machine type.

Fields
machine_series

string

Required. The machine series. Only certain machine series support custom configurations. For example: "n1".

virtual_cpu_count

int64

Required. The number of vCPUs. The allowed values depend on the machine series.

memory_size_gb

double

Required. Memory size of the VM in GB (2^30 bytes). Must be an increment of 0.25 (256 MB). Each machine series has limitations on allowed values for the ratio of memory-to-vCPU count.

DualRegional

Area contains dual locations.

Fields
name

string

The location name where the data is stored. For example: "asia1" for dual region.

EstimateCostScenarioForBillingAccountRequest

Request for EstimateCostScenarioForBillingAccount.

Fields
billing_account

string

Resource name of the billing account for the cost estimate.

The resource name has the form billingAccounts/{billing_acount_id}. For example, billingAccounts/012345-567890-ABCDEF is the resource name for billing account 012345-567890-ABCDEF.

Must be specified.

cost_scenario

CostScenario

The scenario to estimate costs for.

EstimateCostScenarioForBillingAccountResponse

Response for EstimateCostScenarioForBillingAccount

Fields
cost_estimation_result

CostEstimationResult

The result of the cost estimation.

EstimateCostScenarioWithListPriceRequest

Request for EstimateCostScenarioWithListPrice.

Fields
cost_scenario

CostScenario

The scenario to estimate costs for.

EstimateCostScenarioWithListPriceResponse

Response for EstimateCostScenarioWithListPrice

Fields
cost_estimation_result

CostEstimationResult

The result of the cost estimation.

EstimationTimePoint

Represents a point in time.

Fields
estimation_time_frame_offset

Duration

The point in time, relative to the start of the time frame covered by the cost estimate.

GuestAccelerator

Specification of a set of guest accelerators attached to a machine.

Fields
accelerator_type

string

The type of the guest accelerator cards. For example: "nvidia-tesla-t4".

accelerator_count

int64

The number of the guest accelerator cards exposed to each instance.

MachineType

Specification of machine series, memory, and number of vCPUs.

Fields

Union field machine_type.

machine_type can be only one of the following:

predefined_machine_type

PredefinedMachineType

custom_machine_type

CustomMachineType

MultiRegional

Area contains multiple locations.

Fields
name

string

The location name where the data is stored. For example: "us" for multi-region.

PersistentDisk

Specification of a persistent disk attached to a VM.

Fields
disk_type

string

The disk type. For example: "pd-standard".

scope

Scope

The geographic scope of the disk. Defaults to SCOPE_ZONAL if not specified.

disk_size

Usage

Specifies the size of disk. Must be at least 10 GB.

provisioned_iops

Usage

Indicates how many IOPS to provision for the disk for extreme persistent disks. This sets the number of I/O operations per second that the disk can handle. Values must be between 10,000 and 120,000.

Scope

The geographic scope of the disk.

Enums
SCOPE_UNSPECIFIED Unspecified.
SCOPE_ZONAL The disk exists in a single zone.
SCOPE_REGIONAL The disk is replicated in a secondary zone within the same region.

PredefinedMachineType

Specification of a predefined machine type.

Fields
machine_type

string

The machine type. For example: "n1-standard1".

Price

The price of a SKU at a point int time.

Fields
price_type

string

The type of price. Possible values: "RATE"

effective_time

EstimationTimePoint

The timestamp within the estimation time frame when the price was set.

rate

Rate

A set of tiered rates.

Rate

A SKU price consisting of tiered rates.

Fields
tiers[]

RateTier

The service tiers.

unit

string

The SKU's pricing unit. For example, if the tier price is $1 per 1000000 Bytes, then this field will show 'By'. The start_amount field in each tier will be in this unit.

unit_count

double

The SKU's count for the pricing unit. For example, if the tier price is $1 per 1000000 Bytes, then this column will show 1000000.

RateTier

Pricing details for a service tier.

Fields
start_amount

double

The magnitude of usage in which the tier interval begins. Example: "From 100 GiBi the price is $1 per byte" implies start_amount = 100

price

Money

The price for this tier.

Regional

Area contains only one location.

Fields
name

string

The location name. For example: "us-central1" for region.

ScenarioConfig

Configuration for a CostScenario. Specifies how costs are calculated.

Fields
estimate_duration

Duration

Time frame for the estimate.

Workloads must specify usage for this duration. Duration must be at least 1 hour (3,600 seconds) and at most 10 years (315,360,000 seconds). The calculations for years and months are based on a 730-hour (2,628,000-second) month.

For durations longer than one month (2,628,000 seconds), the duration is rounded up to the next month, so the estimate shows you the costs for full months. For example, a duration of 3,232,800 seconds (roughly 5 weeks) is rounded up to 2 months.

SegmentCostEstimate

Workload cost estimates for a single time segment.

Fields
segment_start_time

EstimationTimePoint

Timestamp for the start of the segment.

workload_cost_estimates[]

WorkloadCostEstimate

Estimated costs for each workload.

commitment_cost_estimates[]

CommitmentCostEstimate

Estimated costs for each commitment.

segment_total_cost_estimate

CostEstimate

Total estimated costs for the time segment.

Sku

Information about SKUs appearing in the cost estimate.

Fields
sku

string

The resource name for the SKU. Example: "services/DA34-426B-A397/skus/AA95-CD31-42FE"

display_name

string

The display name for the SKU. Example: A2 Instance Core running in Americas

prices[]

Price

A timeline of prices for a SKU in chronological order.

Note: The API currently only supports using a constant price for the entire estimation time frame so this list will contain a single value.

SkuCostEstimate

Estimated cost for usage on a SKU.

Fields
sku

string

The resource name for the SKU. Example: "services/DA34-426B-A397/skus/AA95-CD31-42FE"

More information about the SKU can be found in the skus field of the CostEstimationResult.

usage_amount

double

The amount of usage on this SKU.

usage_unit

string

The unit for the usage on this SKU.

cost_estimate

CostEstimate

The estimated cost for the usage on this SKU.

Usage

An amount of usage over a time frame.

Fields
usage_rate_timeline

UsageRateTimeline

A timeline of usage rates over the estimate interval.

UsageRateTimeline

A timeline of usage rates.

Consists of a series of entries, each of which specifies a constant rate of usage during a time interval. Each entry contains an effective time. The usage rate is in effect from that time until the effective time of the subsequent entry, or, for the last entry, for the remaining portion of estimation time frame.

Effective times are specified as an offset into the estimation time frame. Usage is considered to be zero until the effective_time of the first entry. All subsequent entries must have an effective time greater than the previous entry and less than the estimate time frame.

The effective time on all entries must be an integer number of hours.

Fields
unit

string

The unit for the usage rate in each timeline entry.

The supported units are a subset of The Unified Code for Units of Measure standard:

  • Time units (TIME-UNIT)
    • s second
    • min minute
    • h hour
    • d day
    • wk week
    • mo month
    • yr year
    • ms millisecond
    • us microsecond
    • ns nanosecond
  • Basic storage units (BASIC-STORAGE-UNIT)
    • bit bit
    • By byte
  • Count units (COUNT-UNIT)
    • count count
  • Prefixes (PREFIX)
    • k kilo (10^3)
    • M mega (10^6)
    • G giga (10^9)
    • T tera (10^12)
    • P peta (10^15)
    • Ki kibi (2^10)
    • Mi mebi (2^20)
    • Gi gibi (2^30)
    • Ti tebi (2^40)
    • Pi pebi (2^50)

Grammar

The grammar also includes these connectors:

  • / division or ratio (as an infix operator). For example: kBy/{email} or MiBy/10ms.
  • . multiplication or composition (as an infix operator). For example: GBy.d or k{watt}.h.

The grammar for a unit is as follows:

Expression = Component { "." Component } { "/" Component } ;

Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
     | Annotation
     | "1"
     ;

UNIT = TIME-UNIT | STORAGE-UNIT | DATA-UNIT | COUNT-UNIT

Annotation = "{" NAME "}" ;

Examples:

  • Request per second: 1/s or {requests}/s
  • GibiBytes: GiBy
  • GibiBytes * seconds: GiBy.s
usage_rate_timeline_entries[]

UsageRateTimelineEntry

The timeline entries. Each entry has a start time and usage rate. The start time specifies the effective time of the usage rate. The entries must be sorted by start time in an increasing order.

UsageRateTimelineEntry

A usage rate timeline entry.

Each entry specifies a constant usage rate during a time interval.

Fields
effective_time

EstimationTimePoint

The effective time for this entry. The usage rate is in effect starting at this time until the effective time of the subsequent entry in the timeline. The last entry defines the usage rate until the end of the Usage time frame.

Must correspond to an integer number of hours.

usage_rate

double

The usage rate.

VmResourceBasedCud

Specifies a resource-based committed use discount (CUD).

Fields
region

string

The region where the VM runs. For example: "us-central1"

virtual_cpu_count

int64

The number of vCPUs. The number of vCPUs must be an integer of 0 or more and can be even or odd.

memory_size_gb

double

Memory size of the VM in GB (2^30 bytes). Must be an increment of 0.25 (256 MB).

guest_accelerator

GuestAccelerator

Guest accelerator, known as GPU.

plan

CommitmentPlan

Commitment usage plan.

machine_series

string

The machine series for CUD. For example: "n1" for general purpose N1 machine type commitments. "n2" for general purpose N2 machine type commitments. "e2" for general purpose E2 machine type commitments. "n2d" for general purpose N2D machine type commitments. "t2d" for general purpose T2D machine type commitments. "c2"/"c2d" for compute-optimized commitments. "m1"/"m2" for the memory-optimized commitments. "a2' for the accelerator-optimized commitments.

CommitmentPlan

The plan of commitments for VM resource-based committed use discount (CUD).

Enums
COMMITMENT_PLAN_UNSPECIFIED Not specified commitment plan.
TWELVE_MONTH 1 year commitment.
THIRTY_SIX_MONTH 3 years commitment.

Workload

Specifies usage on a single Google Cloud product over a time frame.

Each Google Cloud product has its own message, containing specific product configuration parameters of the product usage amounts along each dimension in which the product is billed.

Fields
name

string

Required. A name for this workload.

All workloads in a CostScenario must have a unique name. Each name must be a maximum of 32 characters.

Union field product_spec. The product specific configuration and usage specification. product_spec can be only one of the following:
compute_vm_workload

ComputeVmWorkload

Usage of a Google Compute Engine Virtual Machine.

cloud_storage_workload

CloudStorageWorkload

Usage on Google Cloud Storage.

WorkloadCostEstimate

Estimated cost for a workload.

Fields
name

string

The name of the workload, as specified in the CostScenario.

sku_cost_estimates[]

SkuCostEstimate

Estimated costs for each SKU in the workload.

workload_total_cost_estimate

CostEstimate

Total estimated costs for the workload.