Google Cloud VPC API

The Google Cloud VPC API enables programmatic management of virtual networks, subnets, firewall rules, routes, and peering connections within Google Cloud Platform.

OpenAPI Specification

openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Cloud VPC API
  description: >-
    Provides programmatic access to manage virtual private cloud networks,
    subnets, firewall rules, routes, and peering connections within Google Cloud.
  version: v1
  contact:
    name: Google Cloud
    url: https://cloud.google.com/vpc/docs
servers:
  - url: https://compute.googleapis.com/compute/v1
    description: Google Cloud VPC production endpoint
tags:
  - name: Firewalls
    description: Manage firewall rules for VPC networks
  - name: Networks
    description: Manage VPC networks
  - name: Routes
    description: Manage routes for VPC networks
  - name: Subnetworks
    description: Manage subnetworks within VPC networks
paths:
  /projects/{project}/global/networks:
    get:
      operationId: listNetworks
      summary: Google Cloud VPC List VPC networks
      description: Retrieves the list of VPC networks available to the specified project.
      tags:
        - Networks
      parameters:
        - name: project
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NetworkList'
    post:
      operationId: createNetwork
      summary: Google Cloud VPC Create a VPC network
      description: Creates a VPC network in the specified project.
      tags:
        - Networks
      parameters:
        - name: project
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Network'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
  /projects/{project}/global/networks/{network}:
    get:
      operationId: getNetwork
      summary: Google Cloud VPC Get a VPC network
      description: Returns the specified VPC network resource.
      tags:
        - Networks
      parameters:
        - name: project
          in: path
          required: true
          schema:
            type: string
        - name: network
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Network'
    delete:
      operationId: deleteNetwork
      summary: Google Cloud VPC Delete a VPC network
      description: Deletes the specified VPC network.
      tags:
        - Networks
      parameters:
        - name: project
          in: path
          required: true
          schema:
            type: string
        - name: network
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
  /projects/{project}/regions/{region}/subnetworks:
    get:
      operationId: listSubnetworks
      summary: Google Cloud VPC List subnetworks
      description: Retrieves the list of subnetworks available in the specified region.
      tags:
        - Subnetworks
      parameters:
        - name: project
          in: path
          required: true
          schema:
            type: string
        - name: region
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubnetworkList'
  /projects/{project}/global/firewalls:
    get:
      operationId: listFirewalls
      summary: Google Cloud VPC List firewall rules
      description: Retrieves the list of firewall rules available to the specified project.
      tags:
        - Firewalls
      parameters:
        - name: project
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FirewallList'
  /projects/{project}/global/routes:
    get:
      operationId: listRoutes
      summary: Google Cloud VPC List routes
      description: Retrieves the list of routes available to the specified project.
      tags:
        - Routes
      parameters:
        - name: project
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteList'
components:
  schemas:
    Network:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the resource
        name:
          type: string
          description: Name of the VPC network
        description:
          type: string
          description: An optional description of the network
        autoCreateSubnetworks:
          type: boolean
          description: Whether subnets are created automatically
        routingConfig:
          type: object
          properties:
            routingMode:
              type: string
              enum:
                - REGIONAL
                - GLOBAL
        subnetworks:
          type: array
          items:
            type: string
          description: URLs of the subnetworks in this network
        selfLink:
          type: string
          description: Server-defined URL for the resource
    NetworkList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Network'
    SubnetworkList:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
    FirewallList:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
    RouteList:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
    Operation:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
        targetLink:
          type: string
  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: Manage your Google Compute Engine resources
            https://www.googleapis.com/auth/cloud-platform: Full access to Google Cloud Platform resources
security:
  - oauth2:
      - https://www.googleapis.com/auth/compute