Class: Google::Apis::ComputeAlpha::Image

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

Overview

Represents an Image resource. You can use images to create boot disks for your VM instances. For more information, read Images.

Defined Under Namespace

Classes: RawDisk

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Image

Returns a new instance of Image.



14145
14146
14147
# File 'lib/google/apis/compute_alpha/classes.rb', line 14145

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

Instance Attribute Details

#architectureString

The architecture of the image. Valid values are ARM64 or X86_64. Corresponds to the JSON property architecture

Returns:

  • (String)


13894
13895
13896
# File 'lib/google/apis/compute_alpha/classes.rb', line 13894

def architecture
  @architecture
end

#archive_size_bytesFixnum

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). Corresponds to the JSON property archiveSizeBytes

Returns:

  • (Fixnum)


13899
13900
13901
# File 'lib/google/apis/compute_alpha/classes.rb', line 13899

def archive_size_bytes
  @archive_size_bytes
end

#creation_timestampString

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

Returns:

  • (String)


13904
13905
13906
# File 'lib/google/apis/compute_alpha/classes.rb', line 13904

def creation_timestamp
  @creation_timestamp
end

#deprecatedGoogle::Apis::ComputeAlpha::DeprecationStatus

Deprecation status for a public resource. Corresponds to the JSON property deprecated



13909
13910
13911
# File 'lib/google/apis/compute_alpha/classes.rb', line 13909

def deprecated
  @deprecated
end

#descriptionString

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

Returns:

  • (String)


13915
13916
13917
# File 'lib/google/apis/compute_alpha/classes.rb', line 13915

def description
  @description
end

#disk_size_gbFixnum

Size of the image when restored onto a persistent disk (in GB). Corresponds to the JSON property diskSizeGb

Returns:

  • (Fixnum)


13920
13921
13922
# File 'lib/google/apis/compute_alpha/classes.rb', line 13920

def disk_size_gb
  @disk_size_gb
end

#familyString

The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. Corresponds to the JSON property family

Returns:

  • (String)


13928
13929
13930
# File 'lib/google/apis/compute_alpha/classes.rb', line 13928

def family
  @family
end

#guest_os_featuresArray<Google::Apis::ComputeAlpha::GuestOsFeature>

A list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available options, see the guestOSfeatures[].type parameter. Corresponds to the JSON property guestOsFeatures



13935
13936
13937
# File 'lib/google/apis/compute_alpha/classes.rb', line 13935

def guest_os_features
  @guest_os_features
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)


13941
13942
13943
# File 'lib/google/apis/compute_alpha/classes.rb', line 13941

def id
  @id
end

#image_encryption_keyGoogle::Apis::ComputeAlpha::CustomerEncryptionKey

Encrypts the image using a customer-supplied encryption key. After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later. Corresponds to the JSON property imageEncryptionKey



13952
13953
13954
# File 'lib/google/apis/compute_alpha/classes.rb', line 13952

def image_encryption_key
  @image_encryption_key
end

#kindString

[Output Only] Type of the resource. Always compute#image for images. Corresponds to the JSON property kind

Returns:

  • (String)


13957
13958
13959
# File 'lib/google/apis/compute_alpha/classes.rb', line 13957

def kind
  @kind
end

#label_fingerprintString

A fingerprint for the labels being applied to this image, which is essentially a hash of the labels 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 an image. Corresponds to the JSON property labelFingerprint NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


13969
13970
13971
# File 'lib/google/apis/compute_alpha/classes.rb', line 13969

def label_fingerprint
  @label_fingerprint
end

#labelsHash<String,String>

Labels to apply to this image. These can be later modified by the setLabels method. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


13975
13976
13977
# File 'lib/google/apis/compute_alpha/classes.rb', line 13975

def labels
  @labels
end

#license_codesArray<Fixnum>

Integer license codes indicating which licenses are attached to this image. Corresponds to the JSON property licenseCodes

Returns:

  • (Array<Fixnum>)


13980
13981
13982
# File 'lib/google/apis/compute_alpha/classes.rb', line 13980

def license_codes
  @license_codes
end

#licensesArray<String>

Any applicable license URI. Corresponds to the JSON property licenses

Returns:

  • (Array<String>)


13985
13986
13987
# File 'lib/google/apis/compute_alpha/classes.rb', line 13985

def licenses
  @licenses
end

#lockedBoolean Also known as: locked?

A flag for marketplace VM disk created from the image, which is designed for marketplace VM disk to prevent the proprietary data on the disk from being accessed unwantedly. The flag will be inherited by the disk created from the image. The disk with locked flag set to true will be prohibited from performing the operations below: - R/W or R/O disk attach - Disk detach, if disk is created via create-on-create - Create images - Create snapshots - Create disk clone (create disk from the current disk) The image with the locked field set to true will be prohibited from performing the operations below: - Create images from the current image - Update the locked field for the current image The instance with at least one disk with locked flag set to true will be prohibited from performing the operations below: - Secondary disk attach - Create instant snapshot - Create machine images - Create instance template - Delete the instance with --keep-disk parameter set to true Corresponds to the JSON property locked

Returns:

  • (Boolean)


14002
14003
14004
# File 'lib/google/apis/compute_alpha/classes.rb', line 14002

def locked
  @locked
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)


14013
14014
14015
# File 'lib/google/apis/compute_alpha/classes.rb', line 14013

def name
  @name
end

#raw_diskGoogle::Apis::ComputeAlpha::Image::RawDisk

The parameters of the raw disk image. Corresponds to the JSON property rawDisk



14018
14019
14020
# File 'lib/google/apis/compute_alpha/classes.rb', line 14018

def raw_disk
  @raw_disk
end

#rollout_overrideGoogle::Apis::ComputeAlpha::RolloutPolicy

A rollout policy configuration. Corresponds to the JSON property rolloutOverride



14023
14024
14025
# File 'lib/google/apis/compute_alpha/classes.rb', line 14023

def rollout_override
  @rollout_override
end

#satisfies_pzsBoolean Also known as: satisfies_pzs?

[Output Only] Reserved for future use. Corresponds to the JSON property satisfiesPzs

Returns:

  • (Boolean)


14028
14029
14030
# File 'lib/google/apis/compute_alpha/classes.rb', line 14028

def satisfies_pzs
  @satisfies_pzs
end

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

Returns:

  • (String)


14034
14035
14036
# File 'lib/google/apis/compute_alpha/classes.rb', line 14034

def self_link
  @self_link
end

[Output Only] Server-defined URL for this resource's resource id. Corresponds to the JSON property selfLinkWithId

Returns:

  • (String)


14039
14040
14041
# File 'lib/google/apis/compute_alpha/classes.rb', line 14039

def self_link_with_id
  @self_link_with_id
end

#shielded_instance_initial_stateGoogle::Apis::ComputeAlpha::InitialStateConfig

Initial State for shielded instance, these are public keys which are safe to store in public Corresponds to the JSON property shieldedInstanceInitialState



14045
14046
14047
# File 'lib/google/apis/compute_alpha/classes.rb', line 14045

def shielded_instance_initial_state
  @shielded_instance_initial_state
end

#source_diskString

URL of the source disk used to create this image. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/ zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/ disks/disk In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL Corresponds to the JSON property sourceDisk

Returns:

  • (String)


14055
14056
14057
# File 'lib/google/apis/compute_alpha/classes.rb', line 14055

def source_disk
  @source_disk
end

#source_disk_encryption_keyGoogle::Apis::ComputeAlpha::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



14061
14062
14063
# File 'lib/google/apis/compute_alpha/classes.rb', line 14061

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 image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name. Corresponds to the JSON property sourceDiskId

Returns:

  • (String)


14068
14069
14070
# File 'lib/google/apis/compute_alpha/classes.rb', line 14068

def source_disk_id
  @source_disk_id
end

#source_imageString

URL of the source image used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/ project_id/global/ images/image_name - projects/project_id/global/images/ image_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL Corresponds to the JSON property sourceImage

Returns:

  • (String)


14078
14079
14080
# File 'lib/google/apis/compute_alpha/classes.rb', line 14078

def source_image
  @source_image
end

#source_image_encryption_keyGoogle::Apis::ComputeAlpha::CustomerEncryptionKey

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



14084
14085
14086
# File 'lib/google/apis/compute_alpha/classes.rb', line 14084

def source_image_encryption_key
  @source_image_encryption_key
end

#source_image_idString

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

Returns:

  • (String)


14091
14092
14093
# File 'lib/google/apis/compute_alpha/classes.rb', line 14091

def source_image_id
  @source_image_id
end

#source_snapshotString

URL of the source snapshot used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/ project_id/global/ snapshots/snapshot_name - projects/project_id/global/ snapshots/snapshot_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL Corresponds to the JSON property sourceSnapshot

Returns:

  • (String)


14101
14102
14103
# File 'lib/google/apis/compute_alpha/classes.rb', line 14101

def source_snapshot
  @source_snapshot
end

#source_snapshot_encryption_keyGoogle::Apis::ComputeAlpha::CustomerEncryptionKey

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



14107
14108
14109
# File 'lib/google/apis/compute_alpha/classes.rb', line 14107

def source_snapshot_encryption_key
  @source_snapshot_encryption_key
end

#source_snapshot_idString

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

Returns:

  • (String)


14114
14115
14116
# File 'lib/google/apis/compute_alpha/classes.rb', line 14114

def source_snapshot_id
  @source_snapshot_id
end

#source_typeString

The type of the image used to create this disk. The default and only valid value is RAW. Corresponds to the JSON property sourceType

Returns:

  • (String)


14120
14121
14122
# File 'lib/google/apis/compute_alpha/classes.rb', line 14120

def source_type
  @source_type
end

#statusString

[Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY. Corresponds to the JSON property status

Returns:

  • (String)


14128
14129
14130
# File 'lib/google/apis/compute_alpha/classes.rb', line 14128

def status
  @status
end

#storage_locationsArray<String>

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

Returns:

  • (Array<String>)


14134
14135
14136
# File 'lib/google/apis/compute_alpha/classes.rb', line 14134

def storage_locations
  @storage_locations
end

#user_licensesArray<String>

A list of publicly visible user-licenses. Unlike regular licenses, user provided licenses can be modified after the disk is created. This includes a list of URLs to the license resource. For example, to provide a debian license: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/ debian-9-stretch Corresponds to the JSON property userLicenses

Returns:

  • (Array<String>)


14143
14144
14145
# File 'lib/google/apis/compute_alpha/classes.rb', line 14143

def user_licenses
  @user_licenses
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
# File 'lib/google/apis/compute_alpha/classes.rb', line 14150

def update!(**args)
  @architecture = args[:architecture] if args.key?(:architecture)
  @archive_size_bytes = args[:archive_size_bytes] if args.key?(:archive_size_bytes)
  @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)
  @deprecated = args[:deprecated] if args.key?(:deprecated)
  @description = args[:description] if args.key?(:description)
  @disk_size_gb = args[:disk_size_gb] if args.key?(:disk_size_gb)
  @family = args[:family] if args.key?(:family)
  @guest_os_features = args[:guest_os_features] if args.key?(:guest_os_features)
  @id = args[:id] if args.key?(:id)
  @image_encryption_key = args[:image_encryption_key] if args.key?(:image_encryption_key)
  @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)
  @locked = args[:locked] if args.key?(:locked)
  @name = args[:name] if args.key?(:name)
  @raw_disk = args[:raw_disk] if args.key?(:raw_disk)
  @rollout_override = args[:rollout_override] if args.key?(:rollout_override)
  @satisfies_pzs = args[:satisfies_pzs] if args.key?(:satisfies_pzs)
  @self_link = args[:self_link] if args.key?(:self_link)
  @self_link_with_id = args[:self_link_with_id] if args.key?(:self_link_with_id)
  @shielded_instance_initial_state = args[:shielded_instance_initial_state] if args.key?(:shielded_instance_initial_state)
  @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)
  @source_image = args[:source_image] if args.key?(:source_image)
  @source_image_encryption_key = args[:source_image_encryption_key] if args.key?(:source_image_encryption_key)
  @source_image_id = args[:source_image_id] if args.key?(:source_image_id)
  @source_snapshot = args[:source_snapshot] if args.key?(:source_snapshot)
  @source_snapshot_encryption_key = args[:source_snapshot_encryption_key] if args.key?(:source_snapshot_encryption_key)
  @source_snapshot_id = args[:source_snapshot_id] if args.key?(:source_snapshot_id)
  @source_type = args[:source_type] if args.key?(:source_type)
  @status = args[:status] if args.key?(:status)
  @storage_locations = args[:storage_locations] if args.key?(:storage_locations)
  @user_licenses = args[:user_licenses] if args.key?(:user_licenses)
end