- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- Try it!
Gets the capacity history.
HTTP request
POST https://compute.googleapis.com/compute/beta/projects/{project}/regions/{region}/advice/capacityHistory The URLs use gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
project |
Project ID for this request. |
region |
Name of the region for this request. |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ "instanceProperties": { "machineType": string, "scheduling": { "provisioningModel": enum } }, "locationPolicy": { "location": string }, "types": [ enum ] } |
| Fields | |
|---|---|
instanceProperties |
Instance properties for this request. |
instanceProperties.machineType |
The machine type for the VM, such as |
instanceProperties.scheduling |
Specifies the scheduling options. |
instanceProperties.scheduling.provisioningModel |
The provisioning model to get capacity history for. This field must be set to For more information, see Compute Engine instances provisioning models. |
locationPolicy |
Location policy for this request. |
locationPolicy.location |
The region or zone to get capacity history for. It can be a partial or full URL. For example, the following are valid values:
This field is optional. |
types[] |
List of history types to get capacity history for. |
Response body
Contains the capacity history.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "machineType": string, "location": string, "preemptionHistory": [ { "interval": { "startTime": string, "endTime": string }, "preemptionRate": number } ], "priceHistory": [ { "interval": { "startTime": string, "endTime": string }, "listPrice": { "currencyCode": string, "units": string, "nanos": integer } } ] } |
| Fields | |
|---|---|
machineType |
The machine type for which the capacity history is returned. |
location |
Output only. The location (region or zone) for which the capacity history is returned. It is returned as a URL - For example, |
preemptionHistory[] |
The preemption history for the requested machine type and location. |
preemptionHistory[].interval |
The time interval for this preemption record. |
preemptionHistory[].interval.startTime |
Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
preemptionHistory[].interval.endTime |
Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
preemptionHistory[].preemptionRate |
The preemption rate during the interval, representing the fraction of Spot VMs that were preempted. Range: 0.0 to 1.0. Preemption rate is calculated as |
priceHistory[] |
The price history for the requested machine type and location. |
priceHistory[].interval |
The time interval for this price record. |
priceHistory[].interval.startTime |
Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
priceHistory[].interval.endTime |
Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
priceHistory[].listPrice |
The Spot VM list price during the interval. |
priceHistory[].listPrice.currencyCode |
The three-letter currency code defined in ISO 4217. |
priceHistory[].listPrice.units |
The whole units of the amount. For example if |
priceHistory[].listPrice.nanos |
Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/computehttps://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
In addition to any permissions specified on the fields above, authorization requires one or more of the following IAM permissions:
compute.advice.capacityHistory
To find predefined roles that contain those permissions, see Compute Engine IAM Roles.