Class: IntersightClient::OsAnswers
- Inherits:
-
MoBaseComplexType
- Object
- MoBaseComplexType
- IntersightClient::OsAnswers
- Defined in:
- lib/intersight_client/models/os_answers.rb
Overview
This MO captures the values for the most common set of fields in OS specific answer files. The values provided in this MO are used to construct the OS specific answer files (kickstart, seed, unattended xml) by replacing the fields/placeholders in selected os.ConfigurationFile content with the values of this MO properties.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#answer_file ⇒ Object
If the source of the answers is a static file, the content of the file is stored as value in this property.
-
#class_id ⇒ Object
The fully-qualified name of the instantiated, concrete type.
-
#hostname ⇒ Object
Hostname to be configured for the server in the OS.
-
#ip_config_type ⇒ Object
IP configuration type.
-
#ip_configuration ⇒ Object
Returns the value of attribute ip_configuration.
-
#is_answer_file_set ⇒ Object
Indicates whether the value of the ‘answerFile’ property has been set.
-
#is_root_password_crypted ⇒ Object
Enable to indicate Root Password provided is encrypted.
-
#is_root_password_set ⇒ Object
Indicates whether the value of the ‘rootPassword’ property has been set.
-
#nameserver ⇒ Object
IP address of the name server to be configured in the OS.
-
#object_type ⇒ Object
The fully-qualified name of the instantiated, concrete type.
-
#product_key ⇒ Object
The product key to be used for a specific version of Windows installation.
-
#root_password ⇒ Object
Password configured for the root / administrator user in the OS.
-
#source ⇒ Object
Answer values can be provided from three sources - Embedded in OS image, static file, or as placeholder values for an answer file template.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns the key-value map of all the JSON attributes this model knows about, including the ones defined in its parent(s).
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about, including the ones defined in its parent(s).
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.openapi_discriminator_name ⇒ Object
discriminator’s property name in OpenAPI v3.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OsAnswers
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ OsAnswers
Initializes the object
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/intersight_client/models/os_answers.rb', line 149 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::OsAnswers` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `#{self.class.name}`. Please check the name to make sure it's valid. List of attributes: " + self.class.acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } # call parent's initialize super(attributes) if attributes.key?(:'class_id') self.class_id = attributes[:'class_id'] else self.class_id = 'os.Answers' end if attributes.key?(:'object_type') self.object_type = attributes[:'object_type'] else self.object_type = 'os.Answers' end if attributes.key?(:'answer_file') self.answer_file = attributes[:'answer_file'] end if attributes.key?(:'hostname') self.hostname = attributes[:'hostname'] end if attributes.key?(:'ip_config_type') self.ip_config_type = attributes[:'ip_config_type'] else self.ip_config_type = 'static' end if attributes.key?(:'ip_configuration') self.ip_configuration = attributes[:'ip_configuration'] end if attributes.key?(:'is_answer_file_set') self.is_answer_file_set = attributes[:'is_answer_file_set'] else self.is_answer_file_set = false end if attributes.key?(:'is_root_password_crypted') self.is_root_password_crypted = attributes[:'is_root_password_crypted'] end if attributes.key?(:'is_root_password_set') self.is_root_password_set = attributes[:'is_root_password_set'] else self.is_root_password_set = false end if attributes.key?(:'nameserver') self.nameserver = attributes[:'nameserver'] end if attributes.key?(:'product_key') self.product_key = attributes[:'product_key'] end if attributes.key?(:'root_password') self.root_password = attributes[:'root_password'] end if attributes.key?(:'source') self.source = attributes[:'source'] else self.source = 'None' end end |
Instance Attribute Details
#answer_file ⇒ Object
If the source of the answers is a static file, the content of the file is stored as value in this property. The value is mandatory only when the ‘Source’ property has been set to ‘File’.
26 27 28 |
# File 'lib/intersight_client/models/os_answers.rb', line 26 def answer_file @answer_file end |
#class_id ⇒ Object
The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.
20 21 22 |
# File 'lib/intersight_client/models/os_answers.rb', line 20 def class_id @class_id end |
#hostname ⇒ Object
Hostname to be configured for the server in the OS.
29 30 31 |
# File 'lib/intersight_client/models/os_answers.rb', line 29 def hostname @hostname end |
#ip_config_type ⇒ Object
IP configuration type. Values are Static or Dynamic configuration of IP. In case of static IP configuration, IP address, gateway and other details need to be populated. In case of dynamic the IP configuration is obtained dynamically from DHCP. * static - In case of static IP configuraton, provide the details such as IP address, netmask, and gateway. * DHCP - In case of dynamic IP configuration, the IP address, netmask and gateway detailsare obtained from DHCP.
32 33 34 |
# File 'lib/intersight_client/models/os_answers.rb', line 32 def ip_config_type @ip_config_type end |
#ip_configuration ⇒ Object
Returns the value of attribute ip_configuration.
34 35 36 |
# File 'lib/intersight_client/models/os_answers.rb', line 34 def ip_configuration @ip_configuration end |
#is_answer_file_set ⇒ Object
Indicates whether the value of the ‘answerFile’ property has been set.
37 38 39 |
# File 'lib/intersight_client/models/os_answers.rb', line 37 def is_answer_file_set @is_answer_file_set end |
#is_root_password_crypted ⇒ Object
Enable to indicate Root Password provided is encrypted.
40 41 42 |
# File 'lib/intersight_client/models/os_answers.rb', line 40 def is_root_password_crypted @is_root_password_crypted end |
#is_root_password_set ⇒ Object
Indicates whether the value of the ‘rootPassword’ property has been set.
43 44 45 |
# File 'lib/intersight_client/models/os_answers.rb', line 43 def is_root_password_set @is_root_password_set end |
#nameserver ⇒ Object
IP address of the name server to be configured in the OS.
46 47 48 |
# File 'lib/intersight_client/models/os_answers.rb', line 46 def nameserver @nameserver end |
#object_type ⇒ Object
The fully-qualified name of the instantiated, concrete type. The value should be the same as the ‘ClassId’ property.
23 24 25 |
# File 'lib/intersight_client/models/os_answers.rb', line 23 def object_type @object_type end |
#product_key ⇒ Object
The product key to be used for a specific version of Windows installation.
49 50 51 |
# File 'lib/intersight_client/models/os_answers.rb', line 49 def product_key @product_key end |
#root_password ⇒ Object
Password configured for the root / administrator user in the OS. You can enter a plain text or an encrypted password. Intersight encrypts the plaintext password. Enable the Encrypted Password option to provide an encrypted password. For more details on encrypting passwords, see Help Center.
52 53 54 |
# File 'lib/intersight_client/models/os_answers.rb', line 52 def root_password @root_password end |
#source ⇒ Object
Answer values can be provided from three sources - Embedded in OS image, static file, or as placeholder values for an answer file template. Source of the answers is given as value, Embedded/File/Template. ‘Embedded’ option indicates that the answer file is embedded within the OS Image. ‘File’ option indicates that the answers are provided as a file. ‘Template’ indicates that the placeholders in the selected os.ConfigurationFile MO are replaced with values provided as os.Answers MO. * None - Indicates that answers is not sent and values must be populated from Install Template. * Embedded - Indicates that the answer file is embedded within OS image. * File - Indicates that the answer file is a static content that has all thevalues populated. * Template - Indicates that the given answers are used to populate the answer filetemplate. The template allows the users to refer some server specificanswers as fields/placeholders and replace these placeholders with theactual values for each Server during OS installation using ‘Answers’ and’AdditionalParameters’ properties in os.Install MO.The answer file templates can be created by users as os.ConfigurationFile objects.
55 56 57 |
# File 'lib/intersight_client/models/os_answers.rb', line 55 def source @source end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns the key-value map of all the JSON attributes this model knows about, including the ones defined in its parent(s)
104 105 106 |
# File 'lib/intersight_client/models/os_answers.rb', line 104 def self.acceptable_attribute_map attribute_map.merge(superclass.acceptable_attribute_map) end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
99 100 101 |
# File 'lib/intersight_client/models/os_answers.rb', line 99 def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/intersight_client/models/os_answers.rb', line 80 def self.attribute_map { :'class_id' => :'ClassId', :'object_type' => :'ObjectType', :'answer_file' => :'AnswerFile', :'hostname' => :'Hostname', :'ip_config_type' => :'IpConfigType', :'ip_configuration' => :'IpConfiguration', :'is_answer_file_set' => :'IsAnswerFileSet', :'is_root_password_crypted' => :'IsRootPasswordCrypted', :'is_root_password_set' => :'IsRootPasswordSet', :'nameserver' => :'Nameserver', :'product_key' => :'ProductKey', :'root_password' => :'RootPassword', :'source' => :'Source' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
336 337 338 |
# File 'lib/intersight_client/models/os_answers.rb', line 336 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
135 136 137 138 139 140 |
# File 'lib/intersight_client/models/os_answers.rb', line 135 def self.openapi_all_of [ :'MoBaseComplexType', :'OsAnswersAllOf' ] end |
.openapi_discriminator_name ⇒ Object
discriminator’s property name in OpenAPI v3
143 144 145 |
# File 'lib/intersight_client/models/os_answers.rb', line 143 def self.openapi_discriminator_name :'ClassId' end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
128 129 130 131 132 |
# File 'lib/intersight_client/models/os_answers.rb', line 128 def self.openapi_nullable Set.new([ :'ip_configuration', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/intersight_client/models/os_answers.rb', line 109 def self.openapi_types { :'class_id' => :'String', :'object_type' => :'String', :'answer_file' => :'String', :'hostname' => :'String', :'ip_config_type' => :'String', :'ip_configuration' => :'OsIpConfiguration', :'is_answer_file_set' => :'Boolean', :'is_root_password_crypted' => :'Boolean', :'is_root_password_set' => :'Boolean', :'nameserver' => :'String', :'product_key' => :'String', :'root_password' => :'String', :'source' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/intersight_client/models/os_answers.rb', line 303 def ==(o) return true if self.equal?(o) self.class == o.class && class_id == o.class_id && object_type == o.object_type && answer_file == o.answer_file && hostname == o.hostname && ip_config_type == o.ip_config_type && ip_configuration == o.ip_configuration && is_answer_file_set == o.is_answer_file_set && is_root_password_crypted == o.is_root_password_crypted && is_root_password_set == o.is_root_password_set && nameserver == o.nameserver && product_key == o.product_key && root_password == o.root_password && source == o.source && super(o) end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
# File 'lib/intersight_client/models/os_answers.rb', line 367 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = IntersightClient.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
438 439 440 441 442 443 444 445 446 447 448 449 450 |
# File 'lib/intersight_client/models/os_answers.rb', line 438 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/intersight_client/models/os_answers.rb', line 343 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) super(attributes) OsAnswers.openapi_types.each_pair do |key, type| if attributes[OsAnswers.attribute_map[key]].nil? && OsAnswers.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[OsAnswers.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[OsAnswers.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[OsAnswers.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[OsAnswers.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
323 324 325 |
# File 'lib/intersight_client/models/os_answers.rb', line 323 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
329 330 331 |
# File 'lib/intersight_client/models/os_answers.rb', line 329 def hash [class_id, object_type, answer_file, hostname, ip_config_type, ip_configuration, is_answer_file_set, is_root_password_crypted, is_root_password_set, nameserver, product_key, root_password, source].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/intersight_client/models/os_answers.rb', line 232 def list_invalid_properties invalid_properties = super if @class_id.nil? invalid_properties.push('invalid value for "class_id", class_id cannot be nil.') end if @object_type.nil? invalid_properties.push('invalid value for "object_type", object_type cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
414 415 416 |
# File 'lib/intersight_client/models/os_answers.rb', line 414 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/intersight_client/models/os_answers.rb', line 420 def to_hash hash = super OsAnswers.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = OsAnswers.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
408 409 410 |
# File 'lib/intersight_client/models/os_answers.rb', line 408 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/intersight_client/models/os_answers.rb', line 247 def valid? return false if @class_id.nil? class_id_validator = EnumAttributeValidator.new('String', ["os.Answers"]) return false unless class_id_validator.valid?(@class_id) return false if @object_type.nil? object_type_validator = EnumAttributeValidator.new('String', ["os.Answers"]) return false unless object_type_validator.valid?(@object_type) ip_config_type_validator = EnumAttributeValidator.new('String', ["static", "DHCP"]) return false unless ip_config_type_validator.valid?(@ip_config_type) source_validator = EnumAttributeValidator.new('String', ["None", "Embedded", "File", "Template"]) return false unless source_validator.valid?(@source) true && super end |