From 1408566cf9fdbb431c92ddfb7ad919a52a6381a0 Mon Sep 17 00:00:00 2001 From: apecloud-bot Date: Mon, 20 Jan 2025 06:46:50 +0000 Subject: [PATCH] chore: auto update client api https://github.com/apecloud/apecloud/commit/9d6d9a386e186daede9deb366e3c06de8aae0ad8 --- .generator/schemas/adminapi.yaml | 4 +- apecloud | 2 +- .../admin/model_node_resource_stats.go | 46 ++++++++++-- api/kbcloud/admin/model_resource_stats.go | 72 ++++++++++--------- 4 files changed, 84 insertions(+), 40 deletions(-) diff --git a/.generator/schemas/adminapi.yaml b/.generator/schemas/adminapi.yaml index 7efee26f..468dbefb 100644 --- a/.generator/schemas/adminapi.yaml +++ b/.generator/schemas/adminapi.yaml @@ -17094,8 +17094,6 @@ components: format: double type: number required: - - limits - - requests - usage type: object node: @@ -18087,6 +18085,8 @@ components: $ref: '#/components/schemas/resourceStats' memoryStats: $ref: '#/components/schemas/resourceStats' + filesystemStats: + $ref: '#/components/schemas/resourceStats' name: description: Name of the node. type: string diff --git a/apecloud b/apecloud index 58983435..9d6d9a38 160000 --- a/apecloud +++ b/apecloud @@ -1 +1 @@ -Subproject commit 5898343505524e776aef170f61e8dba81334bde6 +Subproject commit 9d6d9a386e186daede9deb366e3c06de8aae0ad8 diff --git a/api/kbcloud/admin/model_node_resource_stats.go b/api/kbcloud/admin/model_node_resource_stats.go index 7d89a850..9105e115 100644 --- a/api/kbcloud/admin/model_node_resource_stats.go +++ b/api/kbcloud/admin/model_node_resource_stats.go @@ -16,6 +16,8 @@ type NodeResourceStats struct { CpuStats ResourceStats `json:"cpuStats"` // ResourceStats holds the requests, limits, and available stats for a resource. MemoryStats ResourceStats `json:"memoryStats"` + // ResourceStats holds the requests, limits, and available stats for a resource. + FilesystemStats *ResourceStats `json:"filesystemStats,omitempty"` // Name of the node. Name string `json:"name"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -89,6 +91,34 @@ func (o *NodeResourceStats) SetMemoryStats(v ResourceStats) { o.MemoryStats = v } +// GetFilesystemStats returns the FilesystemStats field value if set, zero value otherwise. +func (o *NodeResourceStats) GetFilesystemStats() ResourceStats { + if o == nil || o.FilesystemStats == nil { + var ret ResourceStats + return ret + } + return *o.FilesystemStats +} + +// GetFilesystemStatsOk returns a tuple with the FilesystemStats field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeResourceStats) GetFilesystemStatsOk() (*ResourceStats, bool) { + if o == nil || o.FilesystemStats == nil { + return nil, false + } + return o.FilesystemStats, true +} + +// HasFilesystemStats returns a boolean if a field has been set. +func (o *NodeResourceStats) HasFilesystemStats() bool { + return o != nil && o.FilesystemStats != nil +} + +// SetFilesystemStats gets a reference to the given ResourceStats and assigns it to the FilesystemStats field. +func (o *NodeResourceStats) SetFilesystemStats(v ResourceStats) { + o.FilesystemStats = &v +} + // GetName returns the Name field value. func (o *NodeResourceStats) GetName() string { if o == nil { @@ -120,6 +150,9 @@ func (o NodeResourceStats) MarshalJSON() ([]byte, error) { } toSerialize["cpuStats"] = o.CpuStats toSerialize["memoryStats"] = o.MemoryStats + if o.FilesystemStats != nil { + toSerialize["filesystemStats"] = o.FilesystemStats + } toSerialize["name"] = o.Name for key, value := range o.AdditionalProperties { @@ -131,9 +164,10 @@ func (o NodeResourceStats) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *NodeResourceStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CpuStats *ResourceStats `json:"cpuStats"` - MemoryStats *ResourceStats `json:"memoryStats"` - Name *string `json:"name"` + CpuStats *ResourceStats `json:"cpuStats"` + MemoryStats *ResourceStats `json:"memoryStats"` + FilesystemStats *ResourceStats `json:"filesystemStats,omitempty"` + Name *string `json:"name"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return err @@ -149,7 +183,7 @@ func (o *NodeResourceStats) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = common.Unmarshal(bytes, &additionalProperties); err == nil { - common.DeleteKeys(additionalProperties, &[]string{"cpuStats", "memoryStats", "name"}) + common.DeleteKeys(additionalProperties, &[]string{"cpuStats", "memoryStats", "filesystemStats", "name"}) } else { return err } @@ -163,6 +197,10 @@ func (o *NodeResourceStats) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField = true } o.MemoryStats = *all.MemoryStats + if all.FilesystemStats != nil && all.FilesystemStats.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.FilesystemStats = all.FilesystemStats o.Name = *all.Name if len(additionalProperties) > 0 { diff --git a/api/kbcloud/admin/model_resource_stats.go b/api/kbcloud/admin/model_resource_stats.go index 7e2781fc..0a2d7349 100644 --- a/api/kbcloud/admin/model_resource_stats.go +++ b/api/kbcloud/admin/model_resource_stats.go @@ -15,9 +15,9 @@ type ResourceStats struct { // The amount of CPU or Memory resources that are available on the node. Unit is GiB for memory and Cores for CPU. Allocatable *float64 `json:"allocatable,omitempty"` // The maximum number of CPU or Memory resources pods are allowed to use on the node. Unit is GiB for memory and Cores for CPU - Limits float64 `json:"limits"` + Limits *float64 `json:"limits,omitempty"` // The number of CPU or Memory resources requested by pods running on the node. Unit is GiB for memory and Cores for CPU. - Requests float64 `json:"requests"` + Requests *float64 `json:"requests,omitempty"` // The amount of CPU or Memory resources that are already used on the node. Unit is GiB for memory and Cores for CPU. Usage float64 `json:"usage"` // The total amount of physical resources available on the node. Unit is GiB for memory and Cores for CPU. @@ -31,10 +31,8 @@ type ResourceStats struct { // 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 NewResourceStats(limits float64, requests float64, usage float64) *ResourceStats { +func NewResourceStats(usage float64) *ResourceStats { this := ResourceStats{} - this.Limits = limits - this.Requests = requests this.Usage = usage return &this } @@ -75,50 +73,60 @@ func (o *ResourceStats) SetAllocatable(v float64) { o.Allocatable = &v } -// GetLimits returns the Limits field value. +// GetLimits returns the Limits field value if set, zero value otherwise. func (o *ResourceStats) GetLimits() float64 { - if o == nil { + if o == nil || o.Limits == nil { var ret float64 return ret } - return o.Limits + return *o.Limits } -// GetLimitsOk returns a tuple with the Limits field value +// GetLimitsOk returns a tuple with the Limits field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ResourceStats) GetLimitsOk() (*float64, bool) { - if o == nil { + if o == nil || o.Limits == nil { return nil, false } - return &o.Limits, true + return o.Limits, true +} + +// HasLimits returns a boolean if a field has been set. +func (o *ResourceStats) HasLimits() bool { + return o != nil && o.Limits != nil } -// SetLimits sets field value. +// SetLimits gets a reference to the given float64 and assigns it to the Limits field. func (o *ResourceStats) SetLimits(v float64) { - o.Limits = v + o.Limits = &v } -// GetRequests returns the Requests field value. +// GetRequests returns the Requests field value if set, zero value otherwise. func (o *ResourceStats) GetRequests() float64 { - if o == nil { + if o == nil || o.Requests == nil { var ret float64 return ret } - return o.Requests + return *o.Requests } -// GetRequestsOk returns a tuple with the Requests field value +// GetRequestsOk returns a tuple with the Requests field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ResourceStats) GetRequestsOk() (*float64, bool) { - if o == nil { + if o == nil || o.Requests == nil { return nil, false } - return &o.Requests, true + return o.Requests, true } -// SetRequests sets field value. +// HasRequests returns a boolean if a field has been set. +func (o *ResourceStats) HasRequests() bool { + return o != nil && o.Requests != nil +} + +// SetRequests gets a reference to the given float64 and assigns it to the Requests field. func (o *ResourceStats) SetRequests(v float64) { - o.Requests = v + o.Requests = &v } // GetUsage returns the Usage field value. @@ -181,8 +189,12 @@ func (o ResourceStats) MarshalJSON() ([]byte, error) { if o.Allocatable != nil { toSerialize["allocatable"] = o.Allocatable } - toSerialize["limits"] = o.Limits - toSerialize["requests"] = o.Requests + if o.Limits != nil { + toSerialize["limits"] = o.Limits + } + if o.Requests != nil { + toSerialize["requests"] = o.Requests + } toSerialize["usage"] = o.Usage if o.Capacity != nil { toSerialize["capacity"] = o.Capacity @@ -198,20 +210,14 @@ func (o ResourceStats) MarshalJSON() ([]byte, error) { func (o *ResourceStats) UnmarshalJSON(bytes []byte) (err error) { all := struct { Allocatable *float64 `json:"allocatable,omitempty"` - Limits *float64 `json:"limits"` - Requests *float64 `json:"requests"` + Limits *float64 `json:"limits,omitempty"` + Requests *float64 `json:"requests,omitempty"` Usage *float64 `json:"usage"` Capacity *float64 `json:"capacity,omitempty"` }{} if err = common.Unmarshal(bytes, &all); err != nil { return err } - if all.Limits == nil { - return fmt.Errorf("required field limits missing") - } - if all.Requests == nil { - return fmt.Errorf("required field requests missing") - } if all.Usage == nil { return fmt.Errorf("required field usage missing") } @@ -222,8 +228,8 @@ func (o *ResourceStats) UnmarshalJSON(bytes []byte) (err error) { return err } o.Allocatable = all.Allocatable - o.Limits = *all.Limits - o.Requests = *all.Requests + o.Limits = all.Limits + o.Requests = all.Requests o.Usage = *all.Usage o.Capacity = all.Capacity