v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-131,0021,0174.3 MB
instances

Creates multiple instances. Count specifies the number of instances to create. For more information, seeAbout bulk creation of VMs.

post/projects/{project}/zones/{zone}/instances/bulkInsert

Path parameters

projectstring required

Project ID for this request.

zonestring required

The name of the zone for this request.

Query parameters

requestIdstring

An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.

For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Request body

namePatternstring

The string pattern used for the names of the VMs. Either name_pattern or per_instance_properties must be set. The pattern must contain one continuous sequence of placeholder hash characters (#) with each character corresponding to one digit of the generated instance name. Example: a name_pattern of inst-#### generates instance names such asinst-0001 and inst-0002. If existing instances in the same project and zone have names that match the name pattern then the generated instance numbers start after the biggest existing number. For example, if there exists an instance with nameinst-0050, then instance names generated using the patterninst-#### begin with inst-0051. The name pattern placeholder #...# can contain up to 18 characters.

perInstancePropertiesobject

Per-instance properties to be set on individual instances. Keys of this map specify requested instance names. Can be empty if name_pattern is used.

countstring int64

The maximum number of instances to create.

minCountstring int64

The minimum number of instances to create. If no min_count is specified then count is used as the default value. Ifmin_count instances cannot be created, then no instances will be created and instances already created will be deleted.

sourceInstanceTemplatestring

Specifies the instance template from which to create instances. You may combine sourceInstanceTemplate withinstanceProperties to override specific values from an existing instance template. Bulk API follows the semantics of JSON Merge Patch described by RFC 7396.

It can be a full or partial URL. For example, the following are all valid URLs to an instance template:

  - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
  - projects/project/global/instanceTemplates/instanceTemplate
  - global/instanceTemplates/instanceTemplate

This field is optional.

Response

Successful response