Class: Azure::ARM::Compute::Models::OSDisk
- Inherits:
-
Object
- Object
- Azure::ARM::Compute::Models::OSDisk
- Includes:
- MsRestAzure
- Defined in:
- lib/azure_mgmt_compute/models/osdisk.rb
Overview
Describes an Operating System disk.
Instance Attribute Summary collapse
-
#caching ⇒ CachingTypes
for this property include: ‘None’, ‘ReadOnly’, ‘ReadWrite’.
-
#create_option ⇒ DiskCreateOptionTypes
Possible values for this property include: ‘fromImage’, ‘empty’, ‘attach’.
-
#image ⇒ VirtualHardDisk
VirtualHardDisk.
-
#name ⇒ String
Gets or sets the disk name.
-
#os_type ⇒ OperatingSystemTypes
Possible values for this property include: ‘Windows’, ‘Linux’.
-
#vhd ⇒ VirtualHardDisk
Gets or sets the Virtual Hard Disk.
Class Method Summary collapse
-
.deserialize_object(object) ⇒ OSDisk
Deserializes given Ruby Hash into Model object.
-
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
Instance Method Summary collapse
-
#validate ⇒ Object
Validate the object.
Instance Attribute Details
#caching ⇒ CachingTypes
for this property include: ‘None’, ‘ReadOnly’, ‘ReadWrite’.
33 34 35 |
# File 'lib/azure_mgmt_compute/models/osdisk.rb', line 33 def caching @caching end |
#create_option ⇒ DiskCreateOptionTypes
Possible values for this property include: ‘fromImage’, ‘empty’, ‘attach’.
38 39 40 |
# File 'lib/azure_mgmt_compute/models/osdisk.rb', line 38 def create_option @create_option end |
#image ⇒ VirtualHardDisk
VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine.If SourceImage is provided, the destination VirtualHardDisk should not exist.
29 30 31 |
# File 'lib/azure_mgmt_compute/models/osdisk.rb', line 29 def image @image end |
#name ⇒ String
Returns Gets or sets the disk name.
20 21 22 |
# File 'lib/azure_mgmt_compute/models/osdisk.rb', line 20 def name @name end |
#os_type ⇒ OperatingSystemTypes
Possible values for this property include: ‘Windows’, ‘Linux’.
17 18 19 |
# File 'lib/azure_mgmt_compute/models/osdisk.rb', line 17 def os_type @os_type end |
#vhd ⇒ VirtualHardDisk
Returns Gets or sets the Virtual Hard Disk.
23 24 25 |
# File 'lib/azure_mgmt_compute/models/osdisk.rb', line 23 def vhd @vhd end |
Class Method Details
.deserialize_object(object) ⇒ OSDisk
Deserializes given Ruby Hash into Model object.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/azure_mgmt_compute/models/osdisk.rb', line 89 def self.deserialize_object(object) return if object.nil? output_object = OSDisk.new deserialized_property = object['osType'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = OperatingSystemTypes.constants.any? { |e| OperatingSystemTypes.const_get(e).to_s.downcase == deserialized_property.downcase } fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid end output_object.os_type = deserialized_property deserialized_property = object['name'] output_object.name = deserialized_property deserialized_property = object['vhd'] unless deserialized_property.nil? deserialized_property = VirtualHardDisk.deserialize_object(deserialized_property) end output_object.vhd = deserialized_property deserialized_property = object['image'] unless deserialized_property.nil? deserialized_property = VirtualHardDisk.deserialize_object(deserialized_property) end output_object.image = deserialized_property deserialized_property = object['caching'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = CachingTypes.constants.any? { |e| CachingTypes.const_get(e).to_s.downcase == deserialized_property.downcase } fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid end output_object.caching = deserialized_property deserialized_property = object['createOption'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = DiskCreateOptionTypes.constants.any? { |e| DiskCreateOptionTypes.const_get(e).to_s.downcase == deserialized_property.downcase } fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid end output_object.create_option = deserialized_property output_object.validate output_object end |
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/azure_mgmt_compute/models/osdisk.rb', line 53 def self.serialize_object(object) object.validate output_object = {} serialized_property = object.os_type output_object['osType'] = serialized_property unless serialized_property.nil? serialized_property = object.name output_object['name'] = serialized_property unless serialized_property.nil? serialized_property = object.vhd unless serialized_property.nil? serialized_property = VirtualHardDisk.serialize_object(serialized_property) end output_object['vhd'] = serialized_property unless serialized_property.nil? serialized_property = object.image unless serialized_property.nil? serialized_property = VirtualHardDisk.serialize_object(serialized_property) end output_object['image'] = serialized_property unless serialized_property.nil? serialized_property = object.caching output_object['caching'] = serialized_property unless serialized_property.nil? serialized_property = object.create_option output_object['createOption'] = serialized_property unless serialized_property.nil? output_object end |
Instance Method Details
#validate ⇒ Object
Validate the object. Throws ValidationError if validation fails.
43 44 45 46 |
# File 'lib/azure_mgmt_compute/models/osdisk.rb', line 43 def validate @vhd.validate unless @vhd.nil? @image.validate unless @image.nil? end |