blob: 0334cf8c59ba6bba2523e4186c5e2fc3f458de72 [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>
79<p class="firstline">Deletes the specified instance template resource.</p>
80<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>
85<p class="firstline">Creates an instance template resource in the specified project using the data included in the request.</p>
86<p class="toc_element">
87 <code><a href="#list">list(project, maxResults=None, pageToken=None, filter=None)</a></code></p>
88<p class="firstline">Retrieves the list of instance template resources contained within the specified project.</p>
89<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>
95 <pre>Deletes the specified instance template resource.
96
97Args:
98 project: string, Name of the project scoping this request. (required)
99 instanceTemplate: string, Name of the instance template resource to delete. (required)
100
101Returns:
102 An object of the form:
103
104 { # An operation resource, used to manage asynchronous API requests.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000105 "targetId": "A String", # [Output Only] Unique target ID which identifies a particular incarnation of the target.
106 "clientOperationId": "A String", # [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project
107 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Craig Citroe633be12015-03-02 13:40:36 -0800108 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000109 "zone": "A String", # [Output Only] URL of the zone where the operation resides.
110 "operationType": "A String", # [Output Only] Type of the operation, such as insert, update, and delete.
111 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
112 "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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses.
113 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.
Craig Citroe633be12015-03-02 13:40:36 -0800114 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000115 "status": "A String", # [Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.
116 "insertTime": "A String", # [Output Only] The time that this operation was requested. This is in RFC3339 text format.
117 "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 -0700118 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000119 "message": "A String", # [Output Only] Optional human-readable details for this warning.
120 "code": "A String", # [Output Only] The warning type identifier for this warning.
121 "data": [ # [Output Only] Metadata for this warning in key: value format.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700122 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000123 "value": "A String", # [Output Only] A warning data value corresponding to the key.
124 "key": "A String", # [Output Only] A key for the warning data.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700125 },
126 ],
127 },
128 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000129 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
130 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This is in RFC3339 text format.
131 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#Operation for Operation resources.
132 "name": "A String", # [Output Only] Name of the resource.
133 "region": "A String", # [Output Only] URL of the region where the operation resides. Only applicable for regional resources.
134 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800135 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700136 {
Craig Citroe633be12015-03-02 13:40:36 -0800137 "message": "A String", # [Output Only] An optional, human-readable error message.
138 "code": "A String", # [Output Only] The error type identifier for this error.
139 "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 -0700140 },
141 ],
142 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000143 "endTime": "A String", # [Output Only] The time that this operation was completed. This is in RFC3339 text format.
Craig Citroe633be12015-03-02 13:40:36 -0800144 "selfLink": "A String", # [Output Only] Server defined URL for the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000145 "targetLink": "A String", # [Output Only] URL of the resource the operation is mutating.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700146 }</pre>
147</div>
148
149<div class="method">
150 <code class="details" id="get">get(project, instanceTemplate)</code>
151 <pre>Returns the specified instance template resource.
152
153Args:
154 project: string, Name of the project scoping this request. (required)
155 instanceTemplate: string, Name of the instance template resource to return. (required)
156
157Returns:
158 An object of the form:
159
160 { # An Instance Template resource.
161 "kind": "compute#instanceTemplate", # Type of the resource.
162 "description": "A String", # An optional textual description of the instance template resource; provided by the client when the resource is created.
163 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
164 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
165 "properties": { # The instance properties portion of this instance template resource.
166 "machineType": "A String", # Name of the machine type resource describing which machine type to use to host the instances created based on this template; provided by the client when the instance template is created.
167 "description": "A String", # An optional textual description for the instances created based on the instance template resource; provided by the client when the template is created.
168 "tags": { # A set of instance tags. # A list of tags to be applied to the instances created based on this template used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
169 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
170 "A String",
171 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000172 "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.
173 #
174 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700175 },
176 "disks": [ # Array of disks associated with instance created based on this template.
177 { # An instance-attached disk resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000178 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/ 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.
179 #
180 # 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.
181 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
182 "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.
183 #
184 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
185 #
186 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
187 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
188 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
189 "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:
190 #
191 # global/images/my-private-image
192 #
193 # 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:
194 #
195 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
196 #
197 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
198 "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:
199 #
200 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
201 #
202 # 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:
203 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
204 # - projects/project/zones/zone/diskTypes/diskType
205 # - zones/zone/diskTypes/diskType
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700206 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000207 "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).
208 "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.
209 "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.
210 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700211 "A String",
212 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000213 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800214 "interface": "A String",
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000215 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
216 "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 -0700217 },
218 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000219 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for the instances created based on this template.
220 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user).
221 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. The default behavior is MIGRATE. For more information, see Setting maintenance behavior.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700222 },
223 "canIpForward": True or False, # Allows 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, say true. If unsure, leave this set to false.
224 "serviceAccounts": [ # A list of service accounts each with specified scopes, for which access tokens are to be made available to the instances created based on this template, through metadata queries.
225 { # A service account.
226 "scopes": [ # The list of scopes to be made available for this service account.
227 "A String",
228 ],
229 "email": "A String", # Email address of the service account.
230 },
231 ],
232 "metadata": { # A metadata key/value entry. # Metadata key/value pairs assigned to instances created based on this template. Consists of custom metadata or predefined keys; see Instance documentation for more information.
233 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
234 {
235 "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.
236 "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.
237 },
238 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000239 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
240 "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 -0700241 },
242 "networkInterfaces": [ # Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instances created based based on this template will have no external internet access.
243 { # A network interface resource attached to an instance.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000244 "accessConfigs": [ # An array of configurations for this interface. Currently, <codeONE_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 -0700245 { # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000246 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
247 "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 -0700248 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000249 "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 -0700250 },
251 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000252 "networkIP": "A String", # [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface.
253 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
254 "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:
255 #
256 # global/networks/default
257 #
258 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
259 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
260 # - projects/project/global/networks/network
261 # - global/networks/default
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700262 },
263 ],
264 },
265 "selfLink": "A String", # Server defined URL for the resource (output only).
266 "name": "A String", # Name of the instance template resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035
267 }</pre>
268</div>
269
270<div class="method">
271 <code class="details" id="insert">insert(project, body)</code>
272 <pre>Creates an instance template resource in the specified project using the data included in the request.
273
274Args:
275 project: string, Name of the project scoping this request. (required)
276 body: object, The request body. (required)
277 The object takes the form of:
278
279{ # An Instance Template resource.
280 "kind": "compute#instanceTemplate", # Type of the resource.
281 "description": "A String", # An optional textual description of the instance template resource; provided by the client when the resource is created.
282 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
283 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
284 "properties": { # The instance properties portion of this instance template resource.
285 "machineType": "A String", # Name of the machine type resource describing which machine type to use to host the instances created based on this template; provided by the client when the instance template is created.
286 "description": "A String", # An optional textual description for the instances created based on the instance template resource; provided by the client when the template is created.
287 "tags": { # A set of instance tags. # A list of tags to be applied to the instances created based on this template used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
288 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
289 "A String",
290 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000291 "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.
292 #
293 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700294 },
295 "disks": [ # Array of disks associated with instance created based on this template.
296 { # An instance-attached disk resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000297 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/ 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.
298 #
299 # 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.
300 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
301 "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.
302 #
303 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
304 #
305 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
306 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
307 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
308 "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:
309 #
310 # global/images/my-private-image
311 #
312 # 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:
313 #
314 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
315 #
316 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
317 "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:
318 #
319 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
320 #
321 # 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:
322 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
323 # - projects/project/zones/zone/diskTypes/diskType
324 # - zones/zone/diskTypes/diskType
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700325 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000326 "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).
327 "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.
328 "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.
329 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700330 "A String",
331 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000332 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800333 "interface": "A String",
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000334 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
335 "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 -0700336 },
337 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000338 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for the instances created based on this template.
339 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user).
340 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. The default behavior is MIGRATE. For more information, see Setting maintenance behavior.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700341 },
342 "canIpForward": True or False, # Allows 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, say true. If unsure, leave this set to false.
343 "serviceAccounts": [ # A list of service accounts each with specified scopes, for which access tokens are to be made available to the instances created based on this template, through metadata queries.
344 { # A service account.
345 "scopes": [ # The list of scopes to be made available for this service account.
346 "A String",
347 ],
348 "email": "A String", # Email address of the service account.
349 },
350 ],
351 "metadata": { # A metadata key/value entry. # Metadata key/value pairs assigned to instances created based on this template. Consists of custom metadata or predefined keys; see Instance documentation for more information.
352 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
353 {
354 "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.
355 "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.
356 },
357 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000358 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
359 "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 -0700360 },
361 "networkInterfaces": [ # Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instances created based based on this template will have no external internet access.
362 { # A network interface resource attached to an instance.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000363 "accessConfigs": [ # An array of configurations for this interface. Currently, <codeONE_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 -0700364 { # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000365 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
366 "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 -0700367 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000368 "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 -0700369 },
370 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000371 "networkIP": "A String", # [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface.
372 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
373 "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:
374 #
375 # global/networks/default
376 #
377 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
378 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
379 # - projects/project/global/networks/network
380 # - global/networks/default
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700381 },
382 ],
383 },
384 "selfLink": "A String", # Server defined URL for the resource (output only).
385 "name": "A String", # Name of the instance template resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035
386 }
387
388
389Returns:
390 An object of the form:
391
392 { # An operation resource, used to manage asynchronous API requests.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000393 "targetId": "A String", # [Output Only] Unique target ID which identifies a particular incarnation of the target.
394 "clientOperationId": "A String", # [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project
395 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Craig Citroe633be12015-03-02 13:40:36 -0800396 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000397 "zone": "A String", # [Output Only] URL of the zone where the operation resides.
398 "operationType": "A String", # [Output Only] Type of the operation, such as insert, update, and delete.
399 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
400 "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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses.
401 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.
Craig Citroe633be12015-03-02 13:40:36 -0800402 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000403 "status": "A String", # [Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.
404 "insertTime": "A String", # [Output Only] The time that this operation was requested. This is in RFC3339 text format.
405 "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 -0700406 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000407 "message": "A String", # [Output Only] Optional human-readable details for this warning.
408 "code": "A String", # [Output Only] The warning type identifier for this warning.
409 "data": [ # [Output Only] Metadata for this warning in key: value format.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700410 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000411 "value": "A String", # [Output Only] A warning data value corresponding to the key.
412 "key": "A String", # [Output Only] A key for the warning data.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700413 },
414 ],
415 },
416 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000417 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
418 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This is in RFC3339 text format.
419 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#Operation for Operation resources.
420 "name": "A String", # [Output Only] Name of the resource.
421 "region": "A String", # [Output Only] URL of the region where the operation resides. Only applicable for regional resources.
422 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800423 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700424 {
Craig Citroe633be12015-03-02 13:40:36 -0800425 "message": "A String", # [Output Only] An optional, human-readable error message.
426 "code": "A String", # [Output Only] The error type identifier for this error.
427 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700428 },
429 ],
430 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000431 "endTime": "A String", # [Output Only] The time that this operation was completed. This is in RFC3339 text format.
Craig Citroe633be12015-03-02 13:40:36 -0800432 "selfLink": "A String", # [Output Only] Server defined URL for the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000433 "targetLink": "A String", # [Output Only] URL of the resource the operation is mutating.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700434 }</pre>
435</div>
436
437<div class="method">
438 <code class="details" id="list">list(project, maxResults=None, pageToken=None, filter=None)</code>
439 <pre>Retrieves the list of instance template resources contained within the specified project.
440
441Args:
442 project: string, Name of the project scoping this request. (required)
443 maxResults: integer, Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.
444 pageToken: string, Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
445 filter: string, Optional. Filter expression for filtering listed resources.
446
447Returns:
448 An object of the form:
449
450 { # Contains a list of instance template resources.
451 "nextPageToken": "A String", # A token used to continue a truncated list request (output only).
Craig Citroe633be12015-03-02 13:40:36 -0800452 "items": [ # A list of InstanceTemplate resources.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700453 { # An Instance Template resource.
454 "kind": "compute#instanceTemplate", # Type of the resource.
455 "description": "A String", # An optional textual description of the instance template resource; provided by the client when the resource is created.
456 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
457 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
458 "properties": { # The instance properties portion of this instance template resource.
459 "machineType": "A String", # Name of the machine type resource describing which machine type to use to host the instances created based on this template; provided by the client when the instance template is created.
460 "description": "A String", # An optional textual description for the instances created based on the instance template resource; provided by the client when the template is created.
461 "tags": { # A set of instance tags. # A list of tags to be applied to the instances created based on this template used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
462 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
463 "A String",
464 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000465 "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.
466 #
467 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700468 },
469 "disks": [ # Array of disks associated with instance created based on this template.
470 { # An instance-attached disk resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000471 "deviceName": "A String", # Specifies a unique device name of your choice that is reflected into the /dev/ 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.
472 #
473 # 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.
474 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
475 "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.
476 #
477 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
478 #
479 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
480 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
481 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
482 "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:
483 #
484 # global/images/my-private-image
485 #
486 # 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:
487 #
488 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
489 #
490 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
491 "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:
492 #
493 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
494 #
495 # 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:
496 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
497 # - projects/project/zones/zone/diskTypes/diskType
498 # - zones/zone/diskTypes/diskType
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700499 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000500 "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).
501 "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.
502 "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.
503 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700504 "A String",
505 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000506 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800507 "interface": "A String",
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000508 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
509 "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 -0700510 },
511 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000512 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for the instances created based on this template.
513 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user).
514 "onHostMaintenance": "A String", # Defines the maintenance behavior for this instance. The default behavior is MIGRATE. For more information, see Setting maintenance behavior.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700515 },
516 "canIpForward": True or False, # Allows 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, say true. If unsure, leave this set to false.
517 "serviceAccounts": [ # A list of service accounts each with specified scopes, for which access tokens are to be made available to the instances created based on this template, through metadata queries.
518 { # A service account.
519 "scopes": [ # The list of scopes to be made available for this service account.
520 "A String",
521 ],
522 "email": "A String", # Email address of the service account.
523 },
524 ],
525 "metadata": { # A metadata key/value entry. # Metadata key/value pairs assigned to instances created based on this template. Consists of custom metadata or predefined keys; see Instance documentation for more information.
526 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
527 {
528 "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.
529 "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.
530 },
531 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000532 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
533 "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 -0700534 },
535 "networkInterfaces": [ # Array of configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instances created based based on this template will have no external internet access.
536 { # A network interface resource attached to an instance.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000537 "accessConfigs": [ # An array of configurations for this interface. Currently, <codeONE_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 -0700538 { # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000539 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
540 "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 -0700541 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000542 "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 -0700543 },
544 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000545 "networkIP": "A String", # [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface.
546 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
547 "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:
548 #
549 # global/networks/default
550 #
551 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
552 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
553 # - projects/project/global/networks/network
554 # - global/networks/default
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700555 },
556 ],
557 },
558 "selfLink": "A String", # Server defined URL for the resource (output only).
559 "name": "A String", # Name of the instance template resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035
560 },
561 ],
562 "kind": "compute#instanceTemplateList", # Type of resource.
563 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
564 "selfLink": "A String", # Server defined URL for this resource (output only).
565 }</pre>
566</div>
567
568<div class="method">
569 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
570 <pre>Retrieves the next page of results.
571
572Args:
573 previous_request: The request for the previous page. (required)
574 previous_response: The response from the request for the previous page. (required)
575
576Returns:
577 A request object that you can call 'execute()' on to request the next
578 page. Returns None if there are no more items in the collection.
579 </pre>
580</div>
581
582</body></html>