# Copyright 2023 Google LLC. All Rights Reserved.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
info:
  title: Compute/Route
  description: The Compute Route resource
  x-dcl-struct-name: Route
  x-dcl-has-iam: false
paths:
  get:
    description: The function used to get information about a Route
    parameters:
    - name: route
      required: true
      description: A full instance of a Route
  apply:
    description: The function used to apply information about a Route
    parameters:
    - name: route
      required: true
      description: A full instance of a Route
  delete:
    description: The function used to delete a Route
    parameters:
    - name: route
      required: true
      description: A full instance of a Route
  deleteAll:
    description: The function used to delete all Route
    parameters:
    - name: project
      required: true
      schema:
        type: string
  list:
    description: The function used to list information about many Route
    parameters:
    - name: project
      required: true
      schema:
        type: string
components:
  schemas:
    Route:
      title: Route
      x-dcl-id: projects/{{project}}/global/routes/{{name}}
      x-dcl-locations:
      - global
      x-dcl-parent-container: project
      x-dcl-has-create: true
      x-dcl-has-iam: false
      x-dcl-read-timeout: 0
      x-dcl-apply-timeout: 0
      x-dcl-delete-timeout: 0
      type: object
      required:
      - name
      - network
      - destRange
      - project
      properties:
        description:
          type: string
          x-dcl-go-name: Description
          description: |-
            An optional description of this resource. Provide this field when you
            create the resource.
          x-kubernetes-immutable: true
        destRange:
          type: string
          x-dcl-go-name: DestRange
          description: The destination range of the route.
          x-kubernetes-immutable: true
        id:
          type: integer
          format: int64
          x-dcl-go-name: Id
          readOnly: true
          description: |-
            [Output Only] The unique identifier for the resource. This identifier is
            defined by the server.
          x-kubernetes-immutable: true
        name:
          type: string
          x-dcl-go-name: Name
          description: |-
            Name of the resource. Provided by the client when the resource is created.
            The name must be 1-63 characters long, and comply with
            <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
            Specifically, the name must be 1-63 characters long and match the regular
            expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a
            lowercase letter, and all following characters (except for the last
            character) must be a dash, lowercase letter, or digit. The last character
            must be a lowercase letter or digit.
          x-kubernetes-immutable: true
        network:
          type: string
          x-dcl-go-name: Network
          description: Fully-qualified URL of the network that this route applies
            to.
          x-kubernetes-immutable: true
        nextHopGateway:
          type: string
          x-dcl-go-name: NextHopGateway
          description: |-
            The URL to a gateway that should handle matching packets.
            You can only specify the internet gateway using a full or
            partial valid URL: </br>
            <code>projects/<var
            class="apiparam">project</var>/global/gateways/default-internet-gateway</code>
          x-kubernetes-immutable: true
          x-dcl-conflicts:
          - nextHopVpnTunnel
          - nextHopIP
          - nextHopInstance
          - nextHopIlb
        nextHopIP:
          type: string
          x-dcl-go-name: NextHopIP
          description: |-
            The network IP address of an instance that should handle matching packets.
            Only IPv4 is supported.
          x-kubernetes-immutable: true
          x-dcl-conflicts:
          - nextHopVpnTunnel
          - nextHopInstance
          - nextHopGateway
          - nextHopIlb
          x-dcl-server-default: true
        nextHopIlb:
          type: string
          x-dcl-go-name: NextHopIlb
          description: |-
            The URL to a forwarding rule of type
            <code>loadBalancingScheme=INTERNAL</code> that should handle matching
            packets. You can only specify the forwarding rule as a partial or full
            URL. For example, the following are all valid URLs:
            <ul>
               <li><code>https://www.googleapis.com/compute/v1/projects/<var
               class="apiparam">project</var>/regions/<var
               class="apiparam">region</var>/forwardingRules/<var
               class="apiparam">forwardingRule</var></code></li> <li><code>regions/<var
               class="apiparam">region</var>/forwardingRules/<var
               class="apiparam">forwardingRule</var></code></li>
            </ul>
          x-kubernetes-immutable: true
          x-dcl-conflicts:
          - nextHopVpnTunnel
          - nextHopIP
          - nextHopInstance
          - nextHopGateway
        nextHopInstance:
          type: string
          x-dcl-go-name: NextHopInstance
          description: |-
            The URL to an instance that should handle matching packets. You can specify
            this as a full or partial URL.
            For example: <br />
            <code>https://www.googleapis.com/compute/v1/projects/<var
            class="apiparam">project</var>/zones/<var
            class="apiparam">zone</var>/instances/<instance-name></code>
          x-kubernetes-immutable: true
          x-dcl-conflicts:
          - nextHopVpnTunnel
          - nextHopIP
          - nextHopGateway
          - nextHopIlb
        nextHopNetwork:
          type: string
          x-dcl-go-name: NextHopNetwork
          readOnly: true
          description: The URL of the local network if it should handle matching packets.
          x-kubernetes-immutable: true
        nextHopPeering:
          type: string
          x-dcl-go-name: NextHopPeering
          readOnly: true
          description: |-
            [Output Only] The network peering name that should handle matching packets,
            which should conform to RFC1035.
          x-kubernetes-immutable: true
        nextHopVpnTunnel:
          type: string
          x-dcl-go-name: NextHopVpnTunnel
          description: The URL to a VpnTunnel that should handle matching packets.
          x-kubernetes-immutable: true
          x-dcl-conflicts:
          - nextHopIP
          - nextHopInstance
          - nextHopGateway
          - nextHopIlb
        priority:
          type: integer
          format: int64
          x-dcl-go-name: Priority
          description: The priority of the peering route.
          x-kubernetes-immutable: true
          default: 1000
        project:
          type: string
          x-dcl-go-name: Project
          description: The project for the resource
          x-kubernetes-immutable: true
          x-dcl-references:
          - resource: Cloudresourcemanager/Project
            field: name
            parent: true
        selfLink:
          type: string
          x-dcl-go-name: SelfLink
          readOnly: true
          description: '[Output Only] Server-defined fully-qualified URL for this
            resource.'
          x-kubernetes-immutable: true
        tag:
          type: array
          x-dcl-go-name: Tag
          description: A list of instance tags to which this route applies.
          x-kubernetes-immutable: true
          x-dcl-send-empty: true
          x-dcl-list-type: list
          items:
            type: string
            x-dcl-go-type: string
        warning:
          type: array
          x-dcl-go-name: Warning
          readOnly: true
          description: |-
            [Output Only] If potential misconfigurations are detected for this
            route, this field will be populated with warning messages.
          x-kubernetes-immutable: true
          x-dcl-list-type: list
          items:
            type: object
            x-dcl-go-type: RouteWarning
            properties:
              code:
                type: string
                x-dcl-go-name: Code
                x-dcl-go-type: RouteWarningCodeEnum
                readOnly: true
                description: |-
                  [Output Only] A warning code, if applicable. For example, Compute
                  Engine returns <code>NO_RESULTS_ON_PAGE</code> if there
                  are no results in the response. Possible values: BAD_REQUEST, FORBIDDEN, NOT_FOUND, CONFLICT, GONE, PRECONDITION_FAILED, INTERNAL_ERROR, SERVICE_UNAVAILABLE
                x-kubernetes-immutable: true
                enum:
                - BAD_REQUEST
                - FORBIDDEN
                - NOT_FOUND
                - CONFLICT
                - GONE
                - PRECONDITION_FAILED
                - INTERNAL_ERROR
                - SERVICE_UNAVAILABLE
              data:
                type: object
                additionalProperties:
                  type: string
                x-dcl-go-name: Data
                readOnly: true
                description: |-
                  [Output Only] Metadata about this warning in <code class="lang-html">key:
                  value</code> format. For example:
                  <pre class="lang-html prettyprint">"data": [
                   : {
                     "key": "scope",
                     "value": "zones/us-east1-d"
                    }</pre>
                x-kubernetes-immutable: true
              message:
                type: string
                x-dcl-go-name: Message
                readOnly: true
                description: '[Output Only] A human-readable description of the warning
                  code.'
                x-kubernetes-immutable: true
