Class: Kubevirt::V1DeveloperConfiguration

Inherits:
ApiModelBase show all
Defined in:
lib/kubevirt/models/v1_developer_configuration.rb

Overview

DeveloperConfiguration holds developer options

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ V1DeveloperConfiguration

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 102

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::V1DeveloperConfiguration` 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::V1DeveloperConfiguration`. 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?(:'cluster_profiler')
    self.cluster_profiler = attributes[:'cluster_profiler']
  end

  if attributes.key?(:'cpu_allocation_ratio')
    self.cpu_allocation_ratio = attributes[:'cpu_allocation_ratio']
  end

  if attributes.key?(:'disk_verification')
    self.disk_verification = attributes[:'disk_verification']
  end

  if attributes.key?(:'feature_gates')
    if (value = attributes[:'feature_gates']).is_a?(Array)
      self.feature_gates = value
    end
  end

  if attributes.key?(:'log_verbosity')
    self.log_verbosity = attributes[:'log_verbosity']
  end

  if attributes.key?(:'memory_overcommit')
    self.memory_overcommit = attributes[:'memory_overcommit']
  end

  if attributes.key?(:'minimum_cluster_tsc_frequency')
    self.minimum_cluster_tsc_frequency = attributes[:'minimum_cluster_tsc_frequency']
  end

  if attributes.key?(:'minimum_reserve_pvc_bytes')
    self.minimum_reserve_pvc_bytes = attributes[:'minimum_reserve_pvc_bytes']
  end

  if attributes.key?(:'node_selectors')
    if (value = attributes[:'node_selectors']).is_a?(Hash)
      self.node_selectors = value
    end
  end

  if attributes.key?(:'pvc_tolerate_less_space_up_to_percent')
    self.pvc_tolerate_less_space_up_to_percent = attributes[:'pvc_tolerate_less_space_up_to_percent']
  end

  if attributes.key?(:'use_emulation')
    self.use_emulation = attributes[:'use_emulation']
  end
end

Instance Attribute Details

#cluster_profilerObject

Enable the ability to pprof profile KubeVirt control plane



20
21
22
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 20

def cluster_profiler
  @cluster_profiler
end

#cpu_allocation_ratioObject

For each requested virtual CPU, CPUAllocationRatio defines how much physical CPU to request per VMI from the hosting node. The value is in fraction of a CPU thread (or core on non-hyperthreaded nodes). For example, a value of 1 means 1 physical CPU thread per VMI CPU thread. A value of 100 would be 1% of a physical thread allocated for each requested VMI thread. This option has no effect on VMIs that request dedicated CPUs. More information at: kubevirt.io/user-guide/operations/node_overcommit/#node-cpu-allocation-ratio Defaults to 10



23
24
25
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 23

def cpu_allocation_ratio
  @cpu_allocation_ratio
end

#disk_verificationObject

Returns the value of attribute disk_verification.



25
26
27
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 25

def disk_verification
  @disk_verification
end

#feature_gatesObject

FeatureGates is the list of experimental features to enable. Defaults to none



28
29
30
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 28

def feature_gates
  @feature_gates
end

#log_verbosityObject

Returns the value of attribute log_verbosity.



30
31
32
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 30

def log_verbosity
  @log_verbosity
end

#memory_overcommitObject

MemoryOvercommit is the percentage of memory we want to give VMIs compared to the amount given to its parent pod (virt-launcher). For example, a value of 102 means the VMI will "see" 2% more memory than its parent pod. Values under 100 are effectively "undercommits". Overcommits can lead to memory exhaustion, which in turn can lead to crashes. Use carefully. Defaults to 100



33
34
35
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 33

def memory_overcommit
  @memory_overcommit
end

#minimum_cluster_tsc_frequencyObject

Allow overriding the automatically determined minimum TSC frequency of the cluster and fixate the minimum to this frequency.



36
37
38
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 36

def minimum_cluster_tsc_frequency
  @minimum_cluster_tsc_frequency
end

#minimum_reserve_pvc_bytesObject

MinimumReservePVCBytes is the amount of space, in bytes, to leave unused on disks. Defaults to 131072 (128KiB)



39
40
41
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 39

def minimum_reserve_pvc_bytes
  @minimum_reserve_pvc_bytes
end

#node_selectorsObject

NodeSelectors allows restricting VMI creation to nodes that match a set of labels. Defaults to none



42
43
44
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 42

def node_selectors
  @node_selectors
end

#pvc_tolerate_less_space_up_to_percentObject

LessPVCSpaceToleration determines how much smaller, in percentage, disk PVCs are allowed to be compared to the requested size (to account for various overheads). Defaults to 10



45
46
47
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 45

def pvc_tolerate_less_space_up_to_percent
  @pvc_tolerate_less_space_up_to_percent
end

#use_emulationObject

UseEmulation can be set to true to allow fallback to software emulation in case hardware-assisted emulation is not available. Defaults to false



48
49
50
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 48

def use_emulation
  @use_emulation
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



68
69
70
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 68

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



73
74
75
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 73

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 51

def self.attribute_map
  {
    :'cluster_profiler' => :'clusterProfiler',
    :'cpu_allocation_ratio' => :'cpuAllocationRatio',
    :'disk_verification' => :'diskVerification',
    :'feature_gates' => :'featureGates',
    :'log_verbosity' => :'logVerbosity',
    :'memory_overcommit' => :'memoryOvercommit',
    :'minimum_cluster_tsc_frequency' => :'minimumClusterTSCFrequency',
    :'minimum_reserve_pvc_bytes' => :'minimumReservePVCBytes',
    :'node_selectors' => :'nodeSelectors',
    :'pvc_tolerate_less_space_up_to_percent' => :'pvcTolerateLessSpaceUpToPercent',
    :'use_emulation' => :'useEmulation'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 213

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_nullableObject

List of attributes with nullable: true



95
96
97
98
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 95

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 78

def self.openapi_types
  {
    :'cluster_profiler' => :'Boolean',
    :'cpu_allocation_ratio' => :'Integer',
    :'disk_verification' => :'V1DiskVerification',
    :'feature_gates' => :'Array<String>',
    :'log_verbosity' => :'V1LogVerbosity',
    :'memory_overcommit' => :'Integer',
    :'minimum_cluster_tsc_frequency' => :'Integer',
    :'minimum_reserve_pvc_bytes' => :'Integer',
    :'node_selectors' => :'Hash<String, String>',
    :'pvc_tolerate_less_space_up_to_percent' => :'Integer',
    :'use_emulation' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 182

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      cluster_profiler == o.cluster_profiler &&
      cpu_allocation_ratio == o.cpu_allocation_ratio &&
      disk_verification == o.disk_verification &&
      feature_gates == o.feature_gates &&
      log_verbosity == o.log_verbosity &&
      memory_overcommit == o.memory_overcommit &&
      minimum_cluster_tsc_frequency == o.minimum_cluster_tsc_frequency &&
      minimum_reserve_pvc_bytes == o.minimum_reserve_pvc_bytes &&
      node_selectors == o.node_selectors &&
      pvc_tolerate_less_space_up_to_percent == o.pvc_tolerate_less_space_up_to_percent &&
      use_emulation == o.use_emulation
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


200
201
202
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 200

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



206
207
208
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 206

def hash
  [cluster_profiler, cpu_allocation_ratio, disk_verification, feature_gates, log_verbosity, memory_overcommit, minimum_cluster_tsc_frequency, minimum_reserve_pvc_bytes, node_selectors, pvc_tolerate_less_space_up_to_percent, use_emulation].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



167
168
169
170
171
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 167

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 235

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

Returns:

  • (Boolean)

    true if the model is valid



175
176
177
178
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 175

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end