Class: Google::Apis::ComputeV1::Snapshot

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/compute_v1/classes.rb,
generated/google/apis/compute_v1/representations.rb,
generated/google/apis/compute_v1/representations.rb

Overview

Represents a Persistent Disk Snapshot resource. You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots. (== resource_for $ api_version.snapshots ==)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Snapshot

Returns a new instance of Snapshot.



27716
27717
27718
# File 'generated/google/apis/compute_v1/classes.rb', line 27716

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#auto_createdBoolean Also known as: auto_created?

[Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk. Corresponds to the JSON property autoCreated

Returns:

  • (Boolean)


27566
27567
27568
# File 'generated/google/apis/compute_v1/classes.rb', line 27566

def auto_created
  @auto_created
end

#chain_nameString

Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non- empty value. Corresponds to the JSON property chainName

Returns:

  • (String)


27577
27578
27579
# File 'generated/google/apis/compute_v1/classes.rb', line 27577

def chain_name
  @chain_name
end

#creation_timestampString

[Output Only] Creation timestamp in RFC3339 text format. Corresponds to the JSON property creationTimestamp

Returns:

  • (String)


27582
27583
27584
# File 'generated/google/apis/compute_v1/classes.rb', line 27582

def creation_timestamp
  @creation_timestamp
end

#descriptionString

An optional description of this resource. Provide this property when you create the resource. Corresponds to the JSON property description

Returns:

  • (String)


27588
27589
27590
# File 'generated/google/apis/compute_v1/classes.rb', line 27588

def description
  @description
end

#disk_size_gbFixnum

[Output Only] Size of the source disk, specified in GB. Corresponds to the JSON property diskSizeGb

Returns:

  • (Fixnum)


27593
27594
27595
# File 'generated/google/apis/compute_v1/classes.rb', line 27593

def disk_size_gb
  @disk_size_gb
end

#download_bytesFixnum

[Output Only] Number of bytes downloaded to restore a snapshot to a disk. Corresponds to the JSON property downloadBytes

Returns:

  • (Fixnum)


27598
27599
27600
# File 'generated/google/apis/compute_v1/classes.rb', line 27598

def download_bytes
  @download_bytes
end

#idFixnum

[Output Only] The unique identifier for the resource. This identifier is defined by the server. Corresponds to the JSON property id

Returns:

  • (Fixnum)


27604
27605
27606
# File 'generated/google/apis/compute_v1/classes.rb', line 27604

def id
  @id
end

#kindString

[Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. Corresponds to the JSON property kind

Returns:

  • (String)


27610
27611
27612
# File 'generated/google/apis/compute_v1/classes.rb', line 27610

def kind
  @kind
end

#label_fingerprintString

A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a snapshot. Corresponds to the JSON property labelFingerprint NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


27622
27623
27624
# File 'generated/google/apis/compute_v1/classes.rb', line 27622

def label_fingerprint
  @label_fingerprint
end

#labelsHash<String,String>

Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


27628
27629
27630
# File 'generated/google/apis/compute_v1/classes.rb', line 27628

def labels
  @labels
end

#license_codesArray<Fixnum>

[Output Only] Integer license codes indicating which licenses are attached to this snapshot. Corresponds to the JSON property licenseCodes

Returns:

  • (Array<Fixnum>)


27634
27635
27636
# File 'generated/google/apis/compute_v1/classes.rb', line 27634

def license_codes
  @license_codes
end

#licensesArray<String>

[Output Only] 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). Corresponds to the JSON property licenses

Returns:

  • (Array<String>)


27641
27642
27643
# File 'generated/google/apis/compute_v1/classes.rb', line 27641

def licenses
  @licenses
end

#nameString

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. 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. Corresponds to the JSON property name

Returns:

  • (String)


27651
27652
27653
# File 'generated/google/apis/compute_v1/classes.rb', line 27651

def name
  @name
end

[Output Only] Server-defined URL for the resource. Corresponds to the JSON property selfLink

Returns:

  • (String)


27656
27657
27658
# File 'generated/google/apis/compute_v1/classes.rb', line 27656

def self_link
  @self_link
end

#snapshot_encryption_keyGoogle::Apis::ComputeV1::CustomerEncryptionKey

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. Corresponds to the JSON property snapshotEncryptionKey



27670
27671
27672
# File 'generated/google/apis/compute_v1/classes.rb', line 27670

def snapshot_encryption_key
  @snapshot_encryption_key
end

#source_diskString

The source disk used to create this snapshot. Corresponds to the JSON property sourceDisk

Returns:

  • (String)


27675
27676
27677
# File 'generated/google/apis/compute_v1/classes.rb', line 27675

def source_disk
  @source_disk
end

#source_disk_encryption_keyGoogle::Apis::ComputeV1::CustomerEncryptionKey

The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. Corresponds to the JSON property sourceDiskEncryptionKey



27681
27682
27683
# File 'generated/google/apis/compute_v1/classes.rb', line 27681

def source_disk_encryption_key
  @source_disk_encryption_key
end

#source_disk_idString

[Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name. Corresponds to the JSON property sourceDiskId

Returns:

  • (String)


27688
27689
27690
# File 'generated/google/apis/compute_v1/classes.rb', line 27688

def source_disk_id
  @source_disk_id
end

#statusString

[Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. Corresponds to the JSON property status

Returns:

  • (String)


27694
27695
27696
# File 'generated/google/apis/compute_v1/classes.rb', line 27694

def status
  @status
end

#storage_bytesFixnum

[Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion. Corresponds to the JSON property storageBytes

Returns:

  • (Fixnum)


27700
27701
27702
# File 'generated/google/apis/compute_v1/classes.rb', line 27700

def storage_bytes
  @storage_bytes
end

#storage_bytes_statusString

[Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. Corresponds to the JSON property storageBytesStatus

Returns:

  • (String)


27708
27709
27710
# File 'generated/google/apis/compute_v1/classes.rb', line 27708

def storage_bytes_status
  @storage_bytes_status
end

#storage_locationsArray<String>

Cloud Storage bucket storage location of the snapshot (regional or multi- regional). Corresponds to the JSON property storageLocations

Returns:

  • (Array<String>)


27714
27715
27716
# File 'generated/google/apis/compute_v1/classes.rb', line 27714

def storage_locations
  @storage_locations
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



27721
27722
27723
27724
27725
27726
27727
27728
27729
27730
27731
27732
27733
27734
27735
27736
27737
27738
27739
27740
27741
27742
27743
27744
# File 'generated/google/apis/compute_v1/classes.rb', line 27721

def update!(**args)
  @auto_created = args[:auto_created] if args.key?(:auto_created)
  @chain_name = args[:chain_name] if args.key?(:chain_name)
  @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)
  @description = args[:description] if args.key?(:description)
  @disk_size_gb = args[:disk_size_gb] if args.key?(:disk_size_gb)
  @download_bytes = args[:download_bytes] if args.key?(:download_bytes)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @label_fingerprint = args[:label_fingerprint] if args.key?(:label_fingerprint)
  @labels = args[:labels] if args.key?(:labels)
  @license_codes = args[:license_codes] if args.key?(:license_codes)
  @licenses = args[:licenses] if args.key?(:licenses)
  @name = args[:name] if args.key?(:name)
  @self_link = args[:self_link] if args.key?(:self_link)
  @snapshot_encryption_key = args[:snapshot_encryption_key] if args.key?(:snapshot_encryption_key)
  @source_disk = args[:source_disk] if args.key?(:source_disk)
  @source_disk_encryption_key = args[:source_disk_encryption_key] if args.key?(:source_disk_encryption_key)
  @source_disk_id = args[:source_disk_id] if args.key?(:source_disk_id)
  @status = args[:status] if args.key?(:status)
  @storage_bytes = args[:storage_bytes] if args.key?(:storage_bytes)
  @storage_bytes_status = args[:storage_bytes_status] if args.key?(:storage_bytes_status)
  @storage_locations = args[:storage_locations] if args.key?(:storage_locations)
end