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



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

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?(:'disabled_feature_gates')
    if (value = attributes[:'disabled_feature_gates']).is_a?(Array)
      self.disabled_feature_gates = value
    end
  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: https://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

#disabled_feature_gatesObject

DisabledFeatureGates specifies a list of experimental feature gates to disable. A feature gate must not appear in both FeatureGates and DisabledFeatureGates.



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

def disabled_feature_gates
  @disabled_feature_gates
end

#disk_verificationObject

Returns the value of attribute disk_verification.



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

def disk_verification
  @disk_verification
end

#feature_gatesObject

FeatureGates specifies a list of experimental feature gates to enable. Defaults to none. A feature gate must not appear in both FeatureGates and DisabledFeatureGates.



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

def feature_gates
  @feature_gates
end

#log_verbosityObject

Returns the value of attribute log_verbosity.



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

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



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

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.



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

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)



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

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



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

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



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

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



51
52
53
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 51

def use_emulation
  @use_emulation
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



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

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



77
78
79
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 77

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 54

def self.attribute_map
  {
    :'cluster_profiler' => :'clusterProfiler',
    :'cpu_allocation_ratio' => :'cpuAllocationRatio',
    :'disabled_feature_gates' => :'disabledFeatureGates',
    :'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



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/kubevirt/models/v1_developer_configuration.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_nullableObject

List of attributes with nullable: true



100
101
102
103
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 100

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

.openapi_typesObject

Attribute type mapping.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 82

def self.openapi_types
  {
    :'cluster_profiler' => :'Boolean',
    :'cpu_allocation_ratio' => :'Integer',
    :'disabled_feature_gates' => :'Array<String>',
    :'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



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 193

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      cluster_profiler == o.cluster_profiler &&
      cpu_allocation_ratio == o.cpu_allocation_ratio &&
      disabled_feature_gates == o.disabled_feature_gates &&
      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


212
213
214
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 212

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



218
219
220
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 218

def hash
  [cluster_profiler, cpu_allocation_ratio, disabled_feature_gates, 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



178
179
180
181
182
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 178

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



247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/kubevirt/models/v1_developer_configuration.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

Returns:

  • (Boolean)

    true if the model is valid



186
187
188
189
# File 'lib/kubevirt/models/v1_developer_configuration.rb', line 186

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