| <html><body> |
| <style> |
| |
| body, h1, h2, h3, div, span, p, pre, a { |
| margin: 0; |
| padding: 0; |
| border: 0; |
| font-weight: inherit; |
| font-style: inherit; |
| font-size: 100%; |
| font-family: inherit; |
| vertical-align: baseline; |
| } |
| |
| body { |
| font-size: 13px; |
| padding: 1em; |
| } |
| |
| h1 { |
| font-size: 26px; |
| margin-bottom: 1em; |
| } |
| |
| h2 { |
| font-size: 24px; |
| margin-bottom: 1em; |
| } |
| |
| h3 { |
| font-size: 20px; |
| margin-bottom: 1em; |
| margin-top: 1em; |
| } |
| |
| pre, code { |
| line-height: 1.5; |
| font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| } |
| |
| pre { |
| margin-top: 0.5em; |
| } |
| |
| h1, h2, h3, p { |
| font-family: Arial, sans serif; |
| } |
| |
| h1, h2, h3 { |
| border-bottom: solid #CCC 1px; |
| } |
| |
| .toc_element { |
| margin-top: 0.5em; |
| } |
| |
| .firstline { |
| margin-left: 2 em; |
| } |
| |
| .method { |
| margin-top: 1em; |
| border: solid 1px #CCC; |
| padding: 1em; |
| background: #EEE; |
| } |
| |
| .details { |
| font-weight: bold; |
| font-size: 14px; |
| } |
| |
| </style> |
| |
| <h1><a href="compute_alpha.html">Compute Engine API</a> . <a href="compute_alpha.advice.html">advice</a></h1> |
| <h2>Instance Methods</h2> |
| <p class="toc_element"> |
| <code><a href="#calendarMode">calendarMode(project, region, body=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Advise how, where and when to create the requested amount of instances</p> |
| <p class="toc_element"> |
| <code><a href="#capacity">capacity(project, region, body=None, x__xgafv=None)</a></code></p> |
| <p class="firstline">Advice on making real-time decisions (such as choosing zone or</p> |
| <p class="toc_element"> |
| <code><a href="#close">close()</a></code></p> |
| <p class="firstline">Close httplib2 connections.</p> |
| <h3>Method Details</h3> |
| <div class="method"> |
| <code class="details" id="calendarMode">calendarMode(project, region, body=None, x__xgafv=None)</code> |
| <pre>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 # 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. |
| # 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. |
| "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", |
| }, |
| }, |
| }, |
| ], |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="capacity">capacity(project, region, body=None, x__xgafv=None)</code> |
| <pre>Advice on making real-time decisions (such as choosing zone or |
| machine types) during deployment to maximize your chances of obtaining |
| capacity. |
| |
| 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 provide Assistant Scores. These scores determine VM |
| # obtainability and preemption likelihood. |
| "distributionPolicy": { # Policy specifying the distribution of instances across |
| # zones within the requested region. |
| "targetShape": "A String", # The distribution shape to which the group converges. |
| # You can only specify the following values: ANY,ANY_SINGLE_ZONE. |
| "zones": [ # Zones where Capacity Advisor looks for capacity. |
| { |
| "zone": "A String", # The URL of the zone. It can be a |
| # partial or full URL. For example, the following are valid values: |
| # |
| # |
| # - https://www.googleapis.com/compute/v1/projects/project/zones/zone |
| # - projects/project/zones/zone |
| # - zones/zone |
| }, |
| ], |
| }, |
| "instanceFlexibilityPolicy": { # Specification of alternative, flexible instance subsets. # Policy for instance selectors. |
| "instanceSelections": { # Named instance selections configure properties. |
| # The key is an arbitrary, unique RFC1035 string that identifies the |
| # instance selection. |
| "a_key": { # Machine specification. |
| "machineTypes": [ # Full machine-type names, e.g. "n1-standard-16". |
| "A String", |
| ], |
| }, |
| }, |
| }, |
| "instanceProperties": { # Instance provisining properties. # Instance properties for this request. |
| "scheduling": { # Defines the instance scheduling options. # Specifies the scheduling options. |
| "provisioningModel": "A String", # Specifies the provisioning model of the instance. |
| }, |
| }, |
| "size": 42, # Size of requested capacity. |
| } |
| |
| x__xgafv: string, V1 error format. |
| Allowed values |
| 1 - v1 error format |
| 2 - v2 error format |
| |
| Returns: |
| An object of the form: |
| |
| { # A response contains multiple scoring recommendations. |
| "recommendations": [ # Initially the API will provide one recommendation which balances the |
| # individual scores according to service provider's preference. |
| { |
| "scores": { # The Scores message groups information about a shard of capacity. |
| "obtainability": 3.14, # The obtainability score indicates the likelihood of successfully |
| # obtaining (provisioning) the requested number of VMs. |
| # The score range is 0.0 through 1.0. Higher is better. |
| "uptimeScore": 3.14, # The uptime score indicates the likelihood that your Spot VMs will |
| # continue to run without preemption within the next few hours. For more |
| # information about the preemption process, see Preemption |
| # of Spot VMs. |
| # The score range is 0.0 through 1.0. Higher is better. |
| }, |
| "shards": [ |
| { # Shards represent blocks of uniform capacity in recommendations. |
| # Each shard is for a single zone, single instance selection, and |
| # a single machine shape. Each shard defines a size expressed as the |
| # number of VMs. |
| "instanceCount": 42, |
| "machineType": "A String", # The machine type corresponds to the instance selection in the request. |
| "provisioningModel": "A String", # The provisioning model that you want to view recommendations for. |
| # Set to: SPOT. |
| # |
| # For more information, see |
| # Compute Engine instances provisioning models. |
| "zone": "A String", # The zone name for this shard. |
| }, |
| ], |
| }, |
| ], |
| }</pre> |
| </div> |
| |
| <div class="method"> |
| <code class="details" id="close">close()</code> |
| <pre>Close httplib2 connections.</pre> |
| </div> |
| |
| </body></html> |