Compute Engine API . advice

Instance Methods

calendarMode(project, region, body=None, x__xgafv=None)

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.

close()

Close httplib2 connections.

Method Details

calendarMode(project, region, body=None, x__xgafv=None)
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.

Args:
  project: string, Project ID for this request. (required)
  region: string, Name of the region for this request. (required)
  body: object, The request body.
    The object takes the form of:

{ # A request to recommend the best way to consume the specified resources in the future.
  "futureResourcesSpecs": { # 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.
    "a_key": { # Specification of resources to be created at some time in the future within an optionally specified set of locations, and within the specified time range.
      "deploymentType": "A String", # Indicates if the reservation allocation strategy is static (DENSE) or dynamic (STANDARD). Defaults to DENSE.
      "locationPolicy": { # Specification of locations to create resources in. # Optional location policy allowing to exclude some zone(s) in which the resources must not be created.
        "locations": { # Preferences for specified locations. Keys of the map are locations - zones, in format of 'zones/'. Values are preferences for the zones. If a zone is not specified in this map, it is ALLOWed.
          "a_key": { # Preference for a single specified location.
            "preference": "A String", # Preference for this location.
          },
        },
      },
      "targetResources": { # Specification of reserved resources. # Specification of the reserved resources.
        "aggregateResources": {
          "acceleratorCount": "A String", # Size of the request, in accelerator (chip) count.
          "vmFamily": "A String", # The VM family that all instances scheduled against this reservation must belong to. Use for TPU reservations.
          "workloadType": "A String", # Workload type. Use for TPU reservations.
        },
        "specificSkuResources": {
          "instanceCount": "A String", # Size of the request, in instance count.
          "localSsdPartitions": [ # Local SSD partitions. You do not have to include SSD partitions that are built in the machine type.
            {
              "diskInterface": "A String", # Disk interface. Defaults to SCSI.
              "diskSizeGb": "A String", # The size of the disk in GB.
            },
          ],
          "machineType": "A String", # 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.
        },
      },
      "timeRangeSpec": { # A flexible specification of a time range that has 3 points of flexibility: (1) a flexible start time, (2) a flexible end time, (3) a flexible duration. It is possible to specify a contradictory time range that cannot be matched by any Interval. This causes a validation error. # 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.
        "endTimeNotEarlierThan": "A String",
        "endTimeNotLaterThan": "A String",
        "maxDuration": "A String",
        "minDuration": "A String",
        "startTimeNotEarlierThan": "A String",
        "startTimeNotLaterThan": "A String",
      },
    },
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # 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.
  "recommendations": [ # Recommendations where, how and when to create the requested resources in order to maximize their obtainability and minimize cost.
    { # A single recommendation to create requested resources. Contains detailed recommendations for every future resources specification specified in CalendarModeAdviceRequest.
      "recommendationsPerSpec": { # Recommendations for every future resource specification passed in CalendarModeAdviceRequest. Keys of the map correspond to keys specified in the request.
        "a_key": { # Recommendation for single resources specification, to be created in the future.
          "endTime": "A String",
          "location": "A String", # The advised location for resource usage. When a zone, in format 'zones/'. If not set, it means that no location is recommended - see other_locations for details.
          "otherLocations": { # List of locations in the request scope that were not recommended. Keys of the map are zones, in format 'zones/'. The values are status information indicating the recommendation status.
            "a_key": { # Information about recommendation status for locations that were allowed but not used by the response.
              "details": "A String", # 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.
              "status": "A String", # Status of recommendation in this location.
            },
          },
          "recommendationId": "A String", # Unique id of the recommendation, a UUID string generated by the API.
          "recommendationType": "A String", # Type of recommendation. Currently only FUTURE_RESERVATION is supported.
          "startTime": "A String",
        },
      },
    },
  ],
}
close()
Close httplib2 connections.