blob: 810f5aea3f8471478e90c38bd5bad190f2517053 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<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_v1.html">Compute Engine API</a> . <a href="compute_v1.regionCommitments.html">regionCommitments</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None, includeAllScopes=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<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">
84 <code><a href="#get">get(project, region, commitment)</a></code></p>
85<p class="firstline">Returns the specified commitment resource. Gets a list of available commitments by making a list() request.</p>
86<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#insert">insert(project, region, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070088<p class="firstline">Creates a commitment in the specified project using the data included in the request.</p>
89<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>
95<h3>Method Details</h3>
96<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070097 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None, includeAllScopes=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070098 <pre>Retrieves an aggregated list of commitments.
99
100Args:
101 project: string, Project ID for this request. (required)
102 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
103
Dan O'Mearadd494642020-05-01 07:42:23 -0700104You 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700105
Dan O'Mearadd494642020-05-01 07:42:23 -0700106Currently, only sorting by `name` or `creationTimestamp desc` is supported.
107 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`)
108 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.
109 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 `=`, `!=`, `&gt;`, or `&lt;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700110
Dan O'Mearadd494642020-05-01 07:42:23 -0700111For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112
Dan O'Mearadd494642020-05-01 07:42:23 -0700113You 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700114
Dan O'Mearadd494642020-05-01 07:42:23 -0700115To 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) ```
116 includeAllScopes: boolean, Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700117
118Returns:
119 An object of the form:
120
121 {
122 "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.
123 "kind": "compute#commitmentAggregatedList", # [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments.
124 "items": { # A list of CommitmentsScopedList resources.
125 "a_key": { # [Output Only] Name of the scope containing this set of commitments.
126 "warning": { # [Output Only] Informational warning which replaces the list of commitments when the list is empty.
127 "message": "A String", # [Output Only] A human-readable description of the warning code.
128 "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.
129 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
130 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
131 {
132 "value": "A String", # [Output Only] A warning data value corresponding to the key.
133 "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).
134 },
135 ],
136 },
137 "commitments": [ # [Output Only] A list of commitments contained in this scope.
138 { # Represents a regional Commitment resource.
139 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700140 # 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 {$api_version}.regionCommitments ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700141 "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.
142 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
143 "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments.
144 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
145 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
146 "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700147 "reservations": [ # List of reservations in this commitment.
148 { # Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for {$api_version}.reservations ==)
149 "status": "A String", # [Output Only] The status of the reservation.
150 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
151 "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.
152 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
153 "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
154 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
155 "count": "A String", # Specifies the number of resources that are allocated.
156 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for the reservation.
157 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
158 "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.
159 "guestAccelerators": [ # Specifies accelerator type and count.
160 { # A specification of the type and number of accelerator cards attached to the instance.
161 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
162 "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.
163 },
164 ],
165 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
166 {
167 "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.
168 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
169 },
170 ],
171 },
172 "inUseCount": "A String", # [Output Only] Indicates how many instances are in use.
173 },
174 "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
175 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
176 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
177 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
178 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
179 },
180 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700181 "region": "A String", # [Output Only] URL of the region where this commitment may be used.
182 "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format.
183 "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).
184 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
185 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
186 "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.
187 { # Commitment for a particular resource (a Commitment is composed of one or more of these).
Dan O'Mearadd494642020-05-01 07:42:23 -0700188 "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700189 "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY
Dan O'Mearadd494642020-05-01 07:42:23 -0700190 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700191 },
192 ],
193 "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.
194 },
195 ],
196 },
197 },
198 "warning": { # [Output Only] Informational warning message.
199 "message": "A String", # [Output Only] A human-readable description of the warning code.
200 "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.
201 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
202 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
203 {
204 "value": "A String", # [Output Only] A warning data value corresponding to the key.
205 "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).
206 },
207 ],
208 },
209 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
210 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
211 }</pre>
212</div>
213
214<div class="method">
215 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
216 <pre>Retrieves the next page of results.
217
218Args:
219 previous_request: The request for the previous page. (required)
220 previous_response: The response from the request for the previous page. (required)
221
222Returns:
223 A request object that you can call 'execute()' on to request the next
224 page. Returns None if there are no more items in the collection.
225 </pre>
226</div>
227
228<div class="method">
229 <code class="details" id="get">get(project, region, commitment)</code>
230 <pre>Returns the specified commitment resource. Gets a list of available commitments by making a list() request.
231
232Args:
233 project: string, Project ID for this request. (required)
234 region: string, Name of the region for this request. (required)
235 commitment: string, Name of the commitment to return. (required)
236
237Returns:
238 An object of the form:
239
240 { # Represents a regional Commitment resource.
241 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700242 # 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 {$api_version}.regionCommitments ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700243 "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.
244 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
245 "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments.
246 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
247 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
248 "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700249 "reservations": [ # List of reservations in this commitment.
250 { # Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for {$api_version}.reservations ==)
251 "status": "A String", # [Output Only] The status of the reservation.
252 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
253 "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.
254 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
255 "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
256 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
257 "count": "A String", # Specifies the number of resources that are allocated.
258 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for the reservation.
259 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
260 "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.
261 "guestAccelerators": [ # Specifies accelerator type and count.
262 { # A specification of the type and number of accelerator cards attached to the instance.
263 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
264 "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.
265 },
266 ],
267 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
268 {
269 "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.
270 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
271 },
272 ],
273 },
274 "inUseCount": "A String", # [Output Only] Indicates how many instances are in use.
275 },
276 "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
277 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
278 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
279 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
280 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
281 },
282 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700283 "region": "A String", # [Output Only] URL of the region where this commitment may be used.
284 "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format.
285 "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).
286 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
287 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
288 "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.
289 { # Commitment for a particular resource (a Commitment is composed of one or more of these).
Dan O'Mearadd494642020-05-01 07:42:23 -0700290 "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700291 "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY
Dan O'Mearadd494642020-05-01 07:42:23 -0700292 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700293 },
294 ],
295 "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.
296 }</pre>
297</div>
298
299<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700300 <code class="details" id="insert">insert(project, region, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700301 <pre>Creates a commitment in the specified project using the data included in the request.
302
303Args:
304 project: string, Project ID for this request. (required)
305 region: string, Name of the region for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700306 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700307 The object takes the form of:
308
309{ # Represents a regional Commitment resource.
310 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700311 # 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 {$api_version}.regionCommitments ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700312 "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.
313 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
314 "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments.
315 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
316 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
317 "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700318 "reservations": [ # List of reservations in this commitment.
319 { # Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for {$api_version}.reservations ==)
320 "status": "A String", # [Output Only] The status of the reservation.
321 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
322 "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.
323 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
324 "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
325 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
326 "count": "A String", # Specifies the number of resources that are allocated.
327 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for the reservation.
328 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
329 "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.
330 "guestAccelerators": [ # Specifies accelerator type and count.
331 { # A specification of the type and number of accelerator cards attached to the instance.
332 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
333 "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.
334 },
335 ],
336 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
337 {
338 "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.
339 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
340 },
341 ],
342 },
343 "inUseCount": "A String", # [Output Only] Indicates how many instances are in use.
344 },
345 "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
346 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
347 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
348 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
349 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
350 },
351 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700352 "region": "A String", # [Output Only] URL of the region where this commitment may be used.
353 "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format.
354 "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).
355 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
356 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
357 "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.
358 { # Commitment for a particular resource (a Commitment is composed of one or more of these).
Dan O'Mearadd494642020-05-01 07:42:23 -0700359 "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700360 "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY
Dan O'Mearadd494642020-05-01 07:42:23 -0700361 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700362 },
363 ],
364 "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.
365 }
366
367 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.
368
369For 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.
370
371The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
372
373Returns:
374 An object of the form:
375
376 { # Represents an Operation resource.
377 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700378 # Google Compute Engine has three Operation resources:
379 #
380 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
381 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700382 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
383 #
384 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700385 # - For global operations, use the `globalOperations` resource.
386 # - For regional operations, use the `regionOperations` resource.
387 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700388 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700389 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700390 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
391 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
392 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700393 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700394 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
395 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700396 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
397 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700398 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700399 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700400 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700401 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700402 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
403 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
404 {
405 "message": "A String", # [Output Only] A human-readable description of the warning code.
406 "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.
407 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
408 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
409 {
410 "value": "A String", # [Output Only] A warning data value corresponding to the key.
411 "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).
412 },
413 ],
414 },
415 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700416 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700417 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700418 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
419 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700420 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
421 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
422 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
423 {
424 "message": "A String", # [Output Only] An optional, human-readable error message.
425 "code": "A String", # [Output Only] The error type identifier for this error.
426 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
427 },
428 ],
429 },
430 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
431 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
432 "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.
433 }</pre>
434</div>
435
436<div class="method">
437 <code class="details" id="list">list(project, region, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
438 <pre>Retrieves a list of commitments contained within the specified region.
439
440Args:
441 project: string, Project ID for this request. (required)
442 region: string, Name of the region for this request. (required)
443 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
444
Dan O'Mearadd494642020-05-01 07:42:23 -0700445You 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700446
Dan O'Mearadd494642020-05-01 07:42:23 -0700447Currently, only sorting by `name` or `creationTimestamp desc` is supported.
448 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`)
449 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.
450 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 `=`, `!=`, `&gt;`, or `&lt;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700451
Dan O'Mearadd494642020-05-01 07:42:23 -0700452For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700453
Dan O'Mearadd494642020-05-01 07:42:23 -0700454You 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700455
Dan O'Mearadd494642020-05-01 07:42:23 -0700456To 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) ```
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700457
458Returns:
459 An object of the form:
460
461 { # Contains a list of Commitment resources.
462 "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.
463 "kind": "compute#commitmentList", # [Output Only] Type of resource. Always compute#commitmentList for lists of commitments.
464 "items": [ # A list of Commitment resources.
465 { # Represents a regional Commitment resource.
466 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700467 # 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 {$api_version}.regionCommitments ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700468 "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.
469 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
470 "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments.
471 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
472 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
473 "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700474 "reservations": [ # List of reservations in this commitment.
475 { # Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for {$api_version}.reservations ==)
476 "status": "A String", # [Output Only] The status of the reservation.
477 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
478 "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.
479 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
480 "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
481 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
482 "count": "A String", # Specifies the number of resources that are allocated.
483 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for the reservation.
484 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
485 "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.
486 "guestAccelerators": [ # Specifies accelerator type and count.
487 { # A specification of the type and number of accelerator cards attached to the instance.
488 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
489 "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.
490 },
491 ],
492 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
493 {
494 "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.
495 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
496 },
497 ],
498 },
499 "inUseCount": "A String", # [Output Only] Indicates how many instances are in use.
500 },
501 "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
502 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
503 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
504 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
505 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
506 },
507 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700508 "region": "A String", # [Output Only] URL of the region where this commitment may be used.
509 "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format.
510 "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).
511 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
512 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
513 "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.
514 { # Commitment for a particular resource (a Commitment is composed of one or more of these).
Dan O'Mearadd494642020-05-01 07:42:23 -0700515 "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700516 "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY
Dan O'Mearadd494642020-05-01 07:42:23 -0700517 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700518 },
519 ],
520 "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.
521 },
522 ],
523 "warning": { # [Output Only] Informational warning message.
524 "message": "A String", # [Output Only] A human-readable description of the warning code.
525 "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.
526 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
527 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
528 {
529 "value": "A String", # [Output Only] A warning data value corresponding to the key.
530 "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).
531 },
532 ],
533 },
534 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
535 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
536 }</pre>
537</div>
538
539<div class="method">
540 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
541 <pre>Retrieves the next page of results.
542
543Args:
544 previous_request: The request for the previous page. (required)
545 previous_response: The response from the request for the previous page. (required)
546
547Returns:
548 A request object that you can call 'execute()' on to request the next
549 page. Returns None if there are no more items in the collection.
550 </pre>
551</div>
552
553</body></html>