Class: Azure::ARM::Compute::Models::OSProfile
- Inherits:
-
Object
- Object
- Azure::ARM::Compute::Models::OSProfile
- Includes:
- MsRestAzure
- Defined in:
- lib/azure_mgmt_compute/models/osprofile.rb
Overview
Describes an OS profile.
Instance Attribute Summary collapse
-
#admin_password ⇒ String
Gets or sets the admin user password.
-
#admin_username ⇒ String
Gets or sets the admin user name.
-
#computer_name ⇒ String
Gets or sets the computer name.
-
#custom_data ⇒ String
Gets or sets a base-64 encoded string of custom data.
-
#linux_configuration ⇒ LinuxConfiguration
the OS profile.
-
#secrets ⇒ Array<VaultSecretGroup>
certificates for addition to the VM.
-
#windows_configuration ⇒ WindowsConfiguration
of the OS profile.
Class Method Summary collapse
-
.deserialize_object(object) ⇒ OSProfile
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
#admin_password ⇒ String
Returns Gets or sets the admin user password.
22 23 24 |
# File 'lib/azure_mgmt_compute/models/osprofile.rb', line 22 def admin_password @admin_password end |
#admin_username ⇒ String
Returns Gets or sets the admin user name.
19 20 21 |
# File 'lib/azure_mgmt_compute/models/osprofile.rb', line 19 def admin_username @admin_username end |
#computer_name ⇒ String
Returns Gets or sets the computer name.
16 17 18 |
# File 'lib/azure_mgmt_compute/models/osprofile.rb', line 16 def computer_name @computer_name end |
#custom_data ⇒ String
Returns Gets or sets a base-64 encoded string of custom data.
25 26 27 |
# File 'lib/azure_mgmt_compute/models/osprofile.rb', line 25 def custom_data @custom_data end |
#linux_configuration ⇒ LinuxConfiguration
the OS profile.
33 34 35 |
# File 'lib/azure_mgmt_compute/models/osprofile.rb', line 33 def linux_configuration @linux_configuration end |
#secrets ⇒ Array<VaultSecretGroup>
certificates for addition to the VM.
37 38 39 |
# File 'lib/azure_mgmt_compute/models/osprofile.rb', line 37 def secrets @secrets end |
#windows_configuration ⇒ WindowsConfiguration
of the OS profile.
29 30 31 |
# File 'lib/azure_mgmt_compute/models/osprofile.rb', line 29 def windows_configuration @windows_configuration end |
Class Method Details
.deserialize_object(object) ⇒ OSProfile
Deserializes given Ruby Hash into Model object.
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 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/azure_mgmt_compute/models/osprofile.rb', line 102 def self.deserialize_object(object) return if object.nil? output_object = OSProfile.new deserialized_property = object['computerName'] output_object.computer_name = deserialized_property deserialized_property = object['adminUsername'] output_object.admin_username = deserialized_property deserialized_property = object['adminPassword'] output_object.admin_password = deserialized_property deserialized_property = object['customData'] output_object.custom_data = deserialized_property deserialized_property = object['windowsConfiguration'] unless deserialized_property.nil? deserialized_property = WindowsConfiguration.deserialize_object(deserialized_property) end output_object.windows_configuration = deserialized_property deserialized_property = object['linuxConfiguration'] unless deserialized_property.nil? deserialized_property = LinuxConfiguration.deserialize_object(deserialized_property) end output_object.linux_configuration = deserialized_property deserialized_property = object['secrets'] unless deserialized_property.nil? deserializedArray = []; deserialized_property.each do |element1| unless element1.nil? element1 = VaultSecretGroup.deserialize_object(element1) end deserializedArray.push(element1); end deserialized_property = deserializedArray; end output_object.secrets = 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 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/azure_mgmt_compute/models/osprofile.rb', line 53 def self.serialize_object(object) object.validate output_object = {} serialized_property = object.computer_name output_object['computerName'] = serialized_property unless serialized_property.nil? serialized_property = object.admin_username output_object['adminUsername'] = serialized_property unless serialized_property.nil? serialized_property = object.admin_password output_object['adminPassword'] = serialized_property unless serialized_property.nil? serialized_property = object.custom_data output_object['customData'] = serialized_property unless serialized_property.nil? serialized_property = object.windows_configuration unless serialized_property.nil? serialized_property = WindowsConfiguration.serialize_object(serialized_property) end output_object['windowsConfiguration'] = serialized_property unless serialized_property.nil? serialized_property = object.linux_configuration unless serialized_property.nil? serialized_property = LinuxConfiguration.serialize_object(serialized_property) end output_object['linuxConfiguration'] = serialized_property unless serialized_property.nil? serialized_property = object.secrets unless serialized_property.nil? serializedArray = [] serialized_property.each do |element| unless element.nil? element = VaultSecretGroup.serialize_object(element) end serializedArray.push(element) end serialized_property = serializedArray end output_object['secrets'] = serialized_property unless serialized_property.nil? output_object end |
Instance Method Details
#validate ⇒ Object
Validate the object. Throws ValidationError if validation fails.
42 43 44 45 46 |
# File 'lib/azure_mgmt_compute/models/osprofile.rb', line 42 def validate @windows_configuration.validate unless @windows_configuration.nil? @linux_configuration.validate unless @linux_configuration.nil? @secrets.each{ |e| e.validate if e.respond_to?(:validate) } unless @secrets.nil? end |