Class: Kubevirt::V1InterfaceBindingPlugin

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

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 = {}) ⇒ V1InterfaceBindingPlugin

Initializes the object



76
77
78
79
80
81
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
110
111
112
113
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 76

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

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

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

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

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

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

Instance Attribute Details

#compute_resource_overheadObject

Returns the value of attribute compute_resource_overhead.



18
19
20
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 18

def compute_resource_overhead
  @compute_resource_overhead
end

#domain_attachment_typeObject

DomainAttachmentType is a standard domain network attachment method kubevirt supports. Supported values: "tap", "managedTap" (since v1.4). The standard domain attachment can be used instead or in addition to the sidecarImage. version: 1alphav1



21
22
23
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 21

def domain_attachment_type
  @domain_attachment_type
end

#downward_apiObject

DownwardAPI specifies what kind of data should be exposed to the binding plugin sidecar. Supported values: "device-info" version: v1alphav1



24
25
26
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 24

def downward_api
  @downward_api
end

#migrationObject

Returns the value of attribute migration.



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

def migration
  @migration
end

#network_attachment_definitionObject

NetworkAttachmentDefinition references to a NetworkAttachmentDefinition CR object. Format: <name>, <namespace>/<name>. If namespace is not specified, VMI namespace is assumed. version: 1alphav1



29
30
31
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 29

def network_attachment_definition
  @network_attachment_definition
end

#sidecar_imageObject

SidecarImage references a container image that runs in the virt-launcher pod. The sidecar handles (libvirt) domain configuration and optional services. version: 1alphav1



32
33
34
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 32

def sidecar_image
  @sidecar_image
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



47
48
49
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 47

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



52
53
54
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 52

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



35
36
37
38
39
40
41
42
43
44
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 35

def self.attribute_map
  {
    :'compute_resource_overhead' => :'computeResourceOverhead',
    :'domain_attachment_type' => :'domainAttachmentType',
    :'downward_api' => :'downwardAPI',
    :'migration' => :'migration',
    :'network_attachment_definition' => :'networkAttachmentDefinition',
    :'sidecar_image' => :'sidecarImage'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 158

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



69
70
71
72
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 69

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

.openapi_typesObject

Attribute type mapping.



57
58
59
60
61
62
63
64
65
66
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 57

def self.openapi_types
  {
    :'compute_resource_overhead' => :'V1ResourceRequirementsWithoutClaims',
    :'domain_attachment_type' => :'String',
    :'downward_api' => :'String',
    :'migration' => :'V1InterfaceBindingMigration',
    :'network_attachment_definition' => :'String',
    :'sidecar_image' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.



132
133
134
135
136
137
138
139
140
141
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 132

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      compute_resource_overhead == o.compute_resource_overhead &&
      domain_attachment_type == o.domain_attachment_type &&
      downward_api == o.downward_api &&
      migration == o.migration &&
      network_attachment_definition == o.network_attachment_definition &&
      sidecar_image == o.sidecar_image
end

#eql?(o) ⇒ Boolean

See Also:

  • `==` method


145
146
147
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 145

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.



151
152
153
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 151

def hash
  [compute_resource_overhead, domain_attachment_type, downward_api, migration, network_attachment_definition, sidecar_image].hash
end

#list_invalid_propertiesObject

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



117
118
119
120
121
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 117

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



180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 180

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



125
126
127
128
# File 'lib/kubevirt/models/v1_interface_binding_plugin.rb', line 125

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