Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ docs/V1CertConfig.md
docs/V1ChangedBlockTrackingSelectors.md
docs/V1ChangedBlockTrackingStatus.md
docs/V1Chassis.md
docs/V1ClaimRequest.md
docs/V1Clock.md
docs/V1ClockOffset.md
docs/V1ClockOffsetUTC.md
Expand Down Expand Up @@ -459,6 +460,7 @@ lib/kubevirt/models/v1_cert_config.rb
lib/kubevirt/models/v1_changed_block_tracking_selectors.rb
lib/kubevirt/models/v1_changed_block_tracking_status.rb
lib/kubevirt/models/v1_chassis.rb
lib/kubevirt/models/v1_claim_request.rb
lib/kubevirt/models/v1_clock.rb
lib/kubevirt/models/v1_clock_offset.rb
lib/kubevirt/models/v1_clock_offset_utc.rb
Expand Down Expand Up @@ -847,6 +849,7 @@ spec/models/v1_cert_config_spec.rb
spec/models/v1_changed_block_tracking_selectors_spec.rb
spec/models/v1_changed_block_tracking_status_spec.rb
spec/models/v1_chassis_spec.rb
spec/models/v1_claim_request_spec.rb
spec/models/v1_clock_offset_spec.rb
spec/models/v1_clock_offset_utc_spec.rb
spec/models/v1_clock_spec.rb
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ Class | Method | HTTP request | Description
- [Kubevirt::V1ChangedBlockTrackingSelectors](docs/V1ChangedBlockTrackingSelectors.md)
- [Kubevirt::V1ChangedBlockTrackingStatus](docs/V1ChangedBlockTrackingStatus.md)
- [Kubevirt::V1Chassis](docs/V1Chassis.md)
- [Kubevirt::V1ClaimRequest](docs/V1ClaimRequest.md)
- [Kubevirt::V1Clock](docs/V1Clock.md)
- [Kubevirt::V1ClockOffset](docs/V1ClockOffset.md)
- [Kubevirt::V1ClockOffsetUTC](docs/V1ClockOffsetUTC.md)
Expand Down
20 changes: 20 additions & 0 deletions docs/V1ClaimRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Kubevirt::V1ClaimRequest

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **claim_name** | **String** | ClaimName references the name of an entry in the VMI's spec.resourceClaims[] array. The referenced entry may use either resourceClaimName or resourceClaimTemplateName. | [optional] |
| **request_name** | **String** | RequestName specifies which request from the ResourceClaim/ResourceClaimTemplate spec.devices.requests array this claim request corresponds to. | [optional] |

## Example

```ruby
require 'kubevirt'

instance = Kubevirt::V1ClaimRequest.new(
claim_name: null,
request_name: null
)
```

4 changes: 3 additions & 1 deletion docs/V1Network.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
| **multus** | [**V1MultusNetwork**](V1MultusNetwork.md) | | [optional] |
| **name** | **String** | Network name. Must be a DNS_LABEL and unique within the vm. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | [default to ''] |
| **pod** | [**V1PodNetwork**](V1PodNetwork.md) | | [optional] |
| **resource_claim** | [**V1ClaimRequest**](V1ClaimRequest.md) | | [optional] |

## Example

Expand All @@ -16,7 +17,8 @@ require 'kubevirt'
instance = Kubevirt::V1Network.new(
multus: null,
name: null,
pod: null
pod: null,
resource_claim: null
)
```

2 changes: 1 addition & 1 deletion docs/V1VirtualMachineInstanceSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
| **node_selector** | **Hash<String, String>** | NodeSelector is a selector which must be true for the vmi to fit on a node. Selector which must match a node's labels for the vmi to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ | [optional] |
| **priority_class_name** | **String** | If specified, indicates the pod's priority. If not specified, the pod priority will be default or zero if there is no default. | [optional] |
| **readiness_probe** | [**V1Probe**](V1Probe.md) | | [optional] |
| **resource_claims** | [**Array<K8sIoApiCoreV1PodResourceClaim>**](K8sIoApiCoreV1PodResourceClaim.md) | ResourceClaims define which ResourceClaims must be allocated and reserved before the VMI, hence virt-launcher pod is allowed to start. The resources will be made available to the domain which consumes them by name. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate in kubernetes https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/ This field should only be configured if one of the feature-gates GPUsWithDRA or HostDevicesWithDRA is enabled. This feature is in alpha. | [optional] |
| **resource_claims** | [**Array<K8sIoApiCoreV1PodResourceClaim>**](K8sIoApiCoreV1PodResourceClaim.md) | ResourceClaims define which ResourceClaims must be allocated and reserved before the VMI, hence virt-launcher pod is allowed to start. The resources will be made available to the domain which consumes them by name. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate in kubernetes https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/ This field should only be configured if one of the feature-gates GPUsWithDRA, HostDevicesWithDRA, or NetworkDevicesWithDRA is enabled. This feature is in alpha. | [optional] |
| **scheduler_name** | **String** | If specified, the VMI will be dispatched by specified scheduler. If not specified, the VMI will be dispatched by default scheduler. | [optional] |
| **start_strategy** | **String** | StartStrategy can be set to \"Paused\" if Virtual Machine should be started in paused state. | [optional] |
| **subdomain** | **String** | If specified, the fully qualified vmi hostname will be \"<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>\". If not specified, the vmi will not have a domainname at all. The DNS entry will resolve to the vmi, no matter if the vmi itself can pick up a hostname. | [optional] |
Expand Down
1 change: 1 addition & 0 deletions lib/kubevirt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
Kubevirt.autoload :V1ChangedBlockTrackingSelectors, 'kubevirt/models/v1_changed_block_tracking_selectors'
Kubevirt.autoload :V1ChangedBlockTrackingStatus, 'kubevirt/models/v1_changed_block_tracking_status'
Kubevirt.autoload :V1Chassis, 'kubevirt/models/v1_chassis'
Kubevirt.autoload :V1ClaimRequest, 'kubevirt/models/v1_claim_request'
Kubevirt.autoload :V1Clock, 'kubevirt/models/v1_clock'
Kubevirt.autoload :V1ClockOffset, 'kubevirt/models/v1_clock_offset'
Kubevirt.autoload :V1ClockOffsetUTC, 'kubevirt/models/v1_clock_offset_utc'
Expand Down
158 changes: 158 additions & 0 deletions lib/kubevirt/models/v1_claim_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
=begin
#KubeVirt API

#This is KubeVirt API an add-on for Kubernetes.

The version of the OpenAPI document: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://openapi-generator.tech
Generator version: 7.22.0

=end

require 'date'
require 'time'

module Kubevirt
class V1ClaimRequest < ApiModelBase
# ClaimName references the name of an entry in the VMI's spec.resourceClaims[] array. The referenced entry may use either resourceClaimName or resourceClaimTemplateName.
attr_accessor :claim_name

# RequestName specifies which request from the ResourceClaim/ResourceClaimTemplate spec.devices.requests array this claim request corresponds to.
attr_accessor :request_name

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'claim_name' => :'claimName',
:'request_name' => :'requestName'
}
end

# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end

# Returns all the JSON keys this model knows about
def self.acceptable_attributes
acceptable_attribute_map.values
end

# Attribute type mapping.
def self.openapi_types
{
:'claim_name' => :'String',
:'request_name' => :'String'
}
end

# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
])
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::V1ClaimRequest` 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::V1ClaimRequest`. 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?(:'claim_name')
self.claim_name = attributes[:'claim_name']
end

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

# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properties with the reasons
def list_invalid_properties
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
invalid_properties = Array.new
invalid_properties
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
true
end

# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
claim_name == o.claim_name &&
request_name == o.request_name
end

# @see the `==` method
# @param [Object] Object to be compared
def eql?(o)
self == o
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[claim_name, request_name].hash
end

# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself
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

# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
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

end

end
17 changes: 13 additions & 4 deletions lib/kubevirt/models/v1_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ class V1Network < ApiModelBase

attr_accessor :pod

attr_accessor :resource_claim

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'multus' => :'multus',
:'name' => :'name',
:'pod' => :'pod'
:'pod' => :'pod',
:'resource_claim' => :'resourceClaim'
}
end

Expand All @@ -47,7 +50,8 @@ def self.openapi_types
{
:'multus' => :'V1MultusNetwork',
:'name' => :'String',
:'pod' => :'V1PodNetwork'
:'pod' => :'V1PodNetwork',
:'resource_claim' => :'V1ClaimRequest'
}
end

Expand Down Expand Up @@ -86,6 +90,10 @@ def initialize(attributes = {})
if attributes.key?(:'pod')
self.pod = attributes[:'pod']
end

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

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -125,7 +133,8 @@ def ==(o)
self.class == o.class &&
multus == o.multus &&
name == o.name &&
pod == o.pod
pod == o.pod &&
resource_claim == o.resource_claim
end

# @see the `==` method
Expand All @@ -137,7 +146,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[multus, name, pod].hash
[multus, name, pod, resource_claim].hash
end

# Builds the object from hash
Expand Down
2 changes: 1 addition & 1 deletion lib/kubevirt/models/v1_virtual_machine_instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class V1VirtualMachineInstanceSpec < ApiModelBase

attr_accessor :readiness_probe

# ResourceClaims define which ResourceClaims must be allocated and reserved before the VMI, hence virt-launcher pod is allowed to start. The resources will be made available to the domain which consumes them by name. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate in kubernetes https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/ This field should only be configured if one of the feature-gates GPUsWithDRA or HostDevicesWithDRA is enabled. This feature is in alpha.
# ResourceClaims define which ResourceClaims must be allocated and reserved before the VMI, hence virt-launcher pod is allowed to start. The resources will be made available to the domain which consumes them by name. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate in kubernetes https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/ This field should only be configured if one of the feature-gates GPUsWithDRA, HostDevicesWithDRA, or NetworkDevicesWithDRA is enabled. This feature is in alpha.
attr_accessor :resource_claims

# If specified, the VMI will be dispatched by specified scheduler. If not specified, the VMI will be dispatched by default scheduler.
Expand Down
42 changes: 42 additions & 0 deletions spec/models/v1_claim_request_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
=begin
#KubeVirt API

#This is KubeVirt API an add-on for Kubernetes.

The version of the OpenAPI document: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://openapi-generator.tech
Generator version: 7.22.0

=end

require 'spec_helper'
require 'json'
require 'date'

# Unit tests for Kubevirt::V1ClaimRequest
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe Kubevirt::V1ClaimRequest do
#let(:instance) { Kubevirt::V1ClaimRequest.new }

describe 'test an instance of V1ClaimRequest' do
it 'should create an instance of V1ClaimRequest' do
# uncomment below to test the instance creation
#expect(instance).to be_instance_of(Kubevirt::V1ClaimRequest)
end
end

describe 'test attribute "claim_name"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
end
end

describe 'test attribute "request_name"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
end
end

end
6 changes: 6 additions & 0 deletions spec/models/v1_network_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@
end
end

describe 'test attribute "resource_claim"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
end
end

end