I`m trying to create a gce instance "with a container" (as mentioned in gcloud) by using POST https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances.
How can I pass the container image url in the request payload?
I`m trying to create a gce instance "with a container" (as mentioned in gcloud) by using POST https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances.
How can I pass the container image url in the request payload?
If you are trying to set the "Machine Type", then you can specify the URL following the syntax mentioned in this document.
In document:
Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type:
zones/us-central1-f/machineTypes/n1-standard-1
To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB):
zones/zone/machineTypes/custom-CPUS-MEMORY
For example: zones/us-central1-f/machineTypes/custom-4-5120 For a full list of restrictions, read the Specifications for custom machine types.
If you instead, you want to create a container cluster, then the API method mentioned in this link can help you.