| 1 |
<html><body> |
| 2 |
<style> |
| 3 |
|
| 4 |
body, h1, h2, h3, div, span, p, pre, a { |
| 5 |
margin: 0; |
| 6 |
padding: 0; |
| 7 |
border: 0; |
| 8 |
font-weight: inherit; |
| 9 |
font-style: inherit; |
| 10 |
font-size: 100%; |
| 11 |
font-family: inherit; |
| 12 |
vertical-align: baseline; |
| 13 |
} |
| 14 |
|
| 15 |
body { |
| 16 |
font-size: 13px; |
| 17 |
padding: 1em; |
| 18 |
} |
| 19 |
|
| 20 |
h1 { |
| 21 |
font-size: 26px; |
| 22 |
margin-bottom: 1em; |
| 23 |
} |
| 24 |
|
| 25 |
h2 { |
| 26 |
font-size: 24px; |
| 27 |
margin-bottom: 1em; |
| 28 |
} |
| 29 |
|
| 30 |
h3 { |
| 31 |
font-size: 20px; |
| 32 |
margin-bottom: 1em; |
| 33 |
margin-top: 1em; |
| 34 |
} |
| 35 |
|
| 36 |
pre, code { |
| 37 |
line-height: 1.5; |
| 38 |
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 |
} |
| 40 |
|
| 41 |
pre { |
| 42 |
margin-top: 0.5em; |
| 43 |
} |
| 44 |
|
| 45 |
h1, h2, h3, p { |
| 46 |
font-family: Arial, sans serif; |
| 47 |
} |
| 48 |
|
| 49 |
h1, h2, h3 { |
| 50 |
border-bottom: solid #CCC 1px; |
| 51 |
} |
| 52 |
|
| 53 |
.toc_element { |
| 54 |
margin-top: 0.5em; |
| 55 |
} |
| 56 |
|
| 57 |
.firstline { |
| 58 |
margin-left: 2 em; |
| 59 |
} |
| 60 |
|
| 61 |
.method { |
| 62 |
margin-top: 1em; |
| 63 |
border: solid 1px #CCC; |
| 64 |
padding: 1em; |
| 65 |
background: #EEE; |
| 66 |
} |
| 67 |
|
| 68 |
.details { |
| 69 |
font-weight: bold; |
| 70 |
font-size: 14px; |
| 71 |
} |
| 72 |
|
| 73 |
</style> |
| 74 |
|
| 75 |
<h1><a href="compute_v1.html">Compute Engine API</a> . <a href="compute_v1.advice.html">advice</a></h1> |
| 76 |
<h2>Instance Methods</h2> |
| 77 |
<p class="toc_element"> |
| 78 |
<code><a href="#calendarMode">calendarMode(project, region, body=None, x__xgafv=None)</a></code></p> |
| 79 |
<p class="firstline">Advise how, where and when to create the requested amount of instances</p> |
| 80 |
<p class="toc_element"> |
| 81 |
<code><a href="#close">close()</a></code></p> |
| 82 |
<p class="firstline">Close httplib2 connections.</p> |
| 83 |
<h3>Method Details</h3> |
| 84 |
<div class="method"> |
| 85 |
<code class="details" id="calendarMode">calendarMode(project, region, body=None, x__xgafv=None)</code> |
| 86 |
<pre>Advise how, where and when to create the requested amount of instances |
| 87 |
with specified accelerators, within the specified time and location limits. |
| 88 |
The method recommends creating future reservations for the requested |
| 89 |
resources. |
| 90 |
|
| 91 |
Args: |
| 92 |
project: string, Project ID for this request. (required) |
| 93 |
region: string, Name of the region for this request. (required) |
| 94 |
body: object, The request body. |
| 95 |
The object takes the form of: |
| 96 |
|
| 97 |
{ # A request to recommend the best way to consume the specified resources in the |
| 98 |
# future. |
| 99 |
"futureResourcesSpecs": { # Specification of resources to create in the future. |
| 100 |
# The key of the map is an arbitrary string specified by the caller. |
| 101 |
# Value of the map is a specification of required resources and their |
| 102 |
# constraints. Currently only one value is allowed in this map. |
| 103 |
"a_key": { # Specification of resources to be created at some time in the future within an |
| 104 |
# optionally specified set of locations, and within the specified time range. |
| 105 |
"deploymentType": "A String", # Indicates if the reservation allocation strategy is static (DENSE) or |
| 106 |
# dynamic (STANDARD). Defaults to DENSE. |
| 107 |
"locationPolicy": { # Specification of locations to create resources in. # Optional location policy allowing to exclude some zone(s) in which |
| 108 |
# the resources must not be created. |
| 109 |
"locations": { # Preferences for specified locations. |
| 110 |
# Keys of the map are locations - zones, in format of 'zones/'. |
| 111 |
# Values are preferences for the zones. |
| 112 |
# If a zone is not specified in this map, it is ALLOWed. |
| 113 |
"a_key": { # Preference for a single specified location. |
| 114 |
"preference": "A String", # Preference for this location. |
| 115 |
}, |
| 116 |
}, |
| 117 |
}, |
| 118 |
"targetResources": { # Specification of reserved resources. # Specification of the reserved resources. |
| 119 |
"aggregateResources": { |
| 120 |
"acceleratorCount": "A String", # Size of the request, in accelerator (chip) count. |
| 121 |
"vmFamily": "A String", # The VM family that all instances scheduled against this reservation |
| 122 |
# must belong to. Use for TPU reservations. |
| 123 |
"workloadType": "A String", # Workload type. Use for TPU reservations. |
| 124 |
}, |
| 125 |
"specificSkuResources": { |
| 126 |
"instanceCount": "A String", # Size of the request, in instance count. |
| 127 |
"localSsdPartitions": [ # Local SSD partitions. You do not have to include SSD partitions that |
| 128 |
# are built in the machine type. |
| 129 |
{ |
| 130 |
"diskInterface": "A String", # Disk interface. Defaults to SCSI. |
| 131 |
"diskSizeGb": "A String", # The size of the disk in GB. |
| 132 |
}, |
| 133 |
], |
| 134 |
"machineType": "A String", # The machine type to use for instances that will use the reservation. |
| 135 |
# This field only accepts machine type names. e.g. n2-standard-4 |
| 136 |
# and does not accept machine type full or partial url. e.g. |
| 137 |
# projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4. |
| 138 |
# Use for GPU reservations. |
| 139 |
}, |
| 140 |
}, |
| 141 |
"timeRangeSpec": { # Specifies a flexible time range with flexible start time and duration. # Specification of a time range in which the resources may be created. |
| 142 |
# The time range specifies start of resource use and planned end of resource |
| 143 |
# use. |
| 144 |
# |
| 145 |
# It is possible to specify a contradictory time range that cannot be matched |
| 146 |
# by any Interval. This causes a validation error. |
| 147 |
"maxDuration": "A String", |
| 148 |
"minDuration": "A String", |
| 149 |
"startTimeNotEarlierThan": "A String", |
| 150 |
"startTimeNotLaterThan": "A String", |
| 151 |
}, |
| 152 |
}, |
| 153 |
}, |
| 154 |
} |
| 155 |
|
| 156 |
x__xgafv: string, V1 error format. |
| 157 |
Allowed values |
| 158 |
1 - v1 error format |
| 159 |
2 - v2 error format |
| 160 |
|
| 161 |
Returns: |
| 162 |
An object of the form: |
| 163 |
|
| 164 |
{ # A response containing the recommended way of creating the specified resources |
| 165 |
# in the future. It contains (will contain) multiple recommendations that can |
| 166 |
# be analyzed by the customer and the best one can be picked. |
| 167 |
"recommendations": [ # Recommendations where, how and when to create the requested resources |
| 168 |
# in order to maximize their obtainability and minimize cost. |
| 169 |
{ # A single recommendation to create requested resources. Contains detailed |
| 170 |
# recommendations for every future resources specification specified in |
| 171 |
# CalendarModeAdviceRequest. |
| 172 |
"recommendationsPerSpec": { # Recommendations for every future resource specification passed in |
| 173 |
# CalendarModeAdviceRequest. Keys of the map correspond to keys |
| 174 |
# specified in the request. |
| 175 |
"a_key": { # Recommendation for single resources specification, to be created in the |
| 176 |
# future. |
| 177 |
"endTime": "A String", |
| 178 |
"location": "A String", # The advised location for resource usage. When a zone, in format |
| 179 |
# 'zones/'. |
| 180 |
# If not set, it means that no location is recommended - see |
| 181 |
# other_locations for details. |
| 182 |
"otherLocations": { # List of locations in the request scope that were not |
| 183 |
# recommended. Keys of the map are zones, in format 'zones/'. |
| 184 |
# The values are status information indicating the recommendation status. |
| 185 |
"a_key": { # Information about recommendation status for locations |
| 186 |
# that were allowed but not used by the response. |
| 187 |
"details": "A String", # Details (human readable) describing the situation. |
| 188 |
# For example, if status is CONDITION_NOT_MET, then |
| 189 |
# details contain information about the parameters of the time window |
| 190 |
# that did not meet the required conditions. |
| 191 |
"status": "A String", # Status of recommendation in this location. |
| 192 |
}, |
| 193 |
}, |
| 194 |
"recommendationId": "A String", # Unique id of the recommendation, a UUID string generated by the API. |
| 195 |
"recommendationType": "A String", # Type of recommendation. Currently only FUTURE_RESERVATION is supported. |
| 196 |
"startTime": "A String", |
| 197 |
}, |
| 198 |
}, |
| 199 |
}, |
| 200 |
], |
| 201 |
}</pre> |
| 202 |
</div> |
| 203 |
|
| 204 |
<div class="method"> |
| 205 |
<code class="details" id="close">close()</code> |
| 206 |
<pre>Close httplib2 connections.</pre> |
| 207 |
</div> |
| 208 |
|
| 209 |
</body></html> |