Google Cloud Compute Engine Instances API

Manage virtual machine instances

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).
Business capability
IT Infrastructure Management BC-600.50

Operations 51

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig Delete a NIC access config · Delete access config instances #
Ask an LLM
“How do I remove an access config from an instance's network interface?”
“Can I delete a single NIC access config without touching the rest of the interface?”
Tell an agent destructive · confirm first
Delete access config {accessConfig} from network interface {networkInterface} on instance {instance} in {project}/{zone}.
Remove the {accessConfig} access config on {networkInterface} of {instance}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/attachDisk Attach a disk to an instance · Attach disk instances #
Ask an LLM
“How do I attach an existing persistent disk to a running instance?”
“Can I force attach a regional disk that is already attached to another instance?”
Tell an agent
Attach disk {source} to instance {instance} in zone {zone}, project {project}.
Attach disk {source} to instance {instance} in {zone}, project {project}, force-attaching {forceAttach}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/reset Reset an instance · Reset instances #
Ask an LLM
“How do I hard reset a stopped instance without a graceful shutdown?”
“Can I reboot an instance that won't respond to a stop and start?”
Tell an agent destructive · confirm first
Reset instance {instance} in zone {zone}, project {project}.
Hard reset {instance} in {zone}, project {project}, skipping graceful shutdown.
PATCH /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig Update a Shielded Instance config · Update shielded instance config instances #
Ask an LLM
“How do I enable vTPM on a stopped Shielded Instance?”
“Can I turn on integrity monitoring for an instance's Shielded config?”
Tell an agent
Set vTPM enabled to {enableVtpm} on instance {instance} in {zone}, project {project}.
Update Shielded Instance config on {instance} in {zone}, project {project}, with secure boot {enableSecureBoot}.
PATCH /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface Update an instance's network interface · Update network interface instances #
Ask an LLM
“How do I change the alias IP ranges on an instance's network interface?”
“Can I move an instance's network interface to a different subnetwork?”
Tell an agent
Update network interface {networkInterface} on instance {instance} in {zone}, project {project}.
Set alias IP ranges {aliasIpRanges} on interface {networkInterface} of {instance} in {zone}, project {project}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/removeResourcePolicies Remove resource policies from an instance · Remove resource policies instances #
Ask an LLM
“How do I detach a snapshot or backup policy from an instance?”
“Can I remove several resource policies from one instance at once?”
Tell an agent destructive · confirm first
Remove resource policies {resourcePolicies} from instance {instance} in {zone}, project {project}.
Detach the backup policy from {instance} in {zone}, project {project}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions Check IAM permissions on an instance · Test iam permissions instances #
Ask an LLM
“Which IAM permissions does my service account have on a specific instance?”
“Can I check whether an instance allows a certain permission before changing it?”
Tell an agent
Test IAM permissions {permissions} on instance {resource} in {zone}, project {project}.
Check if instance {resource} in {zone}, project {project}, has permission {permissions}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount Set the service account on an instance · Set service account instances #
Ask an LLM
“How do I change the service account and scopes on an existing instance?”
“Can I switch an instance to a different service account without recreating it?”
Tell an agent
Set service account {email} with scopes {scopes} on instance {instance} in {zone}, project {project}.
Change the service account on {instance} in {zone}, project {project}, to {email}.
PUT /compute/v1/projects/{project}/zones/{zone}/instances/{instance} Update an instance's properties · Update instances #
Ask an LLM
“How do I change an instance's machine type or scheduling while it is running?”
“Can I update an instance's labels or metadata without stopping it?”
Tell an agent
Update instance {instance} in {zone}, project {project} to machine type {machineType}.
Set instance {instance} in {zone}, project {project} to use scheduling {scheduling}.
GET /compute/v1/projects/{project}/zones/{zone}/instances/{instance} Get an instance's details · Get instances #
Ask an LLM
“What is the machine type, status and network of a specific instance?”
“Can I look up one instance by name in a zone?”
Tell an agent
Get instance {instance} in {zone}, project {project}.
Show the details of {instance} in {zone}, project {project}.
DELETE /compute/v1/projects/{project}/zones/{zone}/instances/{instance} Delete an instance · Delete instances #
Ask an LLM
“How do I permanently delete a stopped instance?”
“Can I skip the graceful shutdown when deleting an instance?”
Tell an agent destructive · confirm first
Delete instance {instance} in {zone}, project {project}.
Permanently remove {instance} in {zone}, project {project}, with graceful shutdown skipped.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/start Start a stopped instance · Start instances #
Ask an LLM
“How do I restart an instance that I stopped earlier?”
“Can I start a stopped instance without recreating it?”
Tell an agent
Start instance {instance} in {zone}, project {project}.
Restart the stopped instance {instance} in {zone}, project {project}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/bulkInsert Create many instances at once · Bulk insert instances #
Ask an LLM
“How do I create a large number of identical instances in one request?”
“Can I bulk insert instances from an instance template with per-instance overrides?”
Tell an agent
Bulk insert {count} instances from template {sourceInstanceTemplate} in {zone}, project {project}.
Create instances {namePattern} in {zone}, project {project}, with per-instance properties {perInstanceProperties}.
GET /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/serialPort Get serial port output from an instance · Get serial port output instances #
Ask an LLM
“How do I read the last 1 MB of console output from a VM?”
“Can I fetch serial port output from a specific COM port on an instance?”
Tell an agent
Get serial port output for instance {instance} in {zone}, project {project}.
Fetch COM port {port} output from {instance} in {zone}, project {project}.
GET /compute/v1/projects/{project}/aggregated/instances List instances across all zones · Aggregated list instances #
Ask an LLM
“How do I see every VM instance in my project, no matter which zone it's in?”
“Can I filter the aggregated instance list by status or name?”
Tell an agent
List all instances in project {project}.
Show every instance in {project} matching {filter}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/deleteNetworkInterface Remove a dynamic network interface · Delete network interface instances #
Ask an LLM
“How do I detach a dynamic network interface from a running VM?”
“Can I remove just one network interface without stopping the instance?”
Tell an agent destructive · confirm first
Delete network interface {networkInterfaceName} from instance {instance} in {project}/{zone}.
Detach dynamic interface {networkInterfaceName} from {project}/{zone}/{instance}.
GET /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls See the firewalls applied to an interface · Get effective firewalls instances #
Ask an LLM
“What firewall rules are actually applied to a VM's network interface?”
“Can I check the effective firewall for one interface of an instance?”
Tell an agent
Show the effective firewalls on interface {networkInterface} of instance {instance} in {project}/{zone}.
List firewall rules applied to {networkInterface} on {project}/{zone}/{instance}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent Simulate a host maintenance event · Simulate maintenance event instances #
Ask an LLM
“How do I test what happens when a host maintenance event hits my VM?”
“Can I simulate maintenance on a preemptible VM before it gets preempted?”
Tell an agent
Simulate a host maintenance event on instance {instance} in {project}/{zone}.
Trigger a maintenance simulation on {project}/{zone}/{instance} with extended notifications set to {withExtendedNotifications}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform Set the minimum CPU platform · Set min cpu platform instances #
Ask an LLM
“How do I make sure a VM always runs on a CPU platform that supports a certain instruction set?”
“Can I change the minimum CPU platform on a stopped instance?”
Tell an agent
Set the minimum CPU platform of instance {instance} in {project}/{zone} to {minCpuPlatform}.
Require {project}/{zone}/{instance} to run on at least CPU platform {minCpuPlatform}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineType Change an instance's machine type · Set machine type instances #
Ask an LLM
“How do I resize a stopped VM to a different machine type?”
“Can I upgrade a VM's machine type after it's already created?”
Tell an agent
Change instance {instance} in {project}/{zone} to machine type {machineType}.
Resize {project}/{zone}/{instance} to {machineType}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection Protect an instance from accidental deletion · Set deletion protection instances #
Ask an LLM
“How do I stop an instance from being deleted by mistake?”
“Can I turn on deletion protection for a VM that's already running?”
Tell an agent
Set deletion protection on instance {resource} in {project}/{zone} to {deletionProtection}.
Protect {project}/{zone}/{resource} from deletion by setting deletion protection to {deletionProtection}.
GET /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/referrers List resources that refer to an instance · List referrers instances #
Ask an LLM
“Which instance groups or other resources reference a particular VM?”
“Can I see what depends on a given instance?”
Tell an agent
List resources that refer to instance {instance} in {project}/{zone}.
Show referrers of {project}/{zone}/{instance} matching {filter}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/performMaintenance Trigger a manual maintenance event · Perform maintenance instances #
Ask an LLM
“How do I manually trigger maintenance on a VM so I can test it?”
“Can I force a maintenance event on an instance on demand?”
Tell an agent
Perform a manual maintenance event on instance {instance} in {project}/{zone}.
Trigger maintenance on {project}/{zone}/{instance} now.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/stop Stop a running instance · Stop instances #
Ask an LLM
“How do I shut down a running VM so I can restart it later?”
“Can I stop an instance without deleting it?”
Tell an agent
Stop instance {instance} in {project}/{zone}.
Shut down {project}/{zone}/{instance} gracefully, discarding local SSDs set to {discardLocalSsd}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setScheduling Set an instance's scheduling options · Set scheduling instances #
Ask an LLM
“How do I make a VM restart automatically after a host maintenance event?”
“Can I set a VM to terminate at a specific time?”
Tell an agent
Set scheduling on instance {instance} in {project}/{zone} to automatic restart {automaticRestart}.
Schedule {project}/{zone}/{instance} to terminate at {terminationTime}.
GET /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/screenshot Get a screenshot of a VM's screen · Get screenshot instances #
Ask an LLM
“How do I capture a screenshot of a VM's console screen?”
“Can I take a picture of what's on a VM's display?”
Tell an agent
Get a screenshot of instance {instance} in {project}/{zone}.
Capture the console screen of {project}/{zone}/{instance}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setLabels Set labels on an instance · Set labels instances #
Ask an LLM
“How do I tag a VM with labels for cost tracking?”
“Can I change the label fingerprint when setting labels on an instance?”
Tell an agent
Set labels {labels} on instance {instance} in {project}/{zone}.
Apply label fingerprint {labelFingerprint} to {project}/{zone}/{instance} when setting labels.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addResourcePolicies Attach resource policies to an instance · Add resource policies instances #
Ask an LLM
“How do I attach an existing resource policy to an instance?”
“Can I add a live migration policy to a VM?”
Tell an agent
Add resource policies {resourcePolicies} to instance {instance} in {project}/{zone}.
Attach existing policy {resourcePolicies} to {project}/{zone}/{instance}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setName Rename an instance · Set name instances #
Ask an LLM
“How do I change the name of an instance?”
“Can I rename a VM that already exists?”
Tell an agent
Rename instance {instance} in {project}/{zone} to {name}.
Set the name of {project}/{zone}/{instance} to {name}, replacing the current name {currentName}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/detachDisk Detach a disk from an instance · Detach disk instances #
Ask an LLM
“How do I detach a persistent disk from a VM without deleting it?”
“Can I unmount a disk from a running instance?”
Tell an agent destructive · confirm first
Detach disk {deviceName} from instance {instance} in {project}/{zone}.
Unmount {deviceName} from {project}/{zone}/{instance}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete Set auto-delete on a VM's disk · Set disk auto delete instances #
Ask an LLM
“How do I make a VM's boot disk auto-delete when the instance is deleted?”
“Can I turn off auto-delete for a persistent disk?”
Tell an agent
Set auto-delete {autoDelete} on disk {deviceName} of instance {instance} in {project}/{zone}.
Make {deviceName} on {project}/{zone}/{instance} auto-delete when the instance is deleted: {autoDelete}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/suspend Suspend a running instance · Suspend instances #
Ask an LLM
“How do I suspend a VM so it saves its memory to disk and stops charging for CPU?”
“Can I pause a running instance and resume it later?”
Tell an agent
Suspend instance {instance} in {project}/{zone}.
Suspend {project}/{zone}/{instance} and discard local SSDs set to {discardLocalSsd}.
PATCH /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateDisplayDevice Turn the VM's display on or off · Update display device instances #
Ask an LLM
“How do I enable the display device on a VM so I can see its console?”
“Can I disable the display on a stopped instance?”
Tell an agent
Set the display device on instance {instance} in {project}/{zone} to enabled {enableDisplay}.
Turn the display on {project}/{zone}/{instance} by setting enableDisplay to {enableDisplay}.
POST /compute/v1/projects/{project}/zones/{zone}/instances Create a Compute Engine instance · Insert instances #
Ask an LLM
“How do I launch a new virtual machine in a Compute Engine zone?”
“Can I create an instance from a machine image or instance template?”
Tell an agent
Create an instance named {name} in zone {zone} of project {project} with machine type {machineType}.
Launch a new instance from machine image {sourceMachineImage} in {zone}, project {project}.
GET /compute/v1/projects/{project}/zones/{zone}/instances List instances in a zone · List instances #
Ask an LLM
“What VMs are running in a particular zone?”
“Can I list only the instances in one zone?”
Tell an agent
List instances in zone {zone} of project {project}.
Show instances in {project}/{zone} matching {filter}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMetadata Set instance metadata · Set metadata instances #
Ask an LLM
“How do I store custom metadata on a running instance?”
“Can I set instance metadata by key and value?”
Tell an agent
Set metadata {items} on instance {instance} in {zone}, project {project}.
Add custom metadata to the instance.
GET /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity Get an instance's Shielded VM identity · Get shielded instance identity instances #
Ask an LLM
“What attestation identity does a Shielded VM instance report?”
“Where can I read the integrity policy of a Shielded VM?”
Tell an agent
Get the Shielded VM identity of instance {instance} in {zone}, project {project}.
Show the attestation identity document for Shielded VM {instance}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy Attach a Cloud Armor security policy to an instance · Set security policy instances #
Ask an LLM
“How do I protect an instance with a Cloud Armor security policy?”
“Can I remove the security policy from an instance?”
Tell an agent
Set security policy {securityPolicy} on instance {instance} in {zone}, project {project}.
Remove the security policy from instance {instance}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig Update an instance's access config · Update access config instances #
Ask an LLM
“How do I change the external IP address on an instance's network interface?”
“Can I set a public PTR record on an instance's access config?”
Tell an agent
Update the access config on network interface {networkInterface} of instance {instance} in {zone}, project {project}.
Set the external IP of instance {instance} to {natIP}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey Start a stopped instance with a disk encryption key · Start with encryption key instances #
Ask an LLM
“How do I start a stopped instance that uses customer-supplied disk encryption keys?”
“What disk keys are needed to resume an encrypted instance?”
Tell an agent
Start instance {instance} in {zone}, project {project}, with disk encryption keys {disks}.
Resume the stopped instance using its customer-supplied encryption keys.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/resume Resume a suspended instance · Resume instances #
Ask an LLM
“How do I bring a suspended instance back online?”
“Can I resume an instance that was suspended with the suspend method?”
Tell an agent
Resume instance {instance} in {zone}, project {project}.
Bring the suspended instance back to running.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy Set an instance's access control policy · Set iam policy instances #
Ask an LLM
“How do I replace the IAM policy on an instance?”
“Can I set a new access policy on a Compute Engine instance?”
Tell an agent
Set the IAM policy {policy} on instance {resource} in {zone}, project {project}.
Replace the instance's access policy with a new one.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/sendDiagnosticInterrupt Send a diagnostic interrupt to an instance · Send diagnostic interrupt instances #
Ask an LLM
“How do I trigger a diagnostic interrupt on a running instance?”
“Can I send a diagnostic interrupt to an instance for debugging?”
Tell an agent
Send a diagnostic interrupt to instance {instance} in {zone}, project {project}.
Trigger a diagnostic interrupt on the instance.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setTags Set network tags on an instance · Set tags instances #
Ask an LLM
“How do I tag an instance for firewall filtering?”
“Can I change the network tags on an instance?”
Tell an agent
Set network tags {items} on instance {instance} in {zone}, project {project}.
Update the instance's network tags.
GET /compute/v1/projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy Get an instance's access control policy · Get iam policy instances #
Ask an LLM
“What IAM policy is attached to an instance?”
“Can I read the access policy on a Compute Engine instance?”
Tell an agent
Get the IAM policy on instance {resource} in {zone}, project {project}.
Show the access policy attached to the instance.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources Change an instance's accelerator resources · Set machine resources instances #
Ask an LLM
“How do I change the number or type of GPUs on a stopped instance?”
“Can I add accelerator cards to an instance after it is created?”
Tell an agent
Set guest accelerators {guestAccelerators} on instance {instance} in {zone}, project {project}.
Change the accelerator configuration of the stopped instance.
GET /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes Read an instance's guest attributes · Get guest attributes instances #
Ask an LLM
“How do I read a custom attribute set by the guest operating system?”
“Can I fetch a guest attribute by its key?”
Tell an agent
Get guest attribute {variableKey} at path {queryPath} on instance {instance} in {zone}, project {project}.
Read the guest attribute stored on the instance.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addNetworkInterface Add a dynamic network interface to an instance · Add network interface instances #
Ask an LLM
“How do I attach a network attachment to a running instance?”
“Can I add a VLAN-tagged network interface to an active instance?”
Tell an agent
Add a network interface to instance {instance} in {zone}, project {project}.
Attach network attachment {networkAttachment} to instance {instance}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/reportHostAsFaulty Report a host as faulty and restart the instance · Report host as faulty instances #
Ask an LLM
“How do I mark the host a running instance is on as faulty?”
“Can I force a faulty instance to restart on a new host?”
Tell an agent
Report host as faulty for instance {instance} in {zone}, project {project}.
Mark the host of instance {instance} as faulty and restart it.
PATCH /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy Set an instance's Shielded VM integrity policy · Set shielded instance integrity policy instances #
Ask an LLM
“How do I change the integrity policy baseline of a Shielded VM?”
“Can I update the Shielded VM integrity policy after the instance is running?”
Tell an agent
Set the Shielded VM integrity policy on instance {instance} in {zone}, project {project}.
Update the Shielded VM integrity policy baseline using {updateAutoLearnPolicy}.
POST /compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig Add an external IP to an instance interface · Add access config instances #
Ask an LLM
“How do I give a Compute Engine instance a public IP address on a network interface?”
“Can I choose the network tier when adding an access config?”
Tell an agent
Add an access config named {name} to instance {instance} in {project}/{zone} on interface {networkInterface}.
Attach a {type} access config to {instance} in {project}/{zone} on {networkInterface} with network tier {networkTier}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/google-cloud-compute-engine:google-cloud-compute-engine-instances-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

google-cloud-compute-engine-instances-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Compute Engine Instances API
  version: v1
  description: Generated from Google's published Discovery document for Compute Engine API (compute v1, revision 20261106). 51 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://compute.googleapis.com
tags:


# --- truncated at 32 KB (345 KB total) ---
# Full source: https://artifacts.apis.io/google-cloud-compute-engine/openapi/google-cloud-compute-engine-instances-api-openapi.yml