Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="compute_v1.html">Compute Engine API</a> . <a href="compute_v1.regionCommitments.html">regionCommitments</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 78 | <code><a href="#aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 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"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 84 | <code><a href="#close">close()</a></code></p> |
| 85 | <p class="firstline">Close httplib2 connections.</p> |
| 86 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 87 | <code><a href="#get">get(project, region, commitment)</a></code></p> |
| 88 | <p class="firstline">Returns the specified commitment resource. Gets a list of available commitments by making a list() request.</p> |
| 89 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 90 | <code><a href="#insert">insert(project, region, body=None, requestId=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 91 | <p class="firstline">Creates a commitment in the specified project using the data included in the request.</p> |
| 92 | <p class="toc_element"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 93 | <code><a href="#list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 94 | <p class="firstline">Retrieves a list of commitments contained within the specified region.</p> |
| 95 | <p class="toc_element"> |
| 96 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 97 | <p class="firstline">Retrieves the next page of results.</p> |
| 98 | <h3>Method Details</h3> |
| 99 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 100 | <code class="details" id="aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 101 | <pre>Retrieves an aggregated list of commitments. |
| 102 | |
| 103 | Args: |
| 104 | project: string, Project ID for this request. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 105 | 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 `<`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 106 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 107 | For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 108 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 109 | You 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 Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 110 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 111 | To 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) ``` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 112 | 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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 113 | 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`) |
| 114 | orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. |
| 115 | |
| 116 | You 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. |
| 117 | |
| 118 | Currently, only sorting by `name` or `creationTimestamp desc` is supported. |
| 119 | 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. |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 120 | returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 121 | |
| 122 | Returns: |
| 123 | An object of the form: |
| 124 | |
| 125 | { |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 126 | "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. |
| 127 | "items": { # A list of CommitmentsScopedList resources. |
| 128 | "a_key": { # [Output Only] Name of the scope containing this set of commitments. |
| 129 | "commitments": [ # [Output Only] A list of commitments contained in this scope. |
| 130 | { # Represents a regional Commitment resource. |
| 131 | # |
| 132 | # 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 ==) |
| 133 | "category": "A String", # The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. |
| 134 | "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. |
| 135 | "description": "A String", # An optional description of this resource. Provide this property when you create the resource. |
| 136 | "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format. |
| 137 | "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
| 138 | "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments. |
| 139 | "licenseResource": { # Commitment for a particular license resource. # The license specification required as part of a license commitment. |
| 140 | "amount": "A String", # The number of licenses purchased. |
| 141 | "coresPerLicense": "A String", # Specifies the core range of the instance for which this license applies. |
| 142 | "license": "A String", # Any applicable license URI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 143 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 144 | "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. |
| 145 | "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). |
| 146 | "region": "A String", # [Output Only] URL of the region where this commitment may be used. |
| 147 | "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 | "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. |
| 150 | "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. |
| 151 | "description": "A String", # An optional description of this resource. Provide this property when you create the resource. |
| 152 | "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
| 153 | "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations. |
| 154 | "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. |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 155 | "satisfiesPzs": True or False, # [Output Only] Reserved for future use. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 156 | "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource. |
| 157 | "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes. |
| 158 | "count": "A String", # Specifies the number of resources that are allocated. |
| 159 | "inUseCount": "A String", # [Output Only] Indicates how many instances are in use. |
| 160 | "instanceProperties": { # Properties of the SKU instances being reserved. Next ID: 9 # The instance properties for the reservation. |
| 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 | "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB. |
| 170 | "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. |
| 171 | }, |
| 172 | ], |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 173 | "locationHint": "A String", # An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 174 | "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. |
| 175 | "minCpuPlatform": "A String", # Minimum cpu platform the reservation. |
| 176 | }, |
| 177 | }, |
| 178 | "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. |
| 179 | "status": "A String", # [Output Only] The status of the reservation. |
| 180 | "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 181 | }, |
| 182 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 183 | "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. |
| 184 | { # Commitment for a particular resource (a Commitment is composed of one or more of these). |
| 185 | "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR. |
| 186 | "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. |
| 187 | "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY |
| 188 | }, |
| 189 | ], |
| 190 | "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| 191 | "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format. |
| 192 | "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. |
| 193 | "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 194 | }, |
| 195 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 196 | "warning": { # [Output Only] Informational warning which replaces the list of commitments when the list is empty. |
| 197 | "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. |
| 198 | "data": [ # [Output Only] Metadata about this warning in key: value format. For example: |
| 199 | # "data": [ { "key": "scope", "value": "zones/us-east1-d" } |
| 200 | { |
| 201 | "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). |
| 202 | "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| 203 | }, |
| 204 | ], |
| 205 | "message": "A String", # [Output Only] A human-readable description of the warning code. |
| 206 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 207 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 208 | }, |
| 209 | "kind": "compute#commitmentAggregatedList", # [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments. |
| 210 | "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. |
| 211 | "selfLink": "A String", # [Output Only] Server-defined URL for this resource. |
| 212 | "unreachables": [ # [Output Only] Unreachable resources. |
| 213 | "A String", |
| 214 | ], |
| 215 | "warning": { # [Output Only] Informational warning message. |
| 216 | "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. |
| 217 | "data": [ # [Output Only] Metadata about this warning in key: value format. For example: |
| 218 | # "data": [ { "key": "scope", "value": "zones/us-east1-d" } |
| 219 | { |
| 220 | "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). |
| 221 | "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| 222 | }, |
| 223 | ], |
| 224 | "message": "A String", # [Output Only] A human-readable description of the warning code. |
| 225 | }, |
| 226 | }</pre> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 227 | </div> |
| 228 | |
| 229 | <div class="method"> |
| 230 | <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code> |
| 231 | <pre>Retrieves the next page of results. |
| 232 | |
| 233 | Args: |
| 234 | previous_request: The request for the previous page. (required) |
| 235 | previous_response: The response from the request for the previous page. (required) |
| 236 | |
| 237 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 238 | A request object that you can call 'execute()' on to request the next |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 239 | page. Returns None if there are no more items in the collection. |
| 240 | </pre> |
| 241 | </div> |
| 242 | |
| 243 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 244 | <code class="details" id="close">close()</code> |
| 245 | <pre>Close httplib2 connections.</pre> |
| 246 | </div> |
| 247 | |
| 248 | <div class="method"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 249 | <code class="details" id="get">get(project, region, commitment)</code> |
| 250 | <pre>Returns the specified commitment resource. Gets a list of available commitments by making a list() request. |
| 251 | |
| 252 | Args: |
| 253 | project: string, Project ID for this request. (required) |
| 254 | region: string, Name of the region for this request. (required) |
| 255 | commitment: string, Name of the commitment to return. (required) |
| 256 | |
| 257 | Returns: |
| 258 | An object of the form: |
| 259 | |
| 260 | { # Represents a regional Commitment resource. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 261 | # |
| 262 | # 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 ==) |
| 263 | "category": "A String", # The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. |
| 264 | "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. |
| 265 | "description": "A String", # An optional description of this resource. Provide this property when you create the resource. |
| 266 | "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format. |
| 267 | "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
| 268 | "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments. |
| 269 | "licenseResource": { # Commitment for a particular license resource. # The license specification required as part of a license commitment. |
| 270 | "amount": "A String", # The number of licenses purchased. |
| 271 | "coresPerLicense": "A String", # Specifies the core range of the instance for which this license applies. |
| 272 | "license": "A String", # Any applicable license URI. |
| 273 | }, |
| 274 | "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. |
| 275 | "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). |
| 276 | "region": "A String", # [Output Only] URL of the region where this commitment may be used. |
| 277 | "reservations": [ # List of reservations in this commitment. |
| 278 | { # 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 ==) |
| 279 | "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. |
| 280 | "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. |
| 281 | "description": "A String", # An optional description of this resource. Provide this property when you create the resource. |
| 282 | "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
| 283 | "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations. |
| 284 | "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. |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 285 | "satisfiesPzs": True or False, # [Output Only] Reserved for future use. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 286 | "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource. |
| 287 | "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes. |
| 288 | "count": "A String", # Specifies the number of resources that are allocated. |
| 289 | "inUseCount": "A String", # [Output Only] Indicates how many instances are in use. |
| 290 | "instanceProperties": { # Properties of the SKU instances being reserved. Next ID: 9 # The instance properties for the reservation. |
| 291 | "guestAccelerators": [ # Specifies accelerator type and count. |
| 292 | { # A specification of the type and number of accelerator cards attached to the instance. |
| 293 | "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance. |
| 294 | "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. |
| 295 | }, |
| 296 | ], |
| 297 | "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. |
| 298 | { |
| 299 | "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB. |
| 300 | "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. |
| 301 | }, |
| 302 | ], |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 303 | "locationHint": "A String", # An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 304 | "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. |
| 305 | "minCpuPlatform": "A String", # Minimum cpu platform the reservation. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 306 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 307 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 308 | "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. |
| 309 | "status": "A String", # [Output Only] The status of the reservation. |
| 310 | "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. |
| 311 | }, |
| 312 | ], |
| 313 | "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. |
| 314 | { # Commitment for a particular resource (a Commitment is composed of one or more of these). |
| 315 | "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR. |
| 316 | "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. |
| 317 | "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY |
| 318 | }, |
| 319 | ], |
| 320 | "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| 321 | "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format. |
| 322 | "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. |
| 323 | "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status. |
| 324 | }</pre> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 325 | </div> |
| 326 | |
| 327 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 328 | <code class="details" id="insert">insert(project, region, body=None, requestId=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 329 | <pre>Creates a commitment in the specified project using the data included in the request. |
| 330 | |
| 331 | Args: |
| 332 | project: string, Project ID for this request. (required) |
| 333 | region: string, Name of the region for this request. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 334 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 335 | The object takes the form of: |
| 336 | |
| 337 | { # Represents a regional Commitment resource. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 338 | # |
| 339 | # 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 ==) |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 340 | "category": "A String", # The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 341 | "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. |
| 342 | "description": "A String", # An optional description of this resource. Provide this property when you create the resource. |
| 343 | "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format. |
| 344 | "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
| 345 | "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 346 | "licenseResource": { # Commitment for a particular license resource. # The license specification required as part of a license commitment. |
| 347 | "amount": "A String", # The number of licenses purchased. |
| 348 | "coresPerLicense": "A String", # Specifies the core range of the instance for which this license applies. |
| 349 | "license": "A String", # Any applicable license URI. |
| 350 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 351 | "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. |
| 352 | "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). |
| 353 | "region": "A String", # [Output Only] URL of the region where this commitment may be used. |
| 354 | "reservations": [ # List of reservations in this commitment. |
| 355 | { # 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 ==) |
| 356 | "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. |
| 357 | "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. |
| 358 | "description": "A String", # An optional description of this resource. Provide this property when you create the resource. |
| 359 | "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
| 360 | "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations. |
| 361 | "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. |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 362 | "satisfiesPzs": True or False, # [Output Only] Reserved for future use. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 363 | "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource. |
| 364 | "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes. |
| 365 | "count": "A String", # Specifies the number of resources that are allocated. |
| 366 | "inUseCount": "A String", # [Output Only] Indicates how many instances are in use. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 367 | "instanceProperties": { # Properties of the SKU instances being reserved. Next ID: 9 # The instance properties for the reservation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 368 | "guestAccelerators": [ # Specifies accelerator type and count. |
| 369 | { # A specification of the type and number of accelerator cards attached to the instance. |
| 370 | "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance. |
| 371 | "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. |
| 372 | }, |
| 373 | ], |
| 374 | "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. |
| 375 | { |
| 376 | "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB. |
| 377 | "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. |
| 378 | }, |
| 379 | ], |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 380 | "locationHint": "A String", # An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 381 | "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. |
| 382 | "minCpuPlatform": "A String", # Minimum cpu platform the reservation. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 383 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 384 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 385 | "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. |
| 386 | "status": "A String", # [Output Only] The status of the reservation. |
| 387 | "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. |
| 388 | }, |
| 389 | ], |
| 390 | "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. |
| 391 | { # Commitment for a particular resource (a Commitment is composed of one or more of these). |
| 392 | "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR. |
| 393 | "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. |
| 394 | "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY |
| 395 | }, |
| 396 | ], |
| 397 | "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| 398 | "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format. |
| 399 | "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. |
| 400 | "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status. |
| 401 | } |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 402 | |
| 403 | 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. |
| 404 | |
| 405 | For 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. |
| 406 | |
| 407 | The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). |
| 408 | |
| 409 | Returns: |
| 410 | An object of the form: |
| 411 | |
| 412 | { # Represents an Operation resource. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 413 | # |
| 414 | # Google Compute Engine has three Operation resources: |
| 415 | # |
| 416 | # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations) |
| 417 | # |
| 418 | # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. |
| 419 | # |
| 420 | # Operations can be global, regional or zonal. |
| 421 | # - For global operations, use the `globalOperations` resource. |
| 422 | # - For regional operations, use the `regionOperations` resource. |
| 423 | # - For zonal operations, use the `zonalOperations` resource. |
| 424 | # |
| 425 | # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==) |
| 426 | "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. |
| 427 | "creationTimestamp": "A String", # [Deprecated] This field is deprecated. |
| 428 | "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. |
| 429 | "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. |
| 430 | "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. |
| 431 | "errors": [ # [Output Only] The array of errors encountered while processing this operation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 432 | { |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 433 | "code": "A String", # [Output Only] The error type identifier for this error. |
| 434 | "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. |
| 435 | "message": "A String", # [Output Only] An optional, human-readable error message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 436 | }, |
| 437 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 438 | }, |
| 439 | "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`. |
| 440 | "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. |
| 441 | "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server. |
| 442 | "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. |
| 443 | "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources. |
| 444 | "name": "A String", # [Output Only] Name of the operation. |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 445 | "operationGroupId": "A String", # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 446 | "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on. |
| 447 | "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. |
| 448 | "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. |
| 449 | "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| 450 | "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. |
| 451 | "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`. |
| 452 | "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. |
| 453 | "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. |
| 454 | "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. |
| 455 | "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`. |
| 456 | "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. |
| 457 | { |
| 458 | "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. |
| 459 | "data": [ # [Output Only] Metadata about this warning in key: value format. For example: |
| 460 | # "data": [ { "key": "scope", "value": "zones/us-east1-d" } |
| 461 | { |
| 462 | "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). |
| 463 | "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| 464 | }, |
| 465 | ], |
| 466 | "message": "A String", # [Output Only] A human-readable description of the warning code. |
| 467 | }, |
| 468 | ], |
| 469 | "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. |
| 470 | }</pre> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 471 | </div> |
| 472 | |
| 473 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 474 | <code class="details" id="list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 475 | <pre>Retrieves a list of commitments contained within the specified region. |
| 476 | |
| 477 | Args: |
| 478 | project: string, Project ID for this request. (required) |
| 479 | region: string, Name of the region for this request. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 480 | 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 `<`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 481 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 482 | For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 483 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 484 | You 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 Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 485 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 486 | To 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) ``` |
| 487 | 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`) |
| 488 | orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. |
| 489 | |
| 490 | You 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. |
| 491 | |
| 492 | Currently, only sorting by `name` or `creationTimestamp desc` is supported. |
| 493 | 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. |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 494 | returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 495 | |
| 496 | Returns: |
| 497 | An object of the form: |
| 498 | |
| 499 | { # Contains a list of Commitment resources. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 500 | "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. |
| 501 | "items": [ # A list of Commitment resources. |
| 502 | { # Represents a regional Commitment resource. |
| 503 | # |
| 504 | # 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 ==) |
| 505 | "category": "A String", # The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. |
| 506 | "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. |
| 507 | "description": "A String", # An optional description of this resource. Provide this property when you create the resource. |
| 508 | "endTimestamp": "A String", # [Output Only] Commitment end time in RFC3339 text format. |
| 509 | "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
| 510 | "kind": "compute#commitment", # [Output Only] Type of the resource. Always compute#commitment for commitments. |
| 511 | "licenseResource": { # Commitment for a particular license resource. # The license specification required as part of a license commitment. |
| 512 | "amount": "A String", # The number of licenses purchased. |
| 513 | "coresPerLicense": "A String", # Specifies the core range of the instance for which this license applies. |
| 514 | "license": "A String", # Any applicable license URI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 515 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 516 | "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. |
| 517 | "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). |
| 518 | "region": "A String", # [Output Only] URL of the region where this commitment may be used. |
| 519 | "reservations": [ # List of reservations in this commitment. |
| 520 | { # 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 ==) |
| 521 | "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. |
| 522 | "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. |
| 523 | "description": "A String", # An optional description of this resource. Provide this property when you create the resource. |
| 524 | "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
| 525 | "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations. |
| 526 | "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. |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 527 | "satisfiesPzs": True or False, # [Output Only] Reserved for future use. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 528 | "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource. |
| 529 | "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes. |
| 530 | "count": "A String", # Specifies the number of resources that are allocated. |
| 531 | "inUseCount": "A String", # [Output Only] Indicates how many instances are in use. |
| 532 | "instanceProperties": { # Properties of the SKU instances being reserved. Next ID: 9 # The instance properties for the reservation. |
| 533 | "guestAccelerators": [ # Specifies accelerator type and count. |
| 534 | { # A specification of the type and number of accelerator cards attached to the instance. |
| 535 | "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance. |
| 536 | "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. |
| 537 | }, |
| 538 | ], |
| 539 | "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. |
| 540 | { |
| 541 | "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB. |
| 542 | "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. |
| 543 | }, |
| 544 | ], |
yoshi-code-bot | b6dc1b9 | 2021-03-02 11:49:08 -0800 | [diff] [blame] | 545 | "locationHint": "A String", # An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 546 | "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. |
| 547 | "minCpuPlatform": "A String", # Minimum cpu platform the reservation. |
| 548 | }, |
| 549 | }, |
| 550 | "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. |
| 551 | "status": "A String", # [Output Only] The status of the reservation. |
| 552 | "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 553 | }, |
| 554 | ], |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 555 | "resources": [ # A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. |
| 556 | { # Commitment for a particular resource (a Commitment is composed of one or more of these). |
| 557 | "acceleratorType": "A String", # Name of the accelerator type resource. Applicable only when the type is ACCELERATOR. |
| 558 | "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. |
| 559 | "type": "A String", # Type of resource for which this commitment applies. Possible values are VCPU and MEMORY |
| 560 | }, |
| 561 | ], |
| 562 | "selfLink": "A String", # [Output Only] Server-defined URL for the resource. |
| 563 | "startTimestamp": "A String", # [Output Only] Commitment start time in RFC3339 text format. |
| 564 | "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. |
| 565 | "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 566 | }, |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 567 | ], |
| 568 | "kind": "compute#commitmentList", # [Output Only] Type of resource. Always compute#commitmentList for lists of commitments. |
| 569 | "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. |
| 570 | "selfLink": "A String", # [Output Only] Server-defined URL for this resource. |
| 571 | "warning": { # [Output Only] Informational warning message. |
| 572 | "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. |
| 573 | "data": [ # [Output Only] Metadata about this warning in key: value format. For example: |
| 574 | # "data": [ { "key": "scope", "value": "zones/us-east1-d" } |
| 575 | { |
| 576 | "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). |
| 577 | "value": "A String", # [Output Only] A warning data value corresponding to the key. |
| 578 | }, |
| 579 | ], |
| 580 | "message": "A String", # [Output Only] A human-readable description of the warning code. |
| 581 | }, |
| 582 | }</pre> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 583 | </div> |
| 584 | |
| 585 | <div class="method"> |
| 586 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 587 | <pre>Retrieves the next page of results. |
| 588 | |
| 589 | Args: |
| 590 | previous_request: The request for the previous page. (required) |
| 591 | previous_response: The response from the request for the previous page. (required) |
| 592 | |
| 593 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 594 | A request object that you can call 'execute()' on to request the next |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 595 | page. Returns None if there are no more items in the collection. |
| 596 | </pre> |
| 597 | </div> |
| 598 | |
| 599 | </body></html> |