Class: SoftLayer::VirtualDiskImage

Inherits:
ModelBase
  • Object
show all
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

#softlayer_client

Instance Method Summary collapse

Methods included from DynamicAttribute

included

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

#capacityObject

:attr_reader: A disk image's size measured in gigabytes.



21
# File 'lib/softlayer/VirtualDiskImage.rb', line 21

sl_attr :capacity

#checksumObject

:attr_reader: A disk image's unique md5 checksum.



26
# File 'lib/softlayer/VirtualDiskImage.rb', line 26

sl_attr :checksum

#coalesced_disk_imagesObject

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

#createdObject

:attr_reader: The date a disk image was created.



31
# File 'lib/softlayer/VirtualDiskImage.rb', line 31

sl_attr :created,    'createDate'

#descriptionObject

:attr_reader: A brief description of a virtual disk image.



36
# File 'lib/softlayer/VirtualDiskImage.rb', line 36

sl_attr :description

#local_diskObject

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

#metadataObject

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

#modifiedObject

:attr_reader: The date a disk image was last modified.



41
# File 'lib/softlayer/VirtualDiskImage.rb', line 41

sl_attr :modified,   'modifyDate'

#nameObject

: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

#serviceObject

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

#softwareObject

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_imageObject

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_descriptionObject

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_nameObject

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

#unitsObject

: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

#uuidObject

:attr_reader: A disk image's unique ID on a virtualization platform.



57
# File 'lib/softlayer/VirtualDiskImage.rb', line 57

sl_attr :uuid