CostScenario

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

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.

JSON representation
{
  "workloads": [
    {
      object (Workload)
    }
  ],
  "commitments": [
    {
      object (Commitment)
    }
  ],
  "scenarioConfig": {
    object (ScenarioConfig)
  }
}
Fields
workloads[]

object (Workload)

The Google Cloud usage whose costs are estimated.

A maximum of 100 workloads can be provided.

commitments[]

object (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.

scenarioConfig

object (ScenarioConfig)

Configuration for the scenario.

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.

JSON representation
{
  "name": string,

  // Union field product_spec can be only one of the following:
  "computeVmWorkload": {
    object (ComputeVmWorkload)
  },
  "cloudStorageWorkload": {
    object (CloudStorageWorkload)
  }
  // End of list of possible types for union field product_spec.
}
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:
computeVmWorkload

object (ComputeVmWorkload)

Usage of a Google Compute Engine Virtual Machine.

cloudStorageWorkload

object (CloudStorageWorkload)

Usage on Google Cloud Storage.

ComputeVmWorkload

Specificies usage of a set of identical compute VM instances.

JSON representation
{
  "region": string,
  "machineType": {
    object (MachineType)
  },
  "guestAccelerator": {
    object (GuestAccelerator)
  },
  "preemptible": boolean,
  "enableConfidentialCompute": boolean,
  "licenses": [
    string
  ],
  "persistentDisks": [
    {
      object (PersistentDisk)
    }
  ],
  "instancesRunning": {
    object (Usage)
  }
}
Fields
region

string

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

machineType

object (MachineType)

The machine type.

guestAccelerator

object (GuestAccelerator)

Guest accelerators attached to each machine.

preemptible

boolean

Defines whether each instance is preemptible.

enableConfidentialCompute

boolean

Defines whether each instance has confidential compute enabled.

licenses[]

string

Premium image licenses used by each instance.

persistentDisks[]

object (PersistentDisk)

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

instancesRunning

object (Usage)

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

MachineType

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

JSON representation
{

  // Union field machine_type can be only one of the following:
  "predefinedMachineType": {
    object (PredefinedMachineType)
  },
  "customMachineType": {
    object (CustomMachineType)
  }
  // End of list of possible types for union field machine_type.
}
Fields

Union field machine_type.

machine_type can be only one of the following:

predefinedMachineType

object (PredefinedMachineType)

customMachineType

object (CustomMachineType)

PredefinedMachineType

Specification of a predefined machine type.

JSON representation
{
  "machineType": string
}
Fields
machineType

string

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

CustomMachineType

Specification of a custom machine type.

JSON representation
{
  "machineSeries": string,
  "virtualCpuCount": string,
  "memorySizeGb": number
}
Fields
machineSeries

string

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

virtualCpuCount

string (int64 format)

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

memorySizeGb

number

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.

GuestAccelerator

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

JSON representation
{
  "acceleratorType": string,
  "acceleratorCount": string
}
Fields
acceleratorType

string

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

acceleratorCount

string (int64 format)

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

PersistentDisk

Specification of a persistent disk attached to a VM.

JSON representation
{
  "diskType": string,
  "scope": enum (Scope),
  "diskSize": {
    object (Usage)
  },
  "provisionedIops": {
    object (Usage)
  }
}
Fields
diskType

string

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

scope

enum (Scope)

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

diskSize

object (Usage)

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

provisionedIops

object (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.

Usage

An amount of usage over a time frame.

JSON representation
{
  "usageRateTimeline": {
    object (UsageRateTimeline)
  }
}
Fields
usageRateTimeline

object (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 effectiveTime 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.

JSON representation
{
  "unit": string,
  "usageRateTimelineEntries": [
    {
      object (UsageRateTimelineEntry)
    }
  ]
}
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
usageRateTimelineEntries[]

object (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.

JSON representation
{
  "effectiveTime": {
    object (EstimationTimePoint)
  },
  "usageRate": number
}
Fields
effectiveTime

object (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.

usageRate

number

The usage rate.

CloudStorageWorkload

Specifies usage of Cloud Storage resources.

JSON representation
{
  "storageClass": string,
  "dataStored": {
    object (Usage)
  },
  "operationA": {
    object (Usage)
  },
  "operationB": {
    object (Usage)
  },
  "dataRetrieval": {
    object (Usage)
  },

  // Union field location can be only one of the following:
  "region": {
    object (Regional)
  },
  "multiRegion": {
    object (MultiRegional)
  },
  "dualRegion": {
    object (DualRegional)
  }
  // End of list of possible types for union field location.
}
Fields
storageClass

string

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

dataStored

object (Usage)

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

operationA

object (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".

operationB

object (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".

dataRetrieval

object (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

object (Regional)

Specify a single region.

multiRegion

object (MultiRegional)

Specify multi regions.

dualRegion

object (DualRegional)

Specify dual regions.

Regional

Area contains only one location.

JSON representation
{
  "name": string
}
Fields
name

string

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

MultiRegional

Area contains multiple locations.

JSON representation
{
  "name": string
}
Fields
name

string

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

DualRegional

Area contains dual locations.

JSON representation
{
  "name": string
}
Fields
name

string

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

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.

JSON representation
{
  "name": string,
  "vmResourceBasedCud": {
    object (VmResourceBasedCud)
  }
}
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.

vmResourceBasedCud

object (VmResourceBasedCud)

A resource-based committed use discount (CUD).

VmResourceBasedCud

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

JSON representation
{
  "region": string,
  "virtualCpuCount": string,
  "memorySizeGb": number,
  "guestAccelerator": {
    object (GuestAccelerator)
  },
  "plan": enum (CommitmentPlan),
  "machineSeries": string
}
Fields
region

string

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

virtualCpuCount

string (int64 format)

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

memorySizeGb

number

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

guestAccelerator

object (GuestAccelerator)

Guest accelerator, known as GPU.

plan

enum (CommitmentPlan)

Commitment usage plan.

machineSeries

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.

ScenarioConfig

Configuration for a CostScenario. Specifies how costs are calculated.

JSON representation
{
  "estimateDuration": string
}
Fields
estimateDuration

string (Duration format)

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.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".