Class: SoftLayer::VirtualDiskImage
- Includes:
- DynamicAttribute
- Defined in:
- lib/softlayer/VirtualDiskImage.rb
Overview
Each SoftLayer VirtualDiskImage instance provides information about software installed on a specific piece of hardware.
This class roughly corresponds to the entity SoftLayer_Virtual_Disk_Image in the API.
Instance Attribute Summary
Attributes inherited from ModelBase
Instance Method Summary collapse
-
#capacity ⇒ Object
:attr_reader: A disk image’s size measured in gigabytes.
-
#checksum ⇒ Object
:attr_reader: A disk image’s unique md5 checksum.
-
#coalesced_disk_images ⇒ Object
Returns coalesced disk images associated with this virtual disk image.
-
#created ⇒ Object
:attr_reader: The date a disk image was created.
-
#description ⇒ Object
:attr_reader: A brief description of a virtual disk image.
-
#local_disk ⇒ Object
Returns local disk flag associated with virtual disk image.
-
#metadata ⇒ Object
Whether this disk image is meant for storage of custom user data supplied with a Cloud Computing Instance order.
-
#modified ⇒ Object
:attr_reader: The date a disk image was last modified.
-
#name ⇒ Object
:attr_reader: A descriptive name used to identify a disk image to a user.
-
#service ⇒ Object
Returns the service for interacting with this virtual disk image through the network API.
-
#software ⇒ Object
References to the software that resides on a disk image.
-
#source_disk_image ⇒ Object
The original disk image that the current disk image was cloned from.
-
#type_description ⇒ Object
A brief description of a virtual disk image type’s function.
-
#type_name ⇒ Object
A virtual disk image type’s name.
-
#units ⇒ Object
:attr_reader: The unit of storage in which the size of the image is measured.
-
#uuid ⇒ Object
:attr_reader: A disk image’s unique ID on a virtualization platform.
Methods included from DynamicAttribute
Methods inherited from ModelBase
#[], #has_sl_property?, #initialize, #refresh_details, sl_attr, #to_ary
Constructor Details
This class inherits a constructor from SoftLayer::ModelBase
Instance Method Details
#capacity ⇒ Object
:attr_reader: A disk image’s size measured in gigabytes.
21 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 21 sl_attr :capacity |
#checksum ⇒ Object
:attr_reader: A disk image’s unique md5 checksum.
26 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 26 sl_attr :checksum |
#coalesced_disk_images ⇒ Object
Returns coalesced disk images associated with this virtual disk image
61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 61 sl_dynamic_attr :coalesced_disk_images do |resource| resource.should_update? do #only retrieved once per instance @coalesced_disk_images == nil end resource.to_update do coalesced_disk_images = self.service.getCoalescedDiskImages coalesced_disk_images.collect { |coalesced_disk_image| VirtualDiskImage.new(softlayer_client, coalesced_disk_image) } end end |
#created ⇒ Object
:attr_reader: The date a disk image was created.
31 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 31 sl_attr :created, 'createDate' |
#description ⇒ Object
:attr_reader: A brief description of a virtual disk image.
36 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 36 sl_attr :description |
#local_disk ⇒ Object
Returns local disk flag associated with virtual disk image
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 75 sl_dynamic_attr :local_disk do |resource| resource.should_update? do #only retrieved once per instance @local_disk == nil end resource.to_update do self.service.getLocalDiskFlag end end |
#metadata ⇒ Object
Whether this disk image is meant for storage of custom user data supplied with a Cloud Computing Instance order.
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 89 sl_dynamic_attr :metadata do |resource| resource.should_update? do #only retrieved once per instance @metadata == nil end resource.to_update do self.service.getMetadataFlag end end |
#modified ⇒ Object
:attr_reader: The date a disk image was last modified.
41 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 41 sl_attr :modified, 'modifyDate' |
#name ⇒ Object
:attr_reader: A descriptive name used to identify a disk image to a user.
46 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 46 sl_attr :name |
#service ⇒ Object
Returns the service for interacting with this virtual disk image through the network API
159 160 161 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 159 def service softlayer_client[:Virtual_Disk_Image].object_with_id(self.id) end |
#software ⇒ Object
References to the software that resides on a disk image.
102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 102 sl_dynamic_attr :software do |resource| resource.should_update? do #only retrieved once per instance @software == nil end resource.to_update do software_references = self.service.object_mask(VirtualDiskImageSoftware.default_object_mask).getSoftwareReferences software_references.collect { |software| VirtualDiskImageSoftware.new(softlayer_client, software) unless software.empty? }.compact end end |
#source_disk_image ⇒ Object
The original disk image that the current disk image was cloned from.
116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 116 sl_dynamic_attr :source_disk_image do |resource| resource.should_update? do #only retrieved once per instance @source_disk_image == nil end resource.to_update do source_disk_image = self.service.object_mask(VirtualDiskImage.default_object_mask).getSourceDiskImage VirtualDiskImage.new(softlayer_client, source_disk_image) unless source_disk_image.empty? end end |
#type_description ⇒ Object
A brief description of a virtual disk image type’s function.
130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 130 sl_dynamic_attr :type_description do |resource| resource.should_update? do #only retrieved once per instance @type_description == nil end resource.to_update do type = self.service.getType type['description'] end end |
#type_name ⇒ Object
A virtual disk image type’s name.
144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 144 sl_dynamic_attr :type_name do |resource| resource.should_update? do #only retrieved once per instance @type_name == nil end resource.to_update do type = self.service.getType type['name'] end end |
#units ⇒ Object
:attr_reader: The unit of storage in which the size of the image is measured. Defaults to “GB” for gigabytes.
52 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 52 sl_attr :units |
#uuid ⇒ Object
:attr_reader: A disk image’s unique ID on a virtualization platform.
57 |
# File 'lib/softlayer/VirtualDiskImage.rb', line 57 sl_attr :uuid |