Advise how, where and when to create the requested amount of instances with specified accelerators, within the specified time and location limits. The method recommends creating future reservations for the requested resources.
POST https://compute.googleapis.com/compute/beta/projects/{project}/regions/{region}/advice/calendarMode
The URL uses gRPC Transcoding syntax. To know more about valid error responses that can be thrown by this HTTP request, please refer to the service error catalog
| Parameters | |
|---|---|
project |
Project ID for this request. |
region |
Name of the region for this request. |
The request body contains data with the following structure:
| JSON representation |
|---|
{ "futureResourcesSpecs": { string: { "locationPolicy": { "locations": { string: { "preference": enum }, ... } }, "timeRangeSpec": { "startTimeNotEarlierThan": string, "startTimeNotLaterThan": string, "endTimeNotEarlierThan": string, "endTimeNotLaterThan": string, "minDuration": string, "maxDuration": string }, "targetResources": { // Union field |
futureResourcesSpecs[]map (key: string, value: object)
Specification of resources to create in the future. The key of the map is an arbitrary string specified by the caller. Value of the map is a specification of required resources and their constraints. Currently only one value is allowed in this map.
futureResourcesSpecs[].locationPolicyobject
Optional location policy allowing to exclude some zone(s) in which the resources must not be created.
futureResourcesSpecs[].locationPolicy.locations[]map (key: string, value: object)
futureResourcesSpecs[].locationPolicy.locations[].preferenceenum
Preference for this location.
futureResourcesSpecs[].timeRangeSpecobject
Specification of a time range in which the resources may be created. The time range specifies start of resource use and planned end of resource use.
futureResourcesSpecs[].timeRangeSpec.startTimeNotEarlierThanstring (Timestamp format)
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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
futureResourcesSpecs[].timeRangeSpec.startTimeNotLaterThanstring (Timestamp format)
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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
futureResourcesSpecs[].timeRangeSpec.endTimeNotEarlierThanstring (Timestamp format)
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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
futureResourcesSpecs[].timeRangeSpec.endTimeNotLaterThanstring (Timestamp format)
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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
futureResourcesSpecs[].timeRangeSpec.minDurationstring (Duration format)
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
futureResourcesSpecs[].timeRangeSpec.maxDurationstring (Duration format)
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
futureResourcesSpecs[].targetResourcesobject
Specification of the reserved resources.
futureResourcesSpecs[].targetResources.specificSkuResourcesobject
futureResourcesSpecs[].targetResources.specificSkuResources.machineTypestring
The machine type to use for instances that will use the reservation. This field only accepts machine type names. e.g. n2-standard-4 and does not accept machine type full or partial url. e.g. projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4. Use for GPU reservations.
futureResourcesSpecs[].targetResources.specificSkuResources.localSsdPartitions[]object
Local SSD partitions. You do not have to include SSD partitions that are built in the machine type.
futureResourcesSpecs[].targetResources.specificSkuResources.localSsdPartitions[].diskInterfaceenum
Disk interface. Defaults to SCSI.
futureResourcesSpecs[].targetResources.specificSkuResources.localSsdPartitions[].diskSizeGbstring (int64 format)
The size of the disk in GB.
futureResourcesSpecs[].targetResources.specificSkuResources.instanceCountstring (int64 format)
Size of the request, in instance count.
futureResourcesSpecs[].targetResources.aggregateResourcesobject
futureResourcesSpecs[].targetResources.aggregateResources.vmFamilyenum
The VM family that all instances scheduled against this reservation must belong to. Use for TPU reservations.
futureResourcesSpecs[].targetResources.aggregateResources.workloadTypeenum
Workload type. Use for TPU reservations.
futureResourcesSpecs[].targetResources.aggregateResources.acceleratorCountstring (int64 format)
Size of the request, in accelerator (chip) count.
futureResourcesSpecs[].deploymentTypeenum
Indicates if the reservation allocation strategy is static (DENSE) or dynamic (STANDARD). Defaults to DENSE.
A response containing the recommended way of creating the specified resources in the future. It contains (will contain) multiple recommendations that can be analyzed by the customer and the best one can be picked.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "recommendations": [ { "recommendationsPerSpec": { string: { "recommendationId": string, "recommendationType": enum, "startTime": string, "endTime": string, "location": string, "otherLocations": { string: { "status": enum, "details": string }, ... } }, ... } } ] } |
recommendations[]object
Recommendations where, how and when to create the requested resources in order to maximize their obtainability and minimize cost.
recommendations[].recommendationsPerSpec[]map (key: string, value: object)
Recommendations for every future resource specification passed in CalendarModeAdviceRequest. Keys of the map correspond to keys specified in the request.
recommendations[].recommendationsPerSpec[].recommendationIdstring
Unique id of the recommendation, a UUID string generated by the API.
recommendations[].recommendationsPerSpec[].recommendationTypeenum
Type of recommendation. Currently only FUTURE_RESERVATION is supported.
recommendations[].recommendationsPerSpec[].startTimestring (Timestamp format)
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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
recommendations[].recommendationsPerSpec[].endTimestring (Timestamp format)
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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
recommendations[].recommendationsPerSpec[].locationstring
recommendations[].recommendationsPerSpec[].otherLocations[]map (key: string, value: object)
recommendations[].recommendationsPerSpec[].otherLocations[].statusenum
Status of recommendation in this location.
recommendations[].recommendationsPerSpec[].otherLocations[].detailsstring
Details (human readable) describing the situation. For example, if status is CONDITION_NOT_MET, then details contain information about the parameters of the time window that did not meet the required conditions.
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/cloud-platformFor more information, see the Authentication Overview.
In addition to any permissions specified on the fields above, authorization requires one or more of the following IAM permissions:
compute.advice.calendarModeTo find predefined roles that contain those permissions, see Compute Engine IAM Roles.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-18 UTC.