Class: Kubernetes::V1NodeSystemInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/kubernetes/models/v1_node_system_info.rb

Overview

NodeSystemInfo is a set of ids/uuids to uniquely identify the node.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ V1NodeSystemInfo

Initializes the object



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 82

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.transform_keys(&:to_sym)

  self.architecture = attributes[:architecture] if attributes.key?(:architecture)

  self.boot_id = attributes[:bootID] if attributes.key?(:bootID)

  if attributes.key?(:containerRuntimeVersion)
    self.container_runtime_version = attributes[:containerRuntimeVersion]
  end

  self.kernel_version = attributes[:kernelVersion] if attributes.key?(:kernelVersion)

  self.kube_proxy_version = attributes[:kubeProxyVersion] if attributes.key?(:kubeProxyVersion)

  self.kubelet_version = attributes[:kubeletVersion] if attributes.key?(:kubeletVersion)

  self.machine_id = attributes[:machineID] if attributes.key?(:machineID)

  self.operating_system = attributes[:operatingSystem] if attributes.key?(:operatingSystem)

  self.os_image = attributes[:osImage] if attributes.key?(:osImage)

  self.system_uuid = attributes[:systemUUID] if attributes.key?(:systemUUID)
end

Instance Attribute Details

#architectureObject

The Architecture reported by the node



19
20
21
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 19

def architecture
  @architecture
end

#boot_idObject

Boot ID reported by the node.



22
23
24
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 22

def boot_id
  @boot_id
end

#container_runtime_versionObject

ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0).



25
26
27
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 25

def container_runtime_version
  @container_runtime_version
end

#kernel_versionObject

Kernel Version reported by the node from ‘uname -r’ (e.g. 3.16.0-0.bpo.4-amd64).



28
29
30
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 28

def kernel_version
  @kernel_version
end

#kube_proxy_versionObject

KubeProxy Version reported by the node.



31
32
33
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 31

def kube_proxy_version
  @kube_proxy_version
end

#kubelet_versionObject

Kubelet Version reported by the node.



34
35
36
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 34

def kubelet_version
  @kubelet_version
end

#machine_idObject

MachineID reported by the node. For unique machine identification in the cluster this field is preferred. Learn more from man(5) machine-id: man7.org/linux/man-pages/man5/machine-id.5.html



37
38
39
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 37

def machine_id
  @machine_id
end

#operating_systemObject

The Operating System reported by the node



40
41
42
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 40

def operating_system
  @operating_system
end

#os_imageObject

OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).



43
44
45
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 43

def os_image
  @os_image
end

#system_uuidObject

SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html



46
47
48
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 46

def system_uuid
  @system_uuid
end

Class Method Details

.attribute_mapObject

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



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 49

def self.attribute_map
  {
    architecture: :architecture,
    boot_id: :bootID,
    container_runtime_version: :containerRuntimeVersion,
    kernel_version: :kernelVersion,
    kube_proxy_version: :kubeProxyVersion,
    kubelet_version: :kubeletVersion,
    machine_id: :machineID,
    operating_system: :operatingSystem,
    os_image: :osImage,
    system_uuid: :systemUUID
  }
end

.swagger_typesObject

Attribute type mapping.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 65

def self.swagger_types
  {
    architecture: :String,
    boot_id: :String,
    container_runtime_version: :String,
    kernel_version: :String,
    kube_proxy_version: :String,
    kubelet_version: :String,
    machine_id: :String,
    operating_system: :String,
    os_image: :String,
    system_uuid: :String
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 177

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    architecture == other.architecture &&
    boot_id == other.boot_id &&
    container_runtime_version == other.container_runtime_version &&
    kernel_version == other.kernel_version &&
    kube_proxy_version == other.kube_proxy_version &&
    kubelet_version == other.kubelet_version &&
    machine_id == other.machine_id &&
    operating_system == other.operating_system &&
    os_image == other.os_image &&
    system_uuid == other.system_uuid
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 233

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.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
    temp_model = Kubernetes.const_get(type).new
    temp_model.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



300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 300

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



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 209

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        send("#{key}=", attributes[self.class.attribute_map[key]].map do |v|
                          _deserialize(Regexp.last_match(1), v)
                        end)
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(other) ⇒ Boolean

See Also:

  • `==` method


195
196
197
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 195

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.



201
202
203
204
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 201

def hash
  [architecture, boot_id, container_runtime_version, kernel_version, kube_proxy_version,
   kubelet_version, machine_id, operating_system, os_image, system_uuid].hash
end

#list_invalid_propertiesObject

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



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
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 113

def list_invalid_properties
  invalid_properties = []
  if @architecture.nil?
    invalid_properties.push("invalid value for 'architecture', architecture cannot be nil.")
  end

  if @boot_id.nil?
    invalid_properties.push("invalid value for 'boot_id', boot_id cannot be nil.")
  end

  if @container_runtime_version.nil?
    invalid_properties.push("invalid value for 'container_runtime_version', container_runtime_version cannot be nil.")
  end

  if @kernel_version.nil?
    invalid_properties.push("invalid value for 'kernel_version', kernel_version cannot be nil.")
  end

  if @kube_proxy_version.nil?
    invalid_properties.push("invalid value for 'kube_proxy_version', kube_proxy_version cannot be nil.")
  end

  if @kubelet_version.nil?
    invalid_properties.push("invalid value for 'kubelet_version', kubelet_version cannot be nil.")
  end

  if @machine_id.nil?
    invalid_properties.push("invalid value for 'machine_id', machine_id cannot be nil.")
  end

  if @operating_system.nil?
    invalid_properties.push("invalid value for 'operating_system', operating_system cannot be nil.")
  end

  if @os_image.nil?
    invalid_properties.push("invalid value for 'os_image', os_image cannot be nil.")
  end

  if @system_uuid.nil?
    invalid_properties.push("invalid value for 'system_uuid', system_uuid cannot be nil.")
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)



279
280
281
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 279

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash



285
286
287
288
289
290
291
292
293
294
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 285

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = send(attr)
    next if value.nil?

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object



273
274
275
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 273

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid



160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/kubernetes/models/v1_node_system_info.rb', line 160

def valid?
  return false if @architecture.nil?
  return false if @boot_id.nil?
  return false if @container_runtime_version.nil?
  return false if @kernel_version.nil?
  return false if @kube_proxy_version.nil?
  return false if @kubelet_version.nil?
  return false if @machine_id.nil?
  return false if @operating_system.nil?
  return false if @os_image.nil?
  return false if @system_uuid.nil?

  true
end