Class: Kubevirt::V1beta1VirtualMachinePreferenceSpec
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Kubevirt::V1beta1VirtualMachinePreferenceSpec
- Defined in:
- lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb
Overview
VirtualMachinePreferenceSpec is a description of the VirtualMachinePreference or VirtualMachineClusterPreference.
Instance Attribute Summary collapse
-
#annotations ⇒ Object
Optionally defines preferred Annotations to be applied to the VirtualMachineInstance.
-
#clock ⇒ Object
Returns the value of attribute clock.
-
#cpu ⇒ Object
Returns the value of attribute cpu.
-
#devices ⇒ Object
Returns the value of attribute devices.
-
#features ⇒ Object
Returns the value of attribute features.
-
#firmware ⇒ Object
Returns the value of attribute firmware.
-
#machine ⇒ Object
Returns the value of attribute machine.
-
#prefer_spread_socket_to_core_ratio ⇒ Object
PreferSpreadSocketToCoreRatio defines the ratio to spread vCPUs between cores and sockets, it defaults to 2.
-
#preferred_architecture ⇒ Object
PreferredArchitecture defines a prefeerred architecture for the VirtualMachine.
-
#preferred_subdomain ⇒ Object
Subdomain of the VirtualMachineInstance.
-
#preferred_termination_grace_period_seconds ⇒ Object
Grace period observed after signalling a VirtualMachineInstance to stop after which the VirtualMachineInstance is force terminated.
-
#requirements ⇒ Object
Returns the value of attribute requirements.
-
#volumes ⇒ Object
Returns the value of attribute volumes.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.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.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ V1beta1VirtualMachinePreferenceSpec
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ V1beta1VirtualMachinePreferenceSpec
Initializes the object
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 147 148 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 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 106 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::V1beta1VirtualMachinePreferenceSpec` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Kubevirt::V1beta1VirtualMachinePreferenceSpec`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'annotations') if (value = attributes[:'annotations']).is_a?(Hash) self.annotations = value end end if attributes.key?(:'clock') self.clock = attributes[:'clock'] end if attributes.key?(:'cpu') self.cpu = attributes[:'cpu'] end if attributes.key?(:'devices') self.devices = attributes[:'devices'] end if attributes.key?(:'features') self.features = attributes[:'features'] end if attributes.key?(:'firmware') self.firmware = attributes[:'firmware'] end if attributes.key?(:'machine') self.machine = attributes[:'machine'] end if attributes.key?(:'prefer_spread_socket_to_core_ratio') self.prefer_spread_socket_to_core_ratio = attributes[:'prefer_spread_socket_to_core_ratio'] end if attributes.key?(:'preferred_architecture') self.preferred_architecture = attributes[:'preferred_architecture'] end if attributes.key?(:'preferred_subdomain') self.preferred_subdomain = attributes[:'preferred_subdomain'] end if attributes.key?(:'preferred_termination_grace_period_seconds') self.preferred_termination_grace_period_seconds = attributes[:'preferred_termination_grace_period_seconds'] end if attributes.key?(:'requirements') self.requirements = attributes[:'requirements'] end if attributes.key?(:'volumes') self.volumes = attributes[:'volumes'] end end |
Instance Attribute Details
#annotations ⇒ Object
Optionally defines preferred Annotations to be applied to the VirtualMachineInstance
20 21 22 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 20 def annotations @annotations end |
#clock ⇒ Object
Returns the value of attribute clock.
22 23 24 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 22 def clock @clock end |
#cpu ⇒ Object
Returns the value of attribute cpu.
24 25 26 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 24 def cpu @cpu end |
#devices ⇒ Object
Returns the value of attribute devices.
26 27 28 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 26 def devices @devices end |
#features ⇒ Object
Returns the value of attribute features.
28 29 30 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 28 def features @features end |
#firmware ⇒ Object
Returns the value of attribute firmware.
30 31 32 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 30 def firmware @firmware end |
#machine ⇒ Object
Returns the value of attribute machine.
32 33 34 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 32 def machine @machine end |
#prefer_spread_socket_to_core_ratio ⇒ Object
PreferSpreadSocketToCoreRatio defines the ratio to spread vCPUs between cores and sockets, it defaults to 2.
35 36 37 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 35 def prefer_spread_socket_to_core_ratio @prefer_spread_socket_to_core_ratio end |
#preferred_architecture ⇒ Object
PreferredArchitecture defines a prefeerred architecture for the VirtualMachine
38 39 40 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 38 def preferred_architecture @preferred_architecture end |
#preferred_subdomain ⇒ Object
Subdomain of the VirtualMachineInstance
41 42 43 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 41 def preferred_subdomain @preferred_subdomain end |
#preferred_termination_grace_period_seconds ⇒ Object
Grace period observed after signalling a VirtualMachineInstance to stop after which the VirtualMachineInstance is force terminated.
44 45 46 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 44 def preferred_termination_grace_period_seconds @preferred_termination_grace_period_seconds end |
#requirements ⇒ Object
Returns the value of attribute requirements.
46 47 48 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 46 def requirements @requirements end |
#volumes ⇒ Object
Returns the value of attribute volumes.
48 49 50 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 48 def volumes @volumes end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
70 71 72 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 70 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
75 76 77 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 75 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 51 def self.attribute_map { :'annotations' => :'annotations', :'clock' => :'clock', :'cpu' => :'cpu', :'devices' => :'devices', :'features' => :'features', :'firmware' => :'firmware', :'machine' => :'machine', :'prefer_spread_socket_to_core_ratio' => :'preferSpreadSocketToCoreRatio', :'preferred_architecture' => :'preferredArchitecture', :'preferred_subdomain' => :'preferredSubdomain', :'preferred_termination_grace_period_seconds' => :'preferredTerminationGracePeriodSeconds', :'requirements' => :'requirements', :'volumes' => :'volumes' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 225 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
99 100 101 102 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 99 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 80 def self.openapi_types { :'annotations' => :'Hash<String, String>', :'clock' => :'V1beta1ClockPreferences', :'cpu' => :'V1beta1CPUPreferences', :'devices' => :'V1beta1DevicePreferences', :'features' => :'V1beta1FeaturePreferences', :'firmware' => :'V1beta1FirmwarePreferences', :'machine' => :'V1beta1MachinePreferences', :'prefer_spread_socket_to_core_ratio' => :'Integer', :'preferred_architecture' => :'String', :'preferred_subdomain' => :'String', :'preferred_termination_grace_period_seconds' => :'Integer', :'requirements' => :'V1beta1PreferenceRequirements', :'volumes' => :'V1beta1VolumePreferences' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 192 def ==(o) return true if self.equal?(o) self.class == o.class && annotations == o.annotations && clock == o.clock && cpu == o.cpu && devices == o.devices && features == o.features && firmware == o.firmware && machine == o.machine && prefer_spread_socket_to_core_ratio == o.prefer_spread_socket_to_core_ratio && preferred_architecture == o.preferred_architecture && preferred_subdomain == o.preferred_subdomain && preferred_termination_grace_period_seconds == o.preferred_termination_grace_period_seconds && requirements == o.requirements && volumes == o.volumes end |
#eql?(o) ⇒ Boolean
212 213 214 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 212 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
218 219 220 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 218 def hash [annotations, clock, cpu, devices, features, firmware, machine, prefer_spread_socket_to_core_ratio, preferred_architecture, preferred_subdomain, preferred_termination_grace_period_seconds, requirements, volumes].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
177 178 179 180 181 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 177 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 247 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
185 186 187 188 |
# File 'lib/kubevirt/models/v1beta1_virtual_machine_preference_spec.rb', line 185 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |