runtime: clh: Re-generate the client code

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

Fixes: #5683

Signed-off-by: Bo Chen <chen.bo@intel.com>
(cherry picked from commit 36545aa81a)
This commit is contained in:
Bo Chen 2022-11-17 09:21:40 -08:00 committed by Fabiano Fidêncio
parent 4d6ca7623a
commit 9cf1af873b
11 changed files with 396 additions and 64 deletions

View File

@ -33,6 +33,7 @@ docs/RngConfig.md
docs/SendMigrationData.md
docs/SgxEpcConfig.md
docs/TokenBucket.md
docs/TpmConfig.md
docs/VdpaConfig.md
docs/VmConfig.md
docs/VmCoredumpData.md
@ -72,6 +73,7 @@ model_rng_config.go
model_send_migration_data.go
model_sgx_epc_config.go
model_token_bucket.go
model_tpm_config.go
model_vdpa_config.go
model_vm_config.go
model_vm_coredump_data.go

View File

@ -135,6 +135,7 @@ Class | Method | HTTP request | Description
- [SendMigrationData](docs/SendMigrationData.md)
- [SgxEpcConfig](docs/SgxEpcConfig.md)
- [TokenBucket](docs/TokenBucket.md)
- [TpmConfig](docs/TpmConfig.md)
- [VdpaConfig](docs/VdpaConfig.md)
- [VmConfig](docs/VmConfig.md)
- [VmCoredumpData](docs/VmCoredumpData.md)

View File

@ -469,6 +469,7 @@ components:
hotplug_size: 7
hotplug_size: 4
hotplug_method: Acpi
thp: true
disks:
- pci_segment: 8
path: path
@ -620,6 +621,8 @@ components:
tdx: false
serial_number: serial_number
uuid: uuid
tpm:
socket: socket
pmem:
- pci_segment: 6
file: file
@ -828,6 +831,7 @@ components:
hotplug_size: 7
hotplug_size: 4
hotplug_method: Acpi
thp: true
disks:
- pci_segment: 8
path: path
@ -979,6 +983,8 @@ components:
tdx: false
serial_number: serial_number
uuid: uuid
tpm:
socket: socket
pmem:
- pci_segment: 6
file: file
@ -1107,6 +1113,8 @@ components:
type: boolean
platform:
$ref: '#/components/schemas/PlatformConfig'
tpm:
$ref: '#/components/schemas/TpmConfig'
required:
- payload
type: object
@ -1311,6 +1319,7 @@ components:
hotplug_size: 7
hotplug_size: 4
hotplug_method: Acpi
thp: true
properties:
size:
format: int64
@ -1339,6 +1348,9 @@ components:
prefault:
default: false
type: boolean
thp:
default: true
type: boolean
zones:
items:
$ref: '#/components/schemas/MemoryZoneConfig'
@ -1651,6 +1663,15 @@ components:
required:
- path
type: object
TpmConfig:
example:
socket: socket
properties:
socket:
type: string
required:
- socket
type: object
VdpaConfig:
example:
pci_segment: 7

View File

@ -860,6 +860,7 @@ func (a *DefaultApiService) VmAddDevicePut(ctx _context.Context) ApiVmAddDeviceP
}
// Execute executes the request
//
// @return PciDeviceInfo
func (a *DefaultApiService) VmAddDevicePutExecute(r ApiVmAddDevicePutRequest) (PciDeviceInfo, *_nethttp.Response, error) {
var (
@ -971,6 +972,7 @@ func (a *DefaultApiService) VmAddDiskPut(ctx _context.Context) ApiVmAddDiskPutRe
}
// Execute executes the request
//
// @return PciDeviceInfo
func (a *DefaultApiService) VmAddDiskPutExecute(r ApiVmAddDiskPutRequest) (PciDeviceInfo, *_nethttp.Response, error) {
var (
@ -1082,6 +1084,7 @@ func (a *DefaultApiService) VmAddFsPut(ctx _context.Context) ApiVmAddFsPutReques
}
// Execute executes the request
//
// @return PciDeviceInfo
func (a *DefaultApiService) VmAddFsPutExecute(r ApiVmAddFsPutRequest) (PciDeviceInfo, *_nethttp.Response, error) {
var (
@ -1193,6 +1196,7 @@ func (a *DefaultApiService) VmAddNetPut(ctx _context.Context) ApiVmAddNetPutRequ
}
// Execute executes the request
//
// @return PciDeviceInfo
func (a *DefaultApiService) VmAddNetPutExecute(r ApiVmAddNetPutRequest) (PciDeviceInfo, *_nethttp.Response, error) {
var (
@ -1304,6 +1308,7 @@ func (a *DefaultApiService) VmAddPmemPut(ctx _context.Context) ApiVmAddPmemPutRe
}
// Execute executes the request
//
// @return PciDeviceInfo
func (a *DefaultApiService) VmAddPmemPutExecute(r ApiVmAddPmemPutRequest) (PciDeviceInfo, *_nethttp.Response, error) {
var (
@ -1415,6 +1420,7 @@ func (a *DefaultApiService) VmAddVdpaPut(ctx _context.Context) ApiVmAddVdpaPutRe
}
// Execute executes the request
//
// @return PciDeviceInfo
func (a *DefaultApiService) VmAddVdpaPutExecute(r ApiVmAddVdpaPutRequest) (PciDeviceInfo, *_nethttp.Response, error) {
var (
@ -1526,6 +1532,7 @@ func (a *DefaultApiService) VmAddVsockPut(ctx _context.Context) ApiVmAddVsockPut
}
// Execute executes the request
//
// @return PciDeviceInfo
func (a *DefaultApiService) VmAddVsockPutExecute(r ApiVmAddVsockPutRequest) (PciDeviceInfo, *_nethttp.Response, error) {
var (
@ -1730,6 +1737,7 @@ func (a *DefaultApiService) VmCountersGet(ctx _context.Context) ApiVmCountersGet
}
// Execute executes the request
//
// @return map[string]map[string]int64
func (a *DefaultApiService) VmCountersGetExecute(r ApiVmCountersGetRequest) (map[string]map[string]int64, *_nethttp.Response, error) {
var (
@ -1829,6 +1837,7 @@ func (a *DefaultApiService) VmInfoGet(ctx _context.Context) ApiVmInfoGetRequest
}
// Execute executes the request
//
// @return VmInfo
func (a *DefaultApiService) VmInfoGetExecute(r ApiVmInfoGetRequest) (VmInfo, *_nethttp.Response, error) {
var (
@ -2628,6 +2637,7 @@ func (a *DefaultApiService) VmmPingGet(ctx _context.Context) ApiVmmPingGetReques
}
// Execute executes the request
//
// @return VmmPingResponse
func (a *DefaultApiService) VmmPingGetExecute(r ApiVmmPingGetRequest) (VmmPingResponse, *_nethttp.Response, error) {
var (

View File

@ -13,6 +13,7 @@ Name | Type | Description | Notes
**Hugepages** | Pointer to **bool** | | [optional] [default to false]
**HugepageSize** | Pointer to **int64** | | [optional]
**Prefault** | Pointer to **bool** | | [optional] [default to false]
**Thp** | Pointer to **bool** | | [optional] [default to true]
**Zones** | Pointer to [**[]MemoryZoneConfig**](MemoryZoneConfig.md) | | [optional]
## Methods
@ -254,6 +255,31 @@ SetPrefault sets Prefault field to given value.
HasPrefault returns a boolean if a field has been set.
### GetThp
`func (o *MemoryConfig) GetThp() bool`
GetThp returns the Thp field if non-nil, zero value otherwise.
### GetThpOk
`func (o *MemoryConfig) GetThpOk() (*bool, bool)`
GetThpOk returns a tuple with the Thp field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetThp
`func (o *MemoryConfig) SetThp(v bool)`
SetThp sets Thp field to given value.
### HasThp
`func (o *MemoryConfig) HasThp() bool`
HasThp returns a boolean if a field has been set.
### GetZones
`func (o *MemoryConfig) GetZones() []MemoryZoneConfig`

View File

@ -0,0 +1,51 @@
# TpmConfig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Socket** | **string** | |
## Methods
### NewTpmConfig
`func NewTpmConfig(socket string, ) *TpmConfig`
NewTpmConfig instantiates a new TpmConfig object
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
will change when the set of required properties is changed
### NewTpmConfigWithDefaults
`func NewTpmConfigWithDefaults() *TpmConfig`
NewTpmConfigWithDefaults instantiates a new TpmConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetSocket
`func (o *TpmConfig) GetSocket() string`
GetSocket returns the Socket field if non-nil, zero value otherwise.
### GetSocketOk
`func (o *TpmConfig) GetSocketOk() (*string, bool)`
GetSocketOk returns a tuple with the Socket field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSocket
`func (o *TpmConfig) SetSocket(v string)`
SetSocket sets Socket field to given value.
[[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

@ -23,6 +23,7 @@ Name | Type | Description | Notes
**Iommu** | Pointer to **bool** | | [optional] [default to false]
**Watchdog** | Pointer to **bool** | | [optional] [default to false]
**Platform** | Pointer to [**PlatformConfig**](PlatformConfig.md) | | [optional]
**Tpm** | Pointer to [**TpmConfig**](TpmConfig.md) | | [optional]
## Methods
@ -513,6 +514,31 @@ SetPlatform sets Platform field to given value.
HasPlatform returns a boolean if a field has been set.
### GetTpm
`func (o *VmConfig) GetTpm() TpmConfig`
GetTpm returns the Tpm field if non-nil, zero value otherwise.
### GetTpmOk
`func (o *VmConfig) GetTpmOk() (*TpmConfig, bool)`
GetTpmOk returns a tuple with the Tpm field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetTpm
`func (o *VmConfig) SetTpm(v TpmConfig)`
SetTpm sets Tpm field to given value.
### HasTpm
`func (o *VmConfig) HasTpm() bool`
HasTpm 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)

View File

@ -25,6 +25,7 @@ type MemoryConfig struct {
Hugepages *bool `json:"hugepages,omitempty"`
HugepageSize *int64 `json:"hugepage_size,omitempty"`
Prefault *bool `json:"prefault,omitempty"`
Thp *bool `json:"thp,omitempty"`
Zones *[]MemoryZoneConfig `json:"zones,omitempty"`
}
@ -45,6 +46,8 @@ func NewMemoryConfig(size int64) *MemoryConfig {
this.Hugepages = &hugepages
var prefault bool = false
this.Prefault = &prefault
var thp bool = true
this.Thp = &thp
return &this
}
@ -63,6 +66,8 @@ func NewMemoryConfigWithDefaults() *MemoryConfig {
this.Hugepages = &hugepages
var prefault bool = false
this.Prefault = &prefault
var thp bool = true
this.Thp = &thp
return &this
}
@ -346,6 +351,38 @@ func (o *MemoryConfig) SetPrefault(v bool) {
o.Prefault = &v
}
// GetThp returns the Thp field value if set, zero value otherwise.
func (o *MemoryConfig) GetThp() bool {
if o == nil || o.Thp == nil {
var ret bool
return ret
}
return *o.Thp
}
// GetThpOk returns a tuple with the Thp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemoryConfig) GetThpOk() (*bool, bool) {
if o == nil || o.Thp == nil {
return nil, false
}
return o.Thp, true
}
// HasThp returns a boolean if a field has been set.
func (o *MemoryConfig) HasThp() bool {
if o != nil && o.Thp != nil {
return true
}
return false
}
// SetThp gets a reference to the given bool and assigns it to the Thp field.
func (o *MemoryConfig) SetThp(v bool) {
o.Thp = &v
}
// GetZones returns the Zones field value if set, zero value otherwise.
func (o *MemoryConfig) GetZones() []MemoryZoneConfig {
if o == nil || o.Zones == nil {
@ -407,6 +444,9 @@ func (o MemoryConfig) MarshalJSON() ([]byte, error) {
if o.Prefault != nil {
toSerialize["prefault"] = o.Prefault
}
if o.Thp != nil {
toSerialize["thp"] = o.Thp
}
if o.Zones != nil {
toSerialize["zones"] = o.Zones
}

View File

@ -0,0 +1,106 @@
/*
Cloud Hypervisor API
Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
API version: 0.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// TpmConfig struct for TpmConfig
type TpmConfig struct {
Socket string `json:"socket"`
}
// NewTpmConfig instantiates a new TpmConfig object
// 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
// will change when the set of required properties is changed
func NewTpmConfig(socket string) *TpmConfig {
this := TpmConfig{}
this.Socket = socket
return &this
}
// NewTpmConfigWithDefaults instantiates a new TpmConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTpmConfigWithDefaults() *TpmConfig {
this := TpmConfig{}
return &this
}
// GetSocket returns the Socket field value
func (o *TpmConfig) GetSocket() string {
if o == nil {
var ret string
return ret
}
return o.Socket
}
// GetSocketOk returns a tuple with the Socket field value
// and a boolean to check if the value has been set.
func (o *TpmConfig) GetSocketOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Socket, true
}
// SetSocket sets field value
func (o *TpmConfig) SetSocket(v string) {
o.Socket = v
}
func (o TpmConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["socket"] = o.Socket
}
return json.Marshal(toSerialize)
}
type NullableTpmConfig struct {
value *TpmConfig
isSet bool
}
func (v NullableTpmConfig) Get() *TpmConfig {
return v.value
}
func (v *NullableTpmConfig) Set(val *TpmConfig) {
v.value = val
v.isSet = true
}
func (v NullableTpmConfig) IsSet() bool {
return v.isSet
}
func (v *NullableTpmConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTpmConfig(val *TpmConfig) *NullableTpmConfig {
return &NullableTpmConfig{value: val, isSet: true}
}
func (v NullableTpmConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTpmConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -35,6 +35,7 @@ type VmConfig struct {
Iommu *bool `json:"iommu,omitempty"`
Watchdog *bool `json:"watchdog,omitempty"`
Platform *PlatformConfig `json:"platform,omitempty"`
Tpm *TpmConfig `json:"tpm,omitempty"`
}
// NewVmConfig instantiates a new VmConfig object
@ -663,6 +664,38 @@ func (o *VmConfig) SetPlatform(v PlatformConfig) {
o.Platform = &v
}
// GetTpm returns the Tpm field value if set, zero value otherwise.
func (o *VmConfig) GetTpm() TpmConfig {
if o == nil || o.Tpm == nil {
var ret TpmConfig
return ret
}
return *o.Tpm
}
// GetTpmOk returns a tuple with the Tpm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VmConfig) GetTpmOk() (*TpmConfig, bool) {
if o == nil || o.Tpm == nil {
return nil, false
}
return o.Tpm, true
}
// HasTpm returns a boolean if a field has been set.
func (o *VmConfig) HasTpm() bool {
if o != nil && o.Tpm != nil {
return true
}
return false
}
// SetTpm gets a reference to the given TpmConfig and assigns it to the Tpm field.
func (o *VmConfig) SetTpm(v TpmConfig) {
o.Tpm = &v
}
func (o VmConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Cpus != nil {
@ -722,6 +755,9 @@ func (o VmConfig) MarshalJSON() ([]byte, error) {
if o.Platform != nil {
toSerialize["platform"] = o.Platform
}
if o.Tpm != nil {
toSerialize["tpm"] = o.Tpm
}
return json.Marshal(toSerialize)
}

View File

@ -573,6 +573,8 @@ components:
default: false
platform:
$ref: "#/components/schemas/PlatformConfig"
tpm:
$ref: "#/components/schemas/TpmConfig"
description: Virtual machine configuration
CpuAffinity:
@ -726,6 +728,9 @@ components:
prefault:
type: boolean
default: false
thp:
type: boolean
default: true
zones:
type: array
items:
@ -955,6 +960,14 @@ components:
id:
type: string
TpmConfig:
required:
- socket
type: object
properties:
socket:
type: string
VdpaConfig:
required:
- path