Skip to content

Commit 38e9197

Browse files
committed
Merge pull request #36 from miq-bot/openapi_generate
Update kubevirt gem
2 parents eb3ab43 + 47ff508 commit 38e9197

21 files changed

+667
-4
lines changed

.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ docs/V1CPU.md
6464
docs/V1CPUFeature.md
6565
docs/V1CPUTopology.md
6666
docs/V1CertConfig.md
67+
docs/V1ChangedBlockTrackingSelectors.md
68+
docs/V1ChangedBlockTrackingStatus.md
6769
docs/V1Chassis.md
6870
docs/V1Clock.md
6971
docs/V1ClockOffset.md
@@ -427,6 +429,8 @@ lib/kubevirt/models/v1_block_size.rb
427429
lib/kubevirt/models/v1_bootloader.rb
428430
lib/kubevirt/models/v1_cd_rom_target.rb
429431
lib/kubevirt/models/v1_cert_config.rb
432+
lib/kubevirt/models/v1_changed_block_tracking_selectors.rb
433+
lib/kubevirt/models/v1_changed_block_tracking_status.rb
430434
lib/kubevirt/models/v1_chassis.rb
431435
lib/kubevirt/models/v1_clock.rb
432436
lib/kubevirt/models/v1_clock_offset.rb
@@ -788,6 +792,8 @@ spec/models/v1_block_size_spec.rb
788792
spec/models/v1_bootloader_spec.rb
789793
spec/models/v1_cd_rom_target_spec.rb
790794
spec/models/v1_cert_config_spec.rb
795+
spec/models/v1_changed_block_tracking_selectors_spec.rb
796+
spec/models/v1_changed_block_tracking_status_spec.rb
791797
spec/models/v1_chassis_spec.rb
792798
spec/models/v1_clock_offset_spec.rb
793799
spec/models/v1_clock_offset_utc_spec.rb

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,8 @@ Class | Method | HTTP request | Description
411411
- [Kubevirt::V1CPUFeature](docs/V1CPUFeature.md)
412412
- [Kubevirt::V1CPUTopology](docs/V1CPUTopology.md)
413413
- [Kubevirt::V1CertConfig](docs/V1CertConfig.md)
414+
- [Kubevirt::V1ChangedBlockTrackingSelectors](docs/V1ChangedBlockTrackingSelectors.md)
415+
- [Kubevirt::V1ChangedBlockTrackingStatus](docs/V1ChangedBlockTrackingStatus.md)
414416
- [Kubevirt::V1Chassis](docs/V1Chassis.md)
415417
- [Kubevirt::V1Clock](docs/V1Clock.md)
416418
- [Kubevirt::V1ClockOffset](docs/V1ClockOffset.md)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Kubevirt::V1ChangedBlockTrackingSelectors
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **namespace_label_selector** | [**K8sIoApimachineryPkgApisMetaV1LabelSelector**](K8sIoApimachineryPkgApisMetaV1LabelSelector.md) | | [optional] |
8+
| **virtual_machine_label_selector** | [**K8sIoApimachineryPkgApisMetaV1LabelSelector**](K8sIoApimachineryPkgApisMetaV1LabelSelector.md) | | [optional] |
9+
10+
## Example
11+
12+
```ruby
13+
require 'kubevirt'
14+
15+
instance = Kubevirt::V1ChangedBlockTrackingSelectors.new(
16+
namespace_label_selector: null,
17+
virtual_machine_label_selector: null
18+
)
19+
```
20+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Kubevirt::V1ChangedBlockTrackingStatus
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **state** | **String** | State represents the current CBT state | [default to ''] |
8+
9+
## Example
10+
11+
```ruby
12+
require 'kubevirt'
13+
14+
instance = Kubevirt::V1ChangedBlockTrackingStatus.new(
15+
state: null
16+
)
17+
```
18+

docs/V1Disk.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
| **boot_order** | **Integer** | BootOrder is an integer value > 0, used to determine ordering of boot devices. Lower values take precedence. Each disk or interface that has a boot order must have a unique value. Disks without a boot order are not tried if a disk with a boot order exists. | [optional] |
99
| **cache** | **String** | Cache specifies which kvm disk cache mode should be used. Supported values are: none: Guest I/O not cached on the host, but may be kept in a disk cache. writethrough: Guest I/O cached on the host but written through to the physical medium. Slowest but with most guarantees. writeback: Guest I/O cached on the host. Defaults to none if the storage supports O_DIRECT, otherwise writethrough. | [optional] |
1010
| **cdrom** | [**V1CDRomTarget**](V1CDRomTarget.md) | | [optional] |
11+
| **changed_block_tracking** | **Boolean** | ChangedBlockTracking indicates this disk should have CBT option Defaults to false. | [optional] |
1112
| **dedicated_io_thread** | **Boolean** | dedicatedIOThread indicates this disk should have an exclusive IO Thread. Enabling this implies useIOThreads = true. Defaults to false. | [optional] |
1213
| **disk** | [**V1DiskTarget**](V1DiskTarget.md) | | [optional] |
1314
| **error_policy** | **String** | If specified, it can change the default error policy (stop) for the disk | [optional] |
@@ -28,6 +29,7 @@ instance = Kubevirt::V1Disk.new(
2829
boot_order: null,
2930
cache: null,
3031
cdrom: null,
32+
changed_block_tracking: null,
3133
dedicated_io_thread: null,
3234
disk: null,
3335
error_policy: null,

docs/V1KubeVirtConfiguration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
| **api_configuration** | [**V1ReloadableComponentConfiguration**](V1ReloadableComponentConfiguration.md) | | [optional] |
99
| **architecture_configuration** | [**V1ArchConfiguration**](V1ArchConfiguration.md) | | [optional] |
1010
| **auto_cpu_limit_namespace_label_selector** | [**K8sIoApimachineryPkgApisMetaV1LabelSelector**](K8sIoApimachineryPkgApisMetaV1LabelSelector.md) | | [optional] |
11+
| **changed_block_tracking_label_selectors** | [**V1ChangedBlockTrackingSelectors**](V1ChangedBlockTrackingSelectors.md) | | [optional] |
1112
| **common_instancetypes_deployment** | [**V1CommonInstancetypesDeployment**](V1CommonInstancetypesDeployment.md) | | [optional] |
1213
| **controller_configuration** | [**V1ReloadableComponentConfiguration**](V1ReloadableComponentConfiguration.md) | | [optional] |
1314
| **cpu_model** | **String** | | [optional] |
@@ -52,6 +53,7 @@ instance = Kubevirt::V1KubeVirtConfiguration.new(
5253
api_configuration: null,
5354
architecture_configuration: null,
5455
auto_cpu_limit_namespace_label_selector: null,
56+
changed_block_tracking_label_selectors: null,
5557
common_instancetypes_deployment: null,
5658
controller_configuration: null,
5759
cpu_model: null,

docs/V1VirtualMachineInstanceStatus.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| ---- | ---- | ----------- | ----- |
77
| **vsockcid** | **Integer** | VSOCKCID is used to track the allocated VSOCK CID in the VM. | [optional] |
88
| **active_pods** | **Hash<String, String>** | ActivePods is a mapping of pod UID to node name. It is possible for multiple pods to be running for a single VMI during migration. | [optional] |
9+
| **changed_block_tracking** | [**V1ChangedBlockTrackingStatus**](V1ChangedBlockTrackingStatus.md) | | [optional] |
910
| **conditions** | [**Array<V1VirtualMachineInstanceCondition>**](V1VirtualMachineInstanceCondition.md) | Conditions are specific points in VirtualMachineInstance's pod runtime. | [optional] |
1011
| **current_cpu_topology** | [**V1CPUTopology**](V1CPUTopology.md) | | [optional] |
1112
| **device_status** | [**V1DeviceStatus**](V1DeviceStatus.md) | | [optional] |
@@ -40,6 +41,7 @@ require 'kubevirt'
4041
instance = Kubevirt::V1VirtualMachineInstanceStatus.new(
4142
vsockcid: null,
4243
active_pods: null,
44+
changed_block_tracking: null,
4345
conditions: null,
4446
current_cpu_topology: null,
4547
device_status: null,

docs/V1VirtualMachineStatus.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
| Name | Type | Description | Notes |
66
| ---- | ---- | ----------- | ----- |
7+
| **changed_block_tracking** | [**V1ChangedBlockTrackingStatus**](V1ChangedBlockTrackingStatus.md) | | [optional] |
78
| **conditions** | [**Array<V1VirtualMachineCondition>**](V1VirtualMachineCondition.md) | Hold the state information of the VirtualMachine and its VirtualMachineInstance | [optional] |
89
| **created** | **Boolean** | Created indicates if the virtual machine is created in the cluster | [optional] |
910
| **desired_generation** | **Integer** | DesiredGeneration is the generation which is desired for the VMI. This will be used in comparisons with ObservedGeneration to understand when the VMI is out of sync. This will be changed at the same time as ObservedGeneration to remove errors which could occur if Generation is updated through an Update() before ObservedGeneration in Status. | [optional] |
@@ -28,6 +29,7 @@
2829
require 'kubevirt'
2930

3031
instance = Kubevirt::V1VirtualMachineStatus.new(
32+
changed_block_tracking: null,
3133
conditions: null,
3234
created: null,
3335
desired_generation: null,

lib/kubevirt.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
Kubevirt.autoload :V1CPUFeature, 'kubevirt/models/v1_cpu_feature'
7979
Kubevirt.autoload :V1CPUTopology, 'kubevirt/models/v1_cpu_topology'
8080
Kubevirt.autoload :V1CertConfig, 'kubevirt/models/v1_cert_config'
81+
Kubevirt.autoload :V1ChangedBlockTrackingSelectors, 'kubevirt/models/v1_changed_block_tracking_selectors'
82+
Kubevirt.autoload :V1ChangedBlockTrackingStatus, 'kubevirt/models/v1_changed_block_tracking_status'
8183
Kubevirt.autoload :V1Chassis, 'kubevirt/models/v1_chassis'
8284
Kubevirt.autoload :V1Clock, 'kubevirt/models/v1_clock'
8385
Kubevirt.autoload :V1ClockOffset, 'kubevirt/models/v1_clock_offset'
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
=begin
2+
#KubeVirt API
3+
4+
#This is KubeVirt API an add-on for Kubernetes.
5+
6+
The version of the OpenAPI document: 1.0.0
7+
8+
Generated by: https://openapi-generator.tech
9+
Generator version: 7.15.0
10+
11+
=end
12+
13+
require 'date'
14+
require 'time'
15+
16+
module Kubevirt
17+
class V1ChangedBlockTrackingSelectors
18+
attr_accessor :namespace_label_selector
19+
20+
attr_accessor :virtual_machine_label_selector
21+
22+
# Attribute mapping from ruby-style variable name to JSON key.
23+
def self.attribute_map
24+
{
25+
:'namespace_label_selector' => :'namespaceLabelSelector',
26+
:'virtual_machine_label_selector' => :'virtualMachineLabelSelector'
27+
}
28+
end
29+
30+
# Returns attribute mapping this model knows about
31+
def self.acceptable_attribute_map
32+
attribute_map
33+
end
34+
35+
# Returns all the JSON keys this model knows about
36+
def self.acceptable_attributes
37+
acceptable_attribute_map.values
38+
end
39+
40+
# Attribute type mapping.
41+
def self.openapi_types
42+
{
43+
:'namespace_label_selector' => :'K8sIoApimachineryPkgApisMetaV1LabelSelector',
44+
:'virtual_machine_label_selector' => :'K8sIoApimachineryPkgApisMetaV1LabelSelector'
45+
}
46+
end
47+
48+
# List of attributes with nullable: true
49+
def self.openapi_nullable
50+
Set.new([
51+
])
52+
end
53+
54+
# Initializes the object
55+
# @param [Hash] attributes Model attributes in the form of hash
56+
def initialize(attributes = {})
57+
if (!attributes.is_a?(Hash))
58+
fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::V1ChangedBlockTrackingSelectors` initialize method"
59+
end
60+
61+
# check to see if the attribute exists and convert string to symbol for hash key
62+
acceptable_attribute_map = self.class.acceptable_attribute_map
63+
attributes = attributes.each_with_object({}) { |(k, v), h|
64+
if (!acceptable_attribute_map.key?(k.to_sym))
65+
fail ArgumentError, "`#{k}` is not a valid attribute in `Kubevirt::V1ChangedBlockTrackingSelectors`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66+
end
67+
h[k.to_sym] = v
68+
}
69+
70+
if attributes.key?(:'namespace_label_selector')
71+
self.namespace_label_selector = attributes[:'namespace_label_selector']
72+
end
73+
74+
if attributes.key?(:'virtual_machine_label_selector')
75+
self.virtual_machine_label_selector = attributes[:'virtual_machine_label_selector']
76+
end
77+
end
78+
79+
# Show invalid properties with the reasons. Usually used together with valid?
80+
# @return Array for valid properties with the reasons
81+
def list_invalid_properties
82+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83+
invalid_properties = Array.new
84+
invalid_properties
85+
end
86+
87+
# Check to see if the all the properties in the model are valid
88+
# @return true if the model is valid
89+
def valid?
90+
warn '[DEPRECATED] the `valid?` method is obsolete'
91+
true
92+
end
93+
94+
# Checks equality by comparing each attribute.
95+
# @param [Object] Object to be compared
96+
def ==(o)
97+
return true if self.equal?(o)
98+
self.class == o.class &&
99+
namespace_label_selector == o.namespace_label_selector &&
100+
virtual_machine_label_selector == o.virtual_machine_label_selector
101+
end
102+
103+
# @see the `==` method
104+
# @param [Object] Object to be compared
105+
def eql?(o)
106+
self == o
107+
end
108+
109+
# Calculates hash code according to all attributes.
110+
# @return [Integer] Hash code
111+
def hash
112+
[namespace_label_selector, virtual_machine_label_selector].hash
113+
end
114+
115+
# Builds the object from hash
116+
# @param [Hash] attributes Model attributes in the form of hash
117+
# @return [Object] Returns the model itself
118+
def self.build_from_hash(attributes)
119+
return nil unless attributes.is_a?(Hash)
120+
attributes = attributes.transform_keys(&:to_sym)
121+
transformed_hash = {}
122+
openapi_types.each_pair do |key, type|
123+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124+
transformed_hash["#{key}"] = nil
125+
elsif type =~ /\AArray<(.*)>/i
126+
# check to ensure the input is an array given that the attribute
127+
# is documented as an array but the input is not
128+
if attributes[attribute_map[key]].is_a?(Array)
129+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130+
end
131+
elsif !attributes[attribute_map[key]].nil?
132+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133+
end
134+
end
135+
new(transformed_hash)
136+
end
137+
138+
# Deserializes the data based on type
139+
# @param string type Data type
140+
# @param string value Value to be deserialized
141+
# @return [Object] Deserialized data
142+
def self._deserialize(type, value)
143+
case type.to_sym
144+
when :Time
145+
Time.parse(value)
146+
when :Date
147+
Date.parse(value)
148+
when :String
149+
value.to_s
150+
when :Integer
151+
value.to_i
152+
when :Float
153+
value.to_f
154+
when :Boolean
155+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156+
true
157+
else
158+
false
159+
end
160+
when :Object
161+
# generic object (usually a Hash), return directly
162+
value
163+
when /\AArray<(?<inner_type>.+)>\z/
164+
inner_type = Regexp.last_match[:inner_type]
165+
value.map { |v| _deserialize(inner_type, v) }
166+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167+
k_type = Regexp.last_match[:k_type]
168+
v_type = Regexp.last_match[:v_type]
169+
{}.tap do |hash|
170+
value.each do |k, v|
171+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172+
end
173+
end
174+
else # model
175+
# models (e.g. Pet) or oneOf
176+
klass = Kubevirt.const_get(type)
177+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178+
end
179+
end
180+
181+
# Returns the string representation of the object
182+
# @return [String] String presentation of the object
183+
def to_s
184+
to_hash.to_s
185+
end
186+
187+
# to_body is an alias to to_hash (backward compatibility)
188+
# @return [Hash] Returns the object in the form of hash
189+
def to_body
190+
to_hash
191+
end
192+
193+
# Returns the object in the form of hash
194+
# @return [Hash] Returns the object in the form of hash
195+
def to_hash
196+
hash = {}
197+
self.class.attribute_map.each_pair do |attr, param|
198+
value = self.send(attr)
199+
if value.nil?
200+
is_nullable = self.class.openapi_nullable.include?(attr)
201+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202+
end
203+
204+
hash[param] = _to_hash(value)
205+
end
206+
hash
207+
end
208+
209+
# Outputs non-array value in the form of hash
210+
# For object, use to_hash. Otherwise, just return the value
211+
# @param [Object] value Any valid value
212+
# @return [Hash] Returns the value in the form of hash
213+
def _to_hash(value)
214+
if value.is_a?(Array)
215+
value.compact.map { |v| _to_hash(v) }
216+
elsif value.is_a?(Hash)
217+
{}.tap do |hash|
218+
value.each { |k, v| hash[k] = _to_hash(v) }
219+
end
220+
elsif value.respond_to? :to_hash
221+
value.to_hash
222+
else
223+
value
224+
end
225+
end
226+
227+
end
228+
229+
end

0 commit comments

Comments
 (0)