Google Cloud Platform APIs Firewalls API

Firewall rules

Documentation

Specifications

Other Resources

OpenAPI Specification

gcp-firewalls-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Cloud Compute Engine Disks Firewalls API
  description: 'REST API for managing virtual machines, disks, networking, load balancing,

    and related Compute Engine resources on Google Cloud Platform. This spec

    covers a representative subset of v1 resources. Full canonical machine

    spec is the Google Discovery Document at

    https://compute.googleapis.com/$discovery/rest?version=v1.

    '
  version: v1
  contact:
    name: Google Cloud Compute Engine Documentation
    url: https://cloud.google.com/compute/docs/reference/rest/v1
servers:
- url: https://compute.googleapis.com/compute/v1
  description: Production
security:
- oauth2:
  - https://www.googleapis.com/auth/compute
  - https://www.googleapis.com/auth/cloud-platform
- bearerAuth: []
tags:
- name: Firewalls
  description: Firewall rules
paths:
  /projects/{project}/global/firewalls:
    parameters:
    - $ref: '#/components/parameters/Project'
    get:
      tags:
      - Firewalls
      summary: List firewalls
      operationId: listFirewalls
      responses:
        '200':
          description: Firewall list
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Firewall'
    post:
      tags:
      - Firewalls
      summary: Create a firewall
      operationId: insertFirewall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Firewall'
      responses:
        '200':
          description: Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
components:
  schemas:
    Firewall:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        network:
          type: string
        direction:
          type: string
          enum:
          - INGRESS
          - EGRESS
        priority:
          type: integer
        sourceRanges:
          type: array
          items:
            type: string
        allowed:
          type: array
          items:
            type: object
            properties:
              IPProtocol:
                type: string
              ports:
                type: array
                items:
                  type: string
    Operation:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        operationType:
          type: string
        targetLink:
          type: string
        status:
          type: string
          enum:
          - PENDING
          - RUNNING
          - DONE
        progress:
          type: integer
        startTime:
          type: string
          format: date-time
        endTime:
          type: string
          format: date-time
        error:
          type: object
  parameters:
    Project:
      name: project
      in: path
      required: true
      description: Project ID
      schema:
        type: string
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/v2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/compute: Manage Compute Engine resources
            https://www.googleapis.com/auth/cloud-platform: View and manage all Google Cloud resources
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT