Google Cloud Compute Engine Instances API

Manage virtual machine instances

OpenAPI Specification

google-cloud-compute-engine-instances-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Cloud Compute Engine Google Compute Engine Disks Instances API
  description: Creates and runs virtual machines on Google Cloud infrastructure, with support for managing disks, networks, and firewall rules.
  version: 1.0.0
  contact:
    name: Google Cloud
    url: https://cloud.google.com/compute
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://compute.googleapis.com/compute/v1
  description: Google Compute Engine API v1
security:
- oauth2:
  - https://www.googleapis.com/auth/compute
tags:
- name: Instances
  description: Manage virtual machine instances
paths:
  /projects/{project}/zones/{zone}/instances:
    get:
      operationId: listInstances
      summary: Google Cloud Compute Engine List Instances
      description: Retrieves the list of instances contained within the specified zone.
      tags:
      - Instances
      parameters:
      - name: project
        in: path
        required: true
        schema:
          type: string
      - name: zone
        in: path
        required: true
        schema:
          type: string
      - name: maxResults
        in: query
        schema:
          type: integer
      - name: pageToken
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Instance'
                  nextPageToken:
                    type: string
    post:
      operationId: insertInstance
      summary: Google Cloud Compute Engine Create Instance
      description: Creates an instance resource in the specified project using the data included in the request.
      tags:
      - Instances
      parameters:
      - name: project
        in: path
        required: true
        schema:
          type: string
      - name: zone
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Instance'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
  /projects/{project}/zones/{zone}/instances/{instance}:
    get:
      operationId: getInstance
      summary: Google Cloud Compute Engine Get Instance
      description: Returns the specified Instance resource.
      tags:
      - Instances
      parameters:
      - name: project
        in: path
        required: true
        schema:
          type: string
      - name: zone
        in: path
        required: true
        schema:
          type: string
      - name: instance
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Instance'
    delete:
      operationId: deleteInstance
      summary: Google Cloud Compute Engine Delete Instance
      description: Deletes the specified Instance resource.
      tags:
      - Instances
      parameters:
      - name: project
        in: path
        required: true
        schema:
          type: string
      - name: zone
        in: path
        required: true
        schema:
          type: string
      - name: instance
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
components:
  schemas:
    Instance:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        zone:
          type: string
        machineType:
          type: string
        status:
          type: string
          enum:
          - PROVISIONING
          - STAGING
          - RUNNING
          - STOPPING
          - STOPPED
          - SUSPENDING
          - SUSPENDED
          - TERMINATED
        networkInterfaces:
          type: array
          items:
            type: object
            properties:
              network:
                type: string
              subnetwork:
                type: string
              networkIP:
                type: string
        disks:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              boot:
                type: boolean
              autoDelete:
                type: boolean
        selfLink:
          type: string
        creationTimestamp:
          type: string
          format: date-time
    Operation:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        operationType:
          type: string
        status:
          type: string
        targetLink:
          type: string
        progress:
          type: integer
        insertTime:
          type: string
          format: date-time
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/compute: Full access to Compute Engine
            https://www.googleapis.com/auth/cloud-platform: Full access to Google Cloud Platform