blob: 45ae7c93c2fa75e79aedc983d43ea2eed91c8233 [file] [log] [blame]
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001<html><body>
2<style>
3
4body, 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
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, 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.regionCommitments.html">regionCommitments</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040078 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
79<p class="firstline">Retrieves an aggregated list of commitments.</p>
80<p class="toc_element">
81 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
82<p class="firstline">Retrieves the next page of results.</p>
83<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040084 <code><a href="#get">get(project, region, commitment)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070085<p class="firstline">Returns the specified commitment resource. Gets a list of available commitments by making a list() request.</p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040086<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087 <code><a href="#insert">insert(project, region, body, requestId=None)</a></code></p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -040088<p class="firstline">Creates a commitment in the specified project using the data included in the request.</p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040089<p class="toc_element">
90 <code><a href="#list">list(project, region, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
91<p class="firstline">Retrieves a list of commitments contained within the specified region.</p>
92<p class="toc_element">
93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070095<p class="toc_element">
96 <code><a href="#updateReservations">updateReservations(project, region, commitment, body, requestId=None)</a></code></p>
97<p class="firstline">Update the shape of reservations for GPUS/Local SSDs of reservations within the commitments.</p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040098<h3>Method Details</h3>
99<div class="method">
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400100 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
101 <pre>Retrieves an aggregated list of commitments.
102
103Args:
104 project: string, Project ID for this request. (required)
105 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
106
107You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
108
109Currently, only sorting by name or creationTimestamp desc is supported.
110 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
111 pageToken: string, Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400113
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700114For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400115
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700116You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400117
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true).
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400119
120Returns:
121 An object of the form:
122
123 {
124 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700125 "kind": "compute#commitmentAggregatedList", # [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments.
126 "items": { # A list of CommitmentsScopedList resources.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400127 "a_key": { # [Output Only] Name of the scope containing this set of commitments.
128 "warning": { # [Output Only] Informational warning which replaces the list of commitments when the list is empty.
129 "message": "A String", # [Output Only] A human-readable description of the warning code.
130 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
131 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
132 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
133 {
134 "value": "A String", # [Output Only] A warning data value corresponding to the key.
135 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
136 },
137 ],
138 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700139 "commitments": [ # [Output Only] A list of commitments contained in this scope.
140 { # Represents a regional Commitment resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400141 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700142 # Creating a commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. (== resource_for beta.regionCommitments ==) (== resource_for v1.regionCommitments ==)
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400143 "status": "A String", # [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
144 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
145 "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments.
146 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
147 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
148 "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700149 "reservations": [ # List of reservations for this commitment.
150 { # Reservation resource NextID: 13
151 "status": "A String", # [Output Only] The status of the reservation.
152 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
153 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
154 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with "any reservation" defined. If the field is set, then only VMs that target the reservation by name using --reservation-affinity can consume this reservation.
155 "commitment": "A String", # [OutputOnly] Full or partial url for parent commitment for reservations which are tied to a commitment.
156 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
157 "count": "A String", # Specifies number of resources that are allocated.
158 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for this specific sku reservation.
159 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
160 "machineType": "A String", # Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
161 "guestAccelerators": [ # Specifies accelerator type and count.
162 { # A specification of the type and number of accelerator cards attached to the instance.
163 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
164 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
165 },
166 ],
167 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
168 {
169 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
170 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
171 },
172 ],
173 },
174 "inUseCount": "A String", # [OutputOnly] Indicates how many resource are in use.
175 },
176 "zone": "A String", # Zone in which the reservation resides, must be provided if reservation is created with commitment creation.
177 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
178 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
179 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
180 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
181 },
182 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400183 "region": "A String", # [Output Only] URL of the region where this commitment may be used.
184 "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format.
185 "plan": "A String", # The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700186 "type": "A String", # The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400187 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
188 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700189 "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400190 { # Commitment for a particular resource (a Commitment is composed of one or more of these).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700191 "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400192 "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700193 "amount": "A String", # The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400194 },
195 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700196 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400197 },
198 ],
199 },
200 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700201 "warning": { # [Output Only] Informational warning message.
202 "message": "A String", # [Output Only] A human-readable description of the warning code.
203 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
204 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
205 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
206 {
207 "value": "A String", # [Output Only] A warning data value corresponding to the key.
208 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
209 },
210 ],
211 },
212 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400213 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
214 }</pre>
215</div>
216
217<div class="method">
218 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
219 <pre>Retrieves the next page of results.
220
221Args:
222 previous_request: The request for the previous page. (required)
223 previous_response: The response from the request for the previous page. (required)
224
225Returns:
226 A request object that you can call 'execute()' on to request the next
227 page. Returns None if there are no more items in the collection.
228 </pre>
229</div>
230
231<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400232 <code class="details" id="get">get(project, region, commitment)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700233 <pre>Returns the specified commitment resource. Gets a list of available commitments by making a list() request.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400234
235Args:
236 project: string, Project ID for this request. (required)
237 region: string, Name of the region for this request. (required)
238 commitment: string, Name of the commitment to return. (required)
239
240Returns:
241 An object of the form:
242
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700243 { # Represents a regional Commitment resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400244 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700245 # Creating a commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. (== resource_for beta.regionCommitments ==) (== resource_for v1.regionCommitments ==)
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400246 "status": "A String", # [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
247 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
248 "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments.
249 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
250 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
251 "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700252 "reservations": [ # List of reservations for this commitment.
253 { # Reservation resource NextID: 13
254 "status": "A String", # [Output Only] The status of the reservation.
255 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
256 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
257 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with "any reservation" defined. If the field is set, then only VMs that target the reservation by name using --reservation-affinity can consume this reservation.
258 "commitment": "A String", # [OutputOnly] Full or partial url for parent commitment for reservations which are tied to a commitment.
259 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
260 "count": "A String", # Specifies number of resources that are allocated.
261 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for this specific sku reservation.
262 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
263 "machineType": "A String", # Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
264 "guestAccelerators": [ # Specifies accelerator type and count.
265 { # A specification of the type and number of accelerator cards attached to the instance.
266 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
267 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
268 },
269 ],
270 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
271 {
272 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
273 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
274 },
275 ],
276 },
277 "inUseCount": "A String", # [OutputOnly] Indicates how many resource are in use.
278 },
279 "zone": "A String", # Zone in which the reservation resides, must be provided if reservation is created with commitment creation.
280 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
281 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
282 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
283 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
284 },
285 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400286 "region": "A String", # [Output Only] URL of the region where this commitment may be used.
287 "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format.
288 "plan": "A String", # The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700289 "type": "A String", # The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400290 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
291 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700292 "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400293 { # Commitment for a particular resource (a Commitment is composed of one or more of these).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700294 "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400295 "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700296 "amount": "A String", # The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400297 },
298 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700299 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400300 }</pre>
301</div>
302
303<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700304 <code class="details" id="insert">insert(project, region, body, requestId=None)</code>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400305 <pre>Creates a commitment in the specified project using the data included in the request.
306
307Args:
308 project: string, Project ID for this request. (required)
309 region: string, Name of the region for this request. (required)
310 body: object, The request body. (required)
311 The object takes the form of:
312
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700313{ # Represents a regional Commitment resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400314 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700315 # Creating a commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. (== resource_for beta.regionCommitments ==) (== resource_for v1.regionCommitments ==)
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400316 "status": "A String", # [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400317 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
318 "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments.
319 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
320 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
321 "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700322 "reservations": [ # List of reservations for this commitment.
323 { # Reservation resource NextID: 13
324 "status": "A String", # [Output Only] The status of the reservation.
325 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
326 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
327 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with "any reservation" defined. If the field is set, then only VMs that target the reservation by name using --reservation-affinity can consume this reservation.
328 "commitment": "A String", # [OutputOnly] Full or partial url for parent commitment for reservations which are tied to a commitment.
329 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
330 "count": "A String", # Specifies number of resources that are allocated.
331 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for this specific sku reservation.
332 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
333 "machineType": "A String", # Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
334 "guestAccelerators": [ # Specifies accelerator type and count.
335 { # A specification of the type and number of accelerator cards attached to the instance.
336 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
337 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
338 },
339 ],
340 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
341 {
342 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
343 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
344 },
345 ],
346 },
347 "inUseCount": "A String", # [OutputOnly] Indicates how many resource are in use.
348 },
349 "zone": "A String", # Zone in which the reservation resides, must be provided if reservation is created with commitment creation.
350 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
351 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
352 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
353 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
354 },
355 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400356 "region": "A String", # [Output Only] URL of the region where this commitment may be used.
357 "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format.
358 "plan": "A String", # The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700359 "type": "A String", # The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400360 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
361 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700362 "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400363 { # Commitment for a particular resource (a Commitment is composed of one or more of these).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700364 "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400365 "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700366 "amount": "A String", # The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400367 },
368 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700369 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400370 }
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400371
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700372 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
373
374For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
375
376The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400377
378Returns:
379 An object of the form:
380
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700381 { # Represents an Operation resource.
382 #
383 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
384 #
385 # Operations can be global, regional or zonal.
386 # - For global operations, use the globalOperations resource.
387 # - For regional operations, use the regionOperations resource.
388 # - For zonal operations, use the zonalOperations resource.
389 #
390 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400391 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700392 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400393 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
394 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700395 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400396 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
397 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
398 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
399 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
400 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
401 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
402 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
403 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
404 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
405 {
406 "message": "A String", # [Output Only] A human-readable description of the warning code.
407 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
408 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
409 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
410 {
411 "value": "A String", # [Output Only] A warning data value corresponding to the key.
412 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
413 },
414 ],
415 },
416 ],
417 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
418 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
419 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
420 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700421 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400422 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
423 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
424 {
425 "message": "A String", # [Output Only] An optional, human-readable error message.
426 "code": "A String", # [Output Only] The error type identifier for this error.
427 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
428 },
429 ],
430 },
431 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
432 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
433 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
434 }</pre>
435</div>
436
437<div class="method">
438 <code class="details" id="list">list(project, region, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
439 <pre>Retrieves a list of commitments contained within the specified region.
440
441Args:
442 project: string, Project ID for this request. (required)
443 region: string, Name of the region for this request. (required)
444 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
445
446You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
447
448Currently, only sorting by name or creationTimestamp desc is supported.
449 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
450 pageToken: string, Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700451 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400452
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700453For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400454
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700455You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400456
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700457To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400458
459Returns:
460 An object of the form:
461
462 { # Contains a list of Commitment resources.
463 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700464 "kind": "compute#commitmentList", # [Output Only] Type of resource. Always compute#commitmentList for lists of commitments.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400465 "items": [ # A list of Commitment resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700466 { # Represents a regional Commitment resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400467 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700468 # Creating a commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. (== resource_for beta.regionCommitments ==) (== resource_for v1.regionCommitments ==)
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400469 "status": "A String", # [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
470 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
471 "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments.
472 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
473 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
474 "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700475 "reservations": [ # List of reservations for this commitment.
476 { # Reservation resource NextID: 13
477 "status": "A String", # [Output Only] The status of the reservation.
478 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
479 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
480 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with "any reservation" defined. If the field is set, then only VMs that target the reservation by name using --reservation-affinity can consume this reservation.
481 "commitment": "A String", # [OutputOnly] Full or partial url for parent commitment for reservations which are tied to a commitment.
482 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
483 "count": "A String", # Specifies number of resources that are allocated.
484 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for this specific sku reservation.
485 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
486 "machineType": "A String", # Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
487 "guestAccelerators": [ # Specifies accelerator type and count.
488 { # A specification of the type and number of accelerator cards attached to the instance.
489 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
490 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
491 },
492 ],
493 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
494 {
495 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
496 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
497 },
498 ],
499 },
500 "inUseCount": "A String", # [OutputOnly] Indicates how many resource are in use.
501 },
502 "zone": "A String", # Zone in which the reservation resides, must be provided if reservation is created with commitment creation.
503 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
504 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
505 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
506 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
507 },
508 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400509 "region": "A String", # [Output Only] URL of the region where this commitment may be used.
510 "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format.
511 "plan": "A String", # The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700512 "type": "A String", # The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400513 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
514 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700515 "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400516 { # Commitment for a particular resource (a Commitment is composed of one or more of these).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700517 "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400518 "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700519 "amount": "A String", # The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400520 },
521 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700522 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400523 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400524 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700525 "warning": { # [Output Only] Informational warning message.
526 "message": "A String", # [Output Only] A human-readable description of the warning code.
527 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
528 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
529 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
530 {
531 "value": "A String", # [Output Only] A warning data value corresponding to the key.
532 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
533 },
534 ],
535 },
536 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400537 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
538 }</pre>
539</div>
540
541<div class="method">
542 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
543 <pre>Retrieves the next page of results.
544
545Args:
546 previous_request: The request for the previous page. (required)
547 previous_response: The response from the request for the previous page. (required)
548
549Returns:
550 A request object that you can call 'execute()' on to request the next
551 page. Returns None if there are no more items in the collection.
552 </pre>
553</div>
554
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700555<div class="method">
556 <code class="details" id="updateReservations">updateReservations(project, region, commitment, body, requestId=None)</code>
557 <pre>Update the shape of reservations for GPUS/Local SSDs of reservations within the commitments.
558
559Args:
560 project: string, Project ID for this request. (required)
561 region: string, Name of the region for this request. (required)
562 commitment: string, Name of the commitment of which the reservation's capacities are being updated. (required)
563 body: object, The request body. (required)
564 The object takes the form of:
565
566{
567 "reservations": [ # List of reservations for the capacity move of VMs with accelerators and local ssds.
568 { # Reservation resource NextID: 13
569 "status": "A String", # [Output Only] The status of the reservation.
570 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
571 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
572 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with "any reservation" defined. If the field is set, then only VMs that target the reservation by name using --reservation-affinity can consume this reservation.
573 "commitment": "A String", # [OutputOnly] Full or partial url for parent commitment for reservations which are tied to a commitment.
574 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
575 "count": "A String", # Specifies number of resources that are allocated.
576 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for this specific sku reservation.
577 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
578 "machineType": "A String", # Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
579 "guestAccelerators": [ # Specifies accelerator type and count.
580 { # A specification of the type and number of accelerator cards attached to the instance.
581 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
582 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
583 },
584 ],
585 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
586 {
587 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
588 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
589 },
590 ],
591 },
592 "inUseCount": "A String", # [OutputOnly] Indicates how many resource are in use.
593 },
594 "zone": "A String", # Zone in which the reservation resides, must be provided if reservation is created with commitment creation.
595 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
596 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
597 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
598 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
599 },
600 ],
601 }
602
603 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
604
605For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
606
607The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
608
609Returns:
610 An object of the form:
611
612 { # Represents an Operation resource.
613 #
614 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
615 #
616 # Operations can be global, regional or zonal.
617 # - For global operations, use the globalOperations resource.
618 # - For regional operations, use the regionOperations resource.
619 # - For zonal operations, use the zonalOperations resource.
620 #
621 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
622 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
623 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
624 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
625 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
626 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
627 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
628 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
629 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
630 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
631 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
632 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
633 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
634 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
635 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
636 {
637 "message": "A String", # [Output Only] A human-readable description of the warning code.
638 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
639 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
640 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
641 {
642 "value": "A String", # [Output Only] A warning data value corresponding to the key.
643 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
644 },
645 ],
646 },
647 ],
648 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
649 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
650 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
651 "name": "A String", # [Output Only] Name of the resource.
652 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
653 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
654 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
655 {
656 "message": "A String", # [Output Only] An optional, human-readable error message.
657 "code": "A String", # [Output Only] The error type identifier for this error.
658 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
659 },
660 ],
661 },
662 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
663 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
664 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
665 }</pre>
666</div>
667
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400668</body></html>