blob: 6bb67779e4305e6cddda5efff1bc31e246018b51 [file] [log] [blame]
Craig Citro0e5b9bf2014-10-15 10:26:14 -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.instanceTemplates.html">instanceTemplates</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#delete">delete(project, instanceTemplate)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080079<p class="firstline">Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone.</p>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070080<p class="toc_element">
81 <code><a href="#get">get(project, instanceTemplate)</a></code></p>
82<p class="firstline">Returns the specified instance template resource.</p>
83<p class="toc_element">
84 <code><a href="#insert">insert(project, body)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080085<p class="firstline">Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.</p>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070086<p class="toc_element">
87 <code><a href="#list">list(project, maxResults=None, pageToken=None, filter=None)</a></code></p>
Nathaniel Manista4f877e52015-06-15 16:44:50 +000088<p class="firstline">Retrieves a list of instance templates that are contained within the specified project and zone.</p>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070089<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<h3>Method Details</h3>
93<div class="method">
94 <code class="details" id="delete">delete(project, instanceTemplate)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080095 <pre>Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone.
Craig Citro0e5b9bf2014-10-15 10:26:14 -070096
97Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080098 project: string, Project ID for this request. (required)
Nathaniel Manista4f877e52015-06-15 16:44:50 +000099 instanceTemplate: string, The name of the instance template to delete. (required)
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700100
101Returns:
102 An object of the form:
103
Takashi Matsuo06694102015-09-11 13:55:40 -0700104 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800105 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
106 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000107 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800108 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
109 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
110 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
111 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000112 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800113 "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.
114 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800115 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800116 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
117 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000118 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700119 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800120 "message": "A String", # [Output Only] A human-readable description of the warning code.
121 "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.
122 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
123 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700124 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000125 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800126 "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).
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700127 },
128 ],
129 },
130 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000131 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800132 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
133 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000134 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800135 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000136 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800137 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700138 {
Craig Citroe633be12015-03-02 13:40:36 -0800139 "message": "A String", # [Output Only] An optional, human-readable error message.
140 "code": "A String", # [Output Only] The error type identifier for this error.
141 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700142 },
143 ],
144 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800145 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700146 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800147 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700148 }</pre>
149</div>
150
151<div class="method">
152 <code class="details" id="get">get(project, instanceTemplate)</code>
153 <pre>Returns the specified instance template resource.
154
155Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800156 project: string, Project ID for this request. (required)
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000157 instanceTemplate: string, The name of the instance template. (required)
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700158
159Returns:
160 An object of the form:
161
162 { # An Instance Template resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000163 "kind": "compute#instanceTemplate", # [Output Only] The resource type, which is always compute#instanceTemplate for instance templates.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800164 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000165 "id": "A String", # [Output Only] A unique identifier for this instance template. The server defines this identifier.
166 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance template in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800167 "properties": { # The instance properties for this instance template.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000168 "machineType": "A String", # The machine type to use for instances that are created from this template.
169 "description": "A String", # An optional text description for the instances that are created from this instance template.
170 "tags": { # A set of instance tags. # A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700171 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
172 "A String",
173 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000174 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
175 #
176 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700177 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000178 "disks": [ # An array of disks that are associated with the instances that are created from this template.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700179 { # An instance-attached disk resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700180 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000181 #
182 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
183 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
184 "initializeParams": { # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
185 #
186 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
187 #
188 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
189 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
190 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
191 "sourceImage": "A String", # A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example:
192 #
193 # global/images/my-private-image
194 #
195 # Or you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:
196 #
197 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
198 #
199 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
200 "diskType": "A String", # Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example:
201 #
202 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
203 #
204 # Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values:
205 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
206 # - projects/project/zones/zone/diskTypes/diskType
207 # - zones/zone/diskTypes/diskType
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700208 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000209 "autoDelete": True or False, # Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
210 "index": 42, # Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.
211 "boot": True or False, # Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
212 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700213 "A String",
214 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000215 "mode": "A String", # The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800216 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000217 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
218 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700219 },
220 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800221 "scheduling": { # Sets the scheduling options for an Instance. # Specifies the scheduling options for the instances that are created from this template.
Takashi Matsuo06694102015-09-11 13:55:40 -0700222 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted.
223 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800224 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700225 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800226 "canIpForward": True or False, # Enables instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the canIpForward documentation for more information.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000227 "serviceAccounts": [ # A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700228 { # A service account.
229 "scopes": [ # The list of scopes to be made available for this service account.
230 "A String",
231 ],
232 "email": "A String", # Email address of the service account.
233 },
234 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000235 "metadata": { # A metadata key/value entry. # The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700236 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
237 {
238 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.
239 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
240 },
241 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000242 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
243 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700244 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800245 "networkInterfaces": [ # An array of network access configurations for this interface.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700246 { # A network interface resource attached to an instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700247 "accessConfigs": [ # An array of configurations for this interface. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700248 { # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000249 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
250 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700251 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000252 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700253 },
254 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000255 "networkIP": "A String", # [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface.
256 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800257 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs:
258 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork
259 # - zones/zone/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000260 "network": "A String", # URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:
261 #
262 # global/networks/default
263 #
264 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
265 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
266 # - projects/project/global/networks/network
267 # - global/networks/default
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700268 },
269 ],
270 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000271 "selfLink": "A String", # [Output Only] The URL for this instance template. The server defines this URL.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800272 "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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700273 }</pre>
274</div>
275
276<div class="method">
277 <code class="details" id="insert">insert(project, body)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800278 <pre>Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700279
280Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800281 project: string, Project ID for this request. (required)
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700282 body: object, The request body. (required)
283 The object takes the form of:
284
285{ # An Instance Template resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000286 "kind": "compute#instanceTemplate", # [Output Only] The resource type, which is always compute#instanceTemplate for instance templates.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800287 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000288 "id": "A String", # [Output Only] A unique identifier for this instance template. The server defines this identifier.
289 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance template in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800290 "properties": { # The instance properties for this instance template.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000291 "machineType": "A String", # The machine type to use for instances that are created from this template.
292 "description": "A String", # An optional text description for the instances that are created from this instance template.
293 "tags": { # A set of instance tags. # A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700294 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
295 "A String",
296 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000297 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
298 #
299 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700300 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000301 "disks": [ # An array of disks that are associated with the instances that are created from this template.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700302 { # An instance-attached disk resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700303 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000304 #
305 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
306 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
307 "initializeParams": { # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
308 #
309 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
310 #
311 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
312 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
313 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
314 "sourceImage": "A String", # A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example:
315 #
316 # global/images/my-private-image
317 #
318 # Or you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:
319 #
320 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
321 #
322 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
323 "diskType": "A String", # Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example:
324 #
325 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
326 #
327 # Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values:
328 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
329 # - projects/project/zones/zone/diskTypes/diskType
330 # - zones/zone/diskTypes/diskType
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700331 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000332 "autoDelete": True or False, # Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
333 "index": 42, # Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.
334 "boot": True or False, # Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
335 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700336 "A String",
337 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000338 "mode": "A String", # The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800339 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000340 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
341 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700342 },
343 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800344 "scheduling": { # Sets the scheduling options for an Instance. # Specifies the scheduling options for the instances that are created from this template.
Takashi Matsuo06694102015-09-11 13:55:40 -0700345 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted.
346 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800347 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700348 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800349 "canIpForward": True or False, # Enables instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the canIpForward documentation for more information.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000350 "serviceAccounts": [ # A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700351 { # A service account.
352 "scopes": [ # The list of scopes to be made available for this service account.
353 "A String",
354 ],
355 "email": "A String", # Email address of the service account.
356 },
357 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000358 "metadata": { # A metadata key/value entry. # The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700359 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
360 {
361 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.
362 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
363 },
364 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000365 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
366 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700367 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800368 "networkInterfaces": [ # An array of network access configurations for this interface.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700369 { # A network interface resource attached to an instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700370 "accessConfigs": [ # An array of configurations for this interface. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700371 { # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000372 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
373 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700374 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000375 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700376 },
377 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000378 "networkIP": "A String", # [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface.
379 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800380 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs:
381 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork
382 # - zones/zone/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000383 "network": "A String", # URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:
384 #
385 # global/networks/default
386 #
387 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
388 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
389 # - projects/project/global/networks/network
390 # - global/networks/default
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700391 },
392 ],
393 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000394 "selfLink": "A String", # [Output Only] The URL for this instance template. The server defines this URL.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800395 "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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700396 }
397
398
399Returns:
400 An object of the form:
401
Takashi Matsuo06694102015-09-11 13:55:40 -0700402 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800403 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
404 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000405 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800406 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
407 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
408 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
409 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000410 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800411 "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.
412 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800413 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800414 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
415 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000416 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700417 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800418 "message": "A String", # [Output Only] A human-readable description of the warning code.
419 "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.
420 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
421 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700422 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000423 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800424 "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).
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700425 },
426 ],
427 },
428 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000429 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800430 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
431 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000432 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800433 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000434 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800435 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700436 {
Craig Citroe633be12015-03-02 13:40:36 -0800437 "message": "A String", # [Output Only] An optional, human-readable error message.
438 "code": "A String", # [Output Only] The error type identifier for this error.
439 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700440 },
441 ],
442 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800443 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700444 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800445 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700446 }</pre>
447</div>
448
449<div class="method">
450 <code class="details" id="list">list(project, maxResults=None, pageToken=None, filter=None)</code>
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000451 <pre>Retrieves a list of instance templates that are contained within the specified project and zone.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700452
453Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800454 project: string, Project ID for this request. (required)
455 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.
456 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.
457 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.
Takashi Matsuo06694102015-09-11 13:55:40 -0700458
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800459The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.
Takashi Matsuo06694102015-09-11 13:55:40 -0700460
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800461For example, to filter for instances whose name is not equal to example-instance, you would use filter=name ne example-instance.
462
463Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.
464
465The Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions meaning that resources must match all expressions to pass the filters.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700466
467Returns:
468 An object of the form:
469
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000470 { # A list of instance templates.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800471 "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.
472 "items": [ # [Output Only] list of InstanceTemplate resources.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700473 { # An Instance Template resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000474 "kind": "compute#instanceTemplate", # [Output Only] The resource type, which is always compute#instanceTemplate for instance templates.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800475 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000476 "id": "A String", # [Output Only] A unique identifier for this instance template. The server defines this identifier.
477 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance template in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800478 "properties": { # The instance properties for this instance template.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000479 "machineType": "A String", # The machine type to use for instances that are created from this template.
480 "description": "A String", # An optional text description for the instances that are created from this instance template.
481 "tags": { # A set of instance tags. # A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700482 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
483 "A String",
484 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000485 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
486 #
487 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700488 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000489 "disks": [ # An array of disks that are associated with the instances that are created from this template.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700490 { # An instance-attached disk resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700491 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000492 #
493 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
494 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
495 "initializeParams": { # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
496 #
497 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
498 #
499 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
500 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
501 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
502 "sourceImage": "A String", # A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example:
503 #
504 # global/images/my-private-image
505 #
506 # Or you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:
507 #
508 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
509 #
510 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
511 "diskType": "A String", # Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example:
512 #
513 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
514 #
515 # Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values:
516 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
517 # - projects/project/zones/zone/diskTypes/diskType
518 # - zones/zone/diskTypes/diskType
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700519 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000520 "autoDelete": True or False, # Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
521 "index": 42, # Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.
522 "boot": True or False, # Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
523 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700524 "A String",
525 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000526 "mode": "A String", # The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800527 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000528 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
529 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700530 },
531 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800532 "scheduling": { # Sets the scheduling options for an Instance. # Specifies the scheduling options for the instances that are created from this template.
Takashi Matsuo06694102015-09-11 13:55:40 -0700533 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted.
534 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800535 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700536 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800537 "canIpForward": True or False, # Enables instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the canIpForward documentation for more information.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000538 "serviceAccounts": [ # A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700539 { # A service account.
540 "scopes": [ # The list of scopes to be made available for this service account.
541 "A String",
542 ],
543 "email": "A String", # Email address of the service account.
544 },
545 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000546 "metadata": { # A metadata key/value entry. # The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700547 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
548 {
549 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.
550 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
551 },
552 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000553 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
554 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700555 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800556 "networkInterfaces": [ # An array of network access configurations for this interface.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700557 { # A network interface resource attached to an instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700558 "accessConfigs": [ # An array of configurations for this interface. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700559 { # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000560 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
561 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700562 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000563 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700564 },
565 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000566 "networkIP": "A String", # [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface.
567 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800568 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs:
569 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork
570 # - zones/zone/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000571 "network": "A String", # URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:
572 #
573 # global/networks/default
574 #
575 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
576 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
577 # - projects/project/global/networks/network
578 # - global/networks/default
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700579 },
580 ],
581 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000582 "selfLink": "A String", # [Output Only] The URL for this instance template. The server defines this URL.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800583 "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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700584 },
585 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000586 "kind": "compute#instanceTemplateList", # [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists.
587 "id": "A String", # [Output Only] A unique identifier for this instance template. The server defines this identifier.
588 "selfLink": "A String", # [Output Only] The URL for this instance template list. The server defines this URL.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700589 }</pre>
590</div>
591
592<div class="method">
593 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
594 <pre>Retrieves the next page of results.
595
596Args:
597 previous_request: The request for the previous page. (required)
598 previous_response: The response from the request for the previous page. (required)
599
600Returns:
601 A request object that you can call 'execute()' on to request the next
602 page. Returns None if there are no more items in the collection.
603 </pre>
604</div>
605
606</body></html>