# 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/Snapshot
  description: The Compute Snapshot resource
  x-dcl-struct-name: Snapshot
  x-dcl-has-iam: false
paths:
  get:
    description: The function used to get information about a Snapshot
    parameters:
    - name: snapshot
      required: true
      description: A full instance of a Snapshot
  apply:
    description: The function used to apply information about a Snapshot
    parameters:
    - name: snapshot
      required: true
      description: A full instance of a Snapshot
  delete:
    description: The function used to delete a Snapshot
    parameters:
    - name: snapshot
      required: true
      description: A full instance of a Snapshot
  deleteAll:
    description: The function used to delete all Snapshot
    parameters:
    - name: project
      required: true
      schema:
        type: string
  list:
    description: The function used to list information about many Snapshot
    parameters:
    - name: project
      required: true
      schema:
        type: string
components:
  schemas:
    Snapshot:
      title: Snapshot
      x-dcl-id: projects/{{project}}/global/snapshots/{{name}}
      x-dcl-locations:
      - global
      x-dcl-uses-state-hint: true
      x-dcl-parent-container: project
      x-dcl-labels: labels
      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
      - sourceDisk
      - project
      properties:
        description:
          type: string
          x-dcl-go-name: Description
          description: An optional description of this resource. Provide this property
            when you create the resource.
          x-kubernetes-immutable: true
        diskSizeGb:
          type: integer
          format: int64
          x-dcl-go-name: DiskSizeGb
          readOnly: true
          description: Size of the source disk, specified in GB.
          x-kubernetes-immutable: true
        id:
          type: integer
          format: int64
          x-dcl-go-name: Id
          readOnly: true
          description: The unique identifier for the resource. This identifier is
            defined by the server.
          x-kubernetes-immutable: true
        labels:
          type: object
          additionalProperties:
            type: string
          x-dcl-go-name: Labels
          description: Labels to apply to this snapshot. Label values may be empty.
        license:
          type: array
          x-dcl-go-name: License
          readOnly: true
          description: A list of public visible licenses that apply to this snapshot.
            This can be because the original image had licenses attached (such as
            a Windows image).
          x-kubernetes-immutable: true
          x-dcl-list-type: list
          items:
            type: string
            x-dcl-go-type: string
        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 [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
            Specifically, the name must be 1-63 characters long and match the regular
            expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character
            must be a lowercase letter, and all following characters must be a dash,
            lowercase letter, or digit, except the last character, which cannot be
            a dash.
          x-kubernetes-immutable: true
        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: Server-defined URL for the resource.
          x-kubernetes-immutable: true
        snapshotEncryptionKey:
          type: object
          x-dcl-go-name: SnapshotEncryptionKey
          x-dcl-go-type: SnapshotSnapshotEncryptionKey
          description: Encrypts the snapshot using a customer-supplied encryption
            key.  After you encrypt a snapshot using a customer-supplied key, you
            must provide the same key if you use the snapshot later. For example,
            you must provide the encryption key when you create a disk from the encrypted
            snapshot in a future request.  Customer-supplied encryption keys do not
            protect access to metadata of the snapshot.  If you do not provide an
            encryption key when creating the snapshot, then the snapshot will be encrypted
            using an automatically generated key and you do not need to provide a
            key to use the snapshot later.
          x-kubernetes-immutable: true
          x-dcl-mutable-unreadable: true
          required:
          - rawKey
          properties:
            rawKey:
              type: string
              x-dcl-go-name: RawKey
              description: Specifies a 256-bit customer-supplied encryption key, encoded
                in [RFC 4648 base64](https://tools.ietf.org/html/rfc4648#section-4)
                to either encrypt or decrypt this resource.
              x-kubernetes-immutable: true
              x-dcl-mutable-unreadable: true
            sha256:
              type: string
              x-dcl-go-name: Sha256
              readOnly: true
              description: The [RFC 4648 base64](https://tools.ietf.org/html/rfc4648#section-4)
                encoded SHA-256 hash of the customer-supplied encryption key that
                protects this resource.
              x-kubernetes-immutable: true
        sourceDisk:
          type: string
          x-dcl-go-name: SourceDisk
          description: The source disk used to create this snapshot, in the format
            `projects/{project}/zones/{zones}/disks/{name}`
          x-kubernetes-immutable: true
          x-dcl-references:
          - resource: Compute/Disk
            field: selfLink
        sourceDiskEncryptionKey:
          type: object
          x-dcl-go-name: SourceDiskEncryptionKey
          x-dcl-go-type: SnapshotSourceDiskEncryptionKey
          description: The customer-supplied encryption key of the source disk. Required
            if the source disk is protected by a customer-supplied encryption key.
          x-kubernetes-immutable: true
          x-dcl-mutable-unreadable: true
          properties:
            rawKey:
              type: string
              x-dcl-go-name: RawKey
              description: Specifies a 256-bit customer-supplied encryption key, encoded
                in [RFC 4648 base64](https://tools.ietf.org/html/rfc4648#section-4)
                to either encrypt or decrypt this resource.
              x-kubernetes-immutable: true
        storageBytes:
          type: integer
          format: int64
          x-dcl-go-name: StorageBytes
          readOnly: true
          description: A size of the storage used by the snapshot. As snapshots share
            storage, this number is expected to change with snapshot creation/deletion.
          x-kubernetes-immutable: true
