Debian Codegraph @

docs/dyn/compute_beta.advice.html

raw
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_beta.html">Compute Engine API</a> . <a href="compute_beta.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="#capacity">capacity(project, region, body=None, x__xgafv=None)</a></code></p>
82 <p class="firstline">Advice on making real-time decisions (such as choosing zone or</p>
83 <p class="toc_element">
84 <code><a href="#capacityHistory">capacityHistory(project, region, body=None, x__xgafv=None)</a></code></p>
85 <p class="firstline">Gets the capacity history.</p>
86 <p class="toc_element">
87 <code><a href="#close">close()</a></code></p>
88 <p class="firstline">Close httplib2 connections.</p>
89 <h3>Method Details</h3>
90 <div class="method">
91 <code class="details" id="calendarMode">calendarMode(project, region, body=None, x__xgafv=None)</code>
92 <pre>Advise how, where and when to create the requested amount of instances
93 with specified accelerators, within the specified time and location limits.
94 The method recommends creating future reservations for the requested
95 resources.
96
97 Args:
98 project: string, Project ID for this request. (required)
99 region: string, Name of the region for this request. (required)
100 body: object, The request body.
101 The object takes the form of:
102
103 { # A request to recommend the best way to consume the specified resources in the
104 # future.
105 &quot;futureResourcesSpecs&quot;: { # Specification of resources to create in the future.
106 # The key of the map is an arbitrary string specified by the caller.
107 # Value of the map is a specification of required resources and their
108 # constraints. Currently only one value is allowed in this map.
109 &quot;a_key&quot;: { # Specification of resources to be created at some time in the future within an
110 # optionally specified set of locations, and within the specified time range.
111 &quot;deploymentType&quot;: &quot;A String&quot;, # Indicates if the reservation allocation strategy is static (DENSE) or
112 # dynamic (STANDARD). Defaults to DENSE.
113 &quot;locationPolicy&quot;: { # Specification of locations to create resources in. # Optional location policy allowing to exclude some zone(s) in which
114 # the resources must not be created.
115 &quot;locations&quot;: { # Preferences for specified locations.
116 # Keys of the map are locations - zones, in format of &#x27;zones/&#x27;.
117 # Values are preferences for the zones.
118 # If a zone is not specified in this map, it is ALLOWed.
119 &quot;a_key&quot;: { # Preference for a single specified location.
120 &quot;preference&quot;: &quot;A String&quot;, # Preference for this location.
121 },
122 },
123 },
124 &quot;targetResources&quot;: { # Specification of reserved resources. # Specification of the reserved resources.
125 &quot;aggregateResources&quot;: {
126 &quot;acceleratorCount&quot;: &quot;A String&quot;, # Size of the request, in accelerator (chip) count.
127 &quot;vmFamily&quot;: &quot;A String&quot;, # The VM family that all instances scheduled against this reservation
128 # must belong to. Use for TPU reservations.
129 &quot;workloadType&quot;: &quot;A String&quot;, # Workload type. Use for TPU reservations.
130 },
131 &quot;specificSkuResources&quot;: {
132 &quot;instanceCount&quot;: &quot;A String&quot;, # Size of the request, in instance count.
133 &quot;localSsdPartitions&quot;: [ # Local SSD partitions. You do not have to include SSD partitions that
134 # are built in the machine type.
135 {
136 &quot;diskInterface&quot;: &quot;A String&quot;, # Disk interface. Defaults to SCSI.
137 &quot;diskSizeGb&quot;: &quot;A String&quot;, # The size of the disk in GB.
138 },
139 ],
140 &quot;machineType&quot;: &quot;A String&quot;, # The machine type to use for instances that will use the reservation.
141 # This field only accepts machine type names. e.g. n2-standard-4
142 # and does not accept machine type full or partial url. e.g.
143 # projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4.
144 # Use for GPU reservations.
145 },
146 },
147 &quot;timeRangeSpec&quot;: { # Specifies a flexible time range with flexible start time and duration. # Specification of a time range in which the resources may be created.
148 # The time range specifies start of resource use and planned end of resource
149 # use.
150 #
151 # It is possible to specify a contradictory time range that cannot be matched
152 # by any Interval. This causes a validation error.
153 &quot;endTimeNotEarlierThan&quot;: &quot;A String&quot;,
154 &quot;endTimeNotLaterThan&quot;: &quot;A String&quot;,
155 &quot;maxDuration&quot;: &quot;A String&quot;,
156 &quot;minDuration&quot;: &quot;A String&quot;,
157 &quot;startTimeNotEarlierThan&quot;: &quot;A String&quot;,
158 &quot;startTimeNotLaterThan&quot;: &quot;A String&quot;,
159 },
160 },
161 },
162 }
163
164 x__xgafv: string, V1 error format.
165 Allowed values
166 1 - v1 error format
167 2 - v2 error format
168
169 Returns:
170 An object of the form:
171
172 { # A response containing the recommended way of creating the specified resources
173 # in the future. It contains (will contain) multiple recommendations that can
174 # be analyzed by the customer and the best one can be picked.
175 &quot;recommendations&quot;: [ # Recommendations where, how and when to create the requested resources
176 # in order to maximize their obtainability and minimize cost.
177 { # A single recommendation to create requested resources. Contains detailed
178 # recommendations for every future resources specification specified in
179 # CalendarModeAdviceRequest.
180 &quot;recommendationsPerSpec&quot;: { # Recommendations for every future resource specification passed in
181 # CalendarModeAdviceRequest. Keys of the map correspond to keys
182 # specified in the request.
183 &quot;a_key&quot;: { # Recommendation for single resources specification, to be created in the
184 # future.
185 &quot;endTime&quot;: &quot;A String&quot;,
186 &quot;location&quot;: &quot;A String&quot;, # The advised location for resource usage. When a zone, in format
187 # &#x27;zones/&#x27;.
188 # If not set, it means that no location is recommended - see
189 # other_locations for details.
190 &quot;otherLocations&quot;: { # List of locations in the request scope that were not
191 # recommended. Keys of the map are zones, in format &#x27;zones/&#x27;.
192 # The values are status information indicating the recommendation status.
193 &quot;a_key&quot;: { # Information about recommendation status for locations
194 # that were allowed but not used by the response.
195 &quot;details&quot;: &quot;A String&quot;, # Details (human readable) describing the situation.
196 # For example, if status is CONDITION_NOT_MET, then
197 # details contain information about the parameters of the time window
198 # that did not meet the required conditions.
199 &quot;status&quot;: &quot;A String&quot;, # Status of recommendation in this location.
200 },
201 },
202 &quot;recommendationId&quot;: &quot;A String&quot;, # Unique id of the recommendation, a UUID string generated by the API.
203 &quot;recommendationType&quot;: &quot;A String&quot;, # Type of recommendation. Currently only FUTURE_RESERVATION is supported.
204 &quot;startTime&quot;: &quot;A String&quot;,
205 },
206 },
207 },
208 ],
209 }</pre>
210 </div>
211
212 <div class="method">
213 <code class="details" id="capacity">capacity(project, region, body=None, x__xgafv=None)</code>
214 <pre>Advice on making real-time decisions (such as choosing zone or
215 machine types) during deployment to maximize your chances of obtaining
216 capacity.
217
218 Args:
219 project: string, Project ID for this request. (required)
220 region: string, Name of the region for this request. (required)
221 body: object, The request body.
222 The object takes the form of:
223
224 { # A request to provide Assistant Scores. These scores determine VM
225 # obtainability and preemption likelihood.
226 &quot;distributionPolicy&quot;: { # Distribution policy. # Policy specifying the distribution of instances across
227 # zones within the requested region.
228 &quot;targetShape&quot;: &quot;A String&quot;, # Target distribution shape. You can specify the following values:ANY, ANY_SINGLE_ZONE, or BALANCED.
229 &quot;zones&quot;: [ # Zones where Capacity Advisor looks for capacity.
230 { # Zone configuration for the distribution policy.
231 &quot;zone&quot;: &quot;A String&quot;, # The URL of the zone. It can be a
232 # partial or full URL. For example, the following are valid values:
233 #
234 #
235 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone
236 # - projects/project/zones/zone
237 # - zones/zone
238 },
239 ],
240 },
241 &quot;instanceFlexibilityPolicy&quot;: { # Specification of alternative, flexible instance configurations. # Policy for instance selectors.
242 &quot;instanceSelections&quot;: { # Named instance selections to configure properties.
243 # The key is an arbitrary, unique RFC1035 string that identifies the
244 # instance selection.
245 &quot;a_key&quot;: { # Machine specification.
246 &quot;disks&quot;: [ # Local SSDs.
247 { # Attached disk configuration.
248 &quot;type&quot;: &quot;A String&quot;, # Specifies the type of the disk.
249 # This field must be set to SCRATCH.
250 },
251 ],
252 &quot;guestAccelerators&quot;: [ # Accelerators configuration.
253 { # A specification of the type and number of accelerator cards attached to the
254 # instance.
255 &quot;acceleratorCount&quot;: 42, # The number of the guest accelerator cards exposed to this instance.
256 &quot;acceleratorType&quot;: &quot;A String&quot;, # Full or partial URL of the accelerator type resource to attach to this
257 # instance. For example:projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100
258 # If you are creating an instance template, specify only the
259 # accelerator name.
260 # See GPUs on Compute Engine
261 # for a full list of accelerator types.
262 },
263 ],
264 &quot;machineTypes&quot;: [ # Full machine-type names, e.g. &quot;n1-standard-16&quot;.
265 &quot;A String&quot;,
266 ],
267 },
268 },
269 },
270 &quot;instanceProperties&quot;: { # Instance provisioning properties. # Instance properties for this request.
271 &quot;scheduling&quot;: { # Defines the instance scheduling options. # Specifies the scheduling options.
272 &quot;provisioningModel&quot;: &quot;A String&quot;, # Specifies the provisioning model.
273 },
274 },
275 &quot;size&quot;: 42, # The number of VM instances to request.
276 }
277
278 x__xgafv: string, V1 error format.
279 Allowed values
280 1 - v1 error format
281 2 - v2 error format
282
283 Returns:
284 An object of the form:
285
286 { # A response contains scoring recommendations.
287 &quot;recommendations&quot;: [ # Initially the API will provide one recommendation which balances the
288 # individual scores according to the service provider&#x27;s preference.
289 { # Recommendation.
290 &quot;scores&quot;: { # Groups information about a shard of capacity. # Scores for the recommendation.
291 &quot;estimatedUptime&quot;: &quot;A String&quot;, # The estimated run time of the majority of Spot VMs in the request
292 # before preemption. The estimate is best-effort only. It is based on
293 # historical data and current conditions.
294 &quot;obtainability&quot;: 3.14, # The obtainability score indicates the likelihood of successfully
295 # obtaining (provisioning) the requested number of VMs.
296 # The score range is 0.0 through 1.0. Higher is better.
297 },
298 &quot;shards&quot;: [ # Shards represent blocks of uniform capacity in recommendations.
299 { # Shards represent blocks of uniform capacity in recommendations.
300 # Each shard is for a single zone and a single machine shape. Each shard
301 # defines a size expressed as the number of VMs.
302 &quot;instanceCount&quot;: 42, # The number of instances.
303 &quot;machineType&quot;: &quot;A String&quot;, # The machine type corresponds to the instance selection in the request.
304 &quot;provisioningModel&quot;: &quot;A String&quot;, # The provisioning model that you want to view recommendations for.
305 &quot;zone&quot;: &quot;A String&quot;, # Output only. The zone name for this shard.
306 },
307 ],
308 },
309 ],
310 }</pre>
311 </div>
312
313 <div class="method">
314 <code class="details" id="capacityHistory">capacityHistory(project, region, body=None, x__xgafv=None)</code>
315 <pre>Gets the capacity history.
316
317 Args:
318 project: string, Project ID for this request. (required)
319 region: string, Name of the region for this request. (required)
320 body: object, The request body.
321 The object takes the form of:
322
323 { # A request to get the capacity history.
324 &quot;instanceProperties&quot;: { # Instance properties for this request. # Instance properties for this request.
325 &quot;machineType&quot;: &quot;A String&quot;, # The machine type for the VM, such as `n2-standard-4`.
326 &quot;scheduling&quot;: { # Scheduling options. # Specifies the scheduling options.
327 &quot;provisioningModel&quot;: &quot;A String&quot;, # The provisioning model to get capacity history for.
328 # This field must be set to SPOT.
329 #
330 # For more information, see
331 # Compute Engine instances provisioning models.
332 },
333 },
334 &quot;locationPolicy&quot;: { # Location policy for this request. # Location policy for this request.
335 &quot;location&quot;: &quot;A String&quot;, # The region or zone to get capacity history for.
336 #
337 # It can be a partial or full URL. For example, the following are valid
338 # values:
339 #
340 #
341 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone
342 # - projects/project/zones/zone
343 # - zones/zone
344 #
345 #
346 #
347 # This field is optional.
348 },
349 &quot;types&quot;: [ # List of history types to get capacity history for.
350 &quot;A String&quot;,
351 ],
352 }
353
354 x__xgafv: string, V1 error format.
355 Allowed values
356 1 - v1 error format
357 2 - v2 error format
358
359 Returns:
360 An object of the form:
361
362 { # Contains the capacity history.
363 &quot;location&quot;: &quot;A String&quot;,
364 &quot;machineType&quot;: &quot;A String&quot;,
365 &quot;preemptionHistory&quot;: [
366 {
367 &quot;interval&quot;: { # Represents a time interval, encoded as a Timestamp start (inclusive) and a
368 # Timestamp end (exclusive).
369 #
370 # The start must be less than or equal to the end.
371 # When the start equals the end, the interval is empty (matches no time).
372 # When both start and end are unspecified, the interval matches any time.
373 &quot;endTime&quot;: &quot;A String&quot;, # Optional. Exclusive end of the interval.
374 #
375 # If specified, a Timestamp matching this interval will have to be before the
376 # end.
377 &quot;startTime&quot;: &quot;A String&quot;, # Optional. Inclusive start of the interval.
378 #
379 # If specified, a Timestamp matching this interval will have to be the same
380 # or after the start.
381 },
382 &quot;preemptionRate&quot;: 3.14,
383 },
384 ],
385 &quot;priceHistory&quot;: [
386 {
387 &quot;interval&quot;: { # Represents a time interval, encoded as a Timestamp start (inclusive) and a
388 # Timestamp end (exclusive).
389 #
390 # The start must be less than or equal to the end.
391 # When the start equals the end, the interval is empty (matches no time).
392 # When both start and end are unspecified, the interval matches any time.
393 &quot;endTime&quot;: &quot;A String&quot;, # Optional. Exclusive end of the interval.
394 #
395 # If specified, a Timestamp matching this interval will have to be before the
396 # end.
397 &quot;startTime&quot;: &quot;A String&quot;, # Optional. Inclusive start of the interval.
398 #
399 # If specified, a Timestamp matching this interval will have to be the same
400 # or after the start.
401 },
402 &quot;listPrice&quot;: { # Represents an amount of money with its currency type.
403 &quot;currencyCode&quot;: &quot;A String&quot;, # The three-letter currency code defined in ISO 4217.
404 &quot;nanos&quot;: 42, # Number of nano (10^-9) units of the amount.
405 # The value must be between -999,999,999 and +999,999,999 inclusive.
406 # If `units` is positive, `nanos` must be positive or zero.
407 # If `units` is zero, `nanos` can be positive, zero, or negative.
408 # If `units` is negative, `nanos` must be negative or zero.
409 # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
410 &quot;units&quot;: &quot;A String&quot;, # The whole units of the amount.
411 # For example if `currencyCode` is `&quot;USD&quot;`, then 1 unit is one US dollar.
412 },
413 },
414 ],
415 }</pre>
416 </div>
417
418 <div class="method">
419 <code class="details" id="close">close()</code>
420 <pre>Close httplib2 connections.</pre>
421 </div>
422
423 </body></html>