runtime: clh: Re-generate the client code

This patch re-generates the client code for Cloud Hypervisor v30.0.
Note: The client code of cloud-hypervisor's OpenAPI is automatically
generated by openapi-generator.

Fixes: #6375

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2023-02-24 10:20:29 -08:00
parent 262daaa2ef
commit 3ac6f29e95
4 changed files with 34 additions and 52 deletions

View File

@ -1131,6 +1131,9 @@ components:
items: items:
type: integer type: integer
type: array type: array
required:
- host_cpus
- vcpu
type: object type: object
CpuFeatures: CpuFeatures:
example: example:

View File

@ -4,14 +4,14 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Vcpu** | Pointer to **int32** | | [optional] **Vcpu** | **int32** | |
**HostCpus** | Pointer to **[]int32** | | [optional] **HostCpus** | **[]int32** | |
## Methods ## Methods
### NewCpuAffinity ### NewCpuAffinity
`func NewCpuAffinity() *CpuAffinity` `func NewCpuAffinity(vcpu int32, hostCpus []int32, ) *CpuAffinity`
NewCpuAffinity instantiates a new CpuAffinity object NewCpuAffinity instantiates a new CpuAffinity object
This constructor will assign default values to properties that have it defined, This constructor will assign default values to properties that have it defined,
@ -45,11 +45,6 @@ and a boolean to check if the value has been set.
SetVcpu sets Vcpu field to given value. SetVcpu sets Vcpu field to given value.
### HasVcpu
`func (o *CpuAffinity) HasVcpu() bool`
HasVcpu returns a boolean if a field has been set.
### GetHostCpus ### GetHostCpus
@ -70,11 +65,6 @@ and a boolean to check if the value has been set.
SetHostCpus sets HostCpus field to given value. SetHostCpus sets HostCpus field to given value.
### HasHostCpus
`func (o *CpuAffinity) HasHostCpus() bool`
HasHostCpus returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -16,16 +16,18 @@ import (
// CpuAffinity struct for CpuAffinity // CpuAffinity struct for CpuAffinity
type CpuAffinity struct { type CpuAffinity struct {
Vcpu *int32 `json:"vcpu,omitempty"` Vcpu int32 `json:"vcpu"`
HostCpus *[]int32 `json:"host_cpus,omitempty"` HostCpus []int32 `json:"host_cpus"`
} }
// NewCpuAffinity instantiates a new CpuAffinity object // NewCpuAffinity instantiates a new CpuAffinity object
// This constructor will assign default values to properties that have it defined, // This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments // and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed // will change when the set of required properties is changed
func NewCpuAffinity() *CpuAffinity { func NewCpuAffinity(vcpu int32, hostCpus []int32) *CpuAffinity {
this := CpuAffinity{} this := CpuAffinity{}
this.Vcpu = vcpu
this.HostCpus = hostCpus
return &this return &this
} }
@ -37,76 +39,60 @@ func NewCpuAffinityWithDefaults() *CpuAffinity {
return &this return &this
} }
// GetVcpu returns the Vcpu field value if set, zero value otherwise. // GetVcpu returns the Vcpu field value
func (o *CpuAffinity) GetVcpu() int32 { func (o *CpuAffinity) GetVcpu() int32 {
if o == nil || o.Vcpu == nil { if o == nil {
var ret int32 var ret int32
return ret return ret
} }
return *o.Vcpu
return o.Vcpu
} }
// GetVcpuOk returns a tuple with the Vcpu field value if set, nil otherwise // GetVcpuOk returns a tuple with the Vcpu field value
// and a boolean to check if the value has been set. // and a boolean to check if the value has been set.
func (o *CpuAffinity) GetVcpuOk() (*int32, bool) { func (o *CpuAffinity) GetVcpuOk() (*int32, bool) {
if o == nil || o.Vcpu == nil { if o == nil {
return nil, false return nil, false
} }
return o.Vcpu, true return &o.Vcpu, true
} }
// HasVcpu returns a boolean if a field has been set. // SetVcpu sets field value
func (o *CpuAffinity) HasVcpu() bool {
if o != nil && o.Vcpu != nil {
return true
}
return false
}
// SetVcpu gets a reference to the given int32 and assigns it to the Vcpu field.
func (o *CpuAffinity) SetVcpu(v int32) { func (o *CpuAffinity) SetVcpu(v int32) {
o.Vcpu = &v o.Vcpu = v
} }
// GetHostCpus returns the HostCpus field value if set, zero value otherwise. // GetHostCpus returns the HostCpus field value
func (o *CpuAffinity) GetHostCpus() []int32 { func (o *CpuAffinity) GetHostCpus() []int32 {
if o == nil || o.HostCpus == nil { if o == nil {
var ret []int32 var ret []int32
return ret return ret
} }
return *o.HostCpus
return o.HostCpus
} }
// GetHostCpusOk returns a tuple with the HostCpus field value if set, nil otherwise // GetHostCpusOk returns a tuple with the HostCpus field value
// and a boolean to check if the value has been set. // and a boolean to check if the value has been set.
func (o *CpuAffinity) GetHostCpusOk() (*[]int32, bool) { func (o *CpuAffinity) GetHostCpusOk() (*[]int32, bool) {
if o == nil || o.HostCpus == nil { if o == nil {
return nil, false return nil, false
} }
return o.HostCpus, true return &o.HostCpus, true
} }
// HasHostCpus returns a boolean if a field has been set. // SetHostCpus sets field value
func (o *CpuAffinity) HasHostCpus() bool {
if o != nil && o.HostCpus != nil {
return true
}
return false
}
// SetHostCpus gets a reference to the given []int32 and assigns it to the HostCpus field.
func (o *CpuAffinity) SetHostCpus(v []int32) { func (o *CpuAffinity) SetHostCpus(v []int32) {
o.HostCpus = &v o.HostCpus = v
} }
func (o CpuAffinity) MarshalJSON() ([]byte, error) { func (o CpuAffinity) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{} toSerialize := map[string]interface{}{}
if o.Vcpu != nil { if true {
toSerialize["vcpu"] = o.Vcpu toSerialize["vcpu"] = o.Vcpu
} }
if o.HostCpus != nil { if true {
toSerialize["host_cpus"] = o.HostCpus toSerialize["host_cpus"] = o.HostCpus
} }
return json.Marshal(toSerialize) return json.Marshal(toSerialize)

View File

@ -578,6 +578,9 @@ components:
description: Virtual machine configuration description: Virtual machine configuration
CpuAffinity: CpuAffinity:
required:
- vcpu
- host_cpus
type: object type: object
properties: properties:
vcpu: vcpu: