Files
sdk/model_compute_fleet_metrics.go

307 lines
8.4 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the ComputeFleetMetrics type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeFleetMetrics{}
// ComputeFleetMetrics struct for ComputeFleetMetrics
type ComputeFleetMetrics struct {
// At is when this reading was MEASURED, RFC 3339 in UTC — not when the board was built. A console decides staleness by comparing it to now; the board deliberately does not decide that for it.
At *string `json:"at,omitempty"`
// GPUUtil is aggregate accelerator utilization as a FRACTION of 1 — 0.42 is 42% busy, never 42. Across all of the unit's cards, not one of them.
GpuUtil *float64 `json:"gpuUtil,omitempty"`
// Load1 is the host's 1-minute load average — runnable processes, not a percentage, so it is read against the unit's core count and can exceed 1.
Load1 *float64 `json:"load1,omitempty"`
// MemFree is host memory still available, in BYTES. It is what the source reported, not fleetSpec.Memory minus MemUsed.
MemFree *int64 `json:"memFree,omitempty"`
// MemUsed is host memory in use, in BYTES.
MemUsed *int64 `json:"memUsed,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeFleetMetrics ComputeFleetMetrics
// NewComputeFleetMetrics instantiates a new ComputeFleetMetrics 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 NewComputeFleetMetrics() *ComputeFleetMetrics {
this := ComputeFleetMetrics{}
return &this
}
// NewComputeFleetMetricsWithDefaults instantiates a new ComputeFleetMetrics 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 NewComputeFleetMetricsWithDefaults() *ComputeFleetMetrics {
this := ComputeFleetMetrics{}
return &this
}
// GetAt returns the At field value if set, zero value otherwise.
func (o *ComputeFleetMetrics) GetAt() string {
if o == nil || IsNil(o.At) {
var ret string
return ret
}
return *o.At
}
// GetAtOk returns a tuple with the At field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeFleetMetrics) GetAtOk() (*string, bool) {
if o == nil || IsNil(o.At) {
return nil, false
}
return o.At, true
}
// HasAt returns a boolean if a field has been set.
func (o *ComputeFleetMetrics) HasAt() bool {
if o != nil && !IsNil(o.At) {
return true
}
return false
}
// SetAt gets a reference to the given string and assigns it to the At field.
func (o *ComputeFleetMetrics) SetAt(v string) {
o.At = &v
}
// GetGpuUtil returns the GpuUtil field value if set, zero value otherwise.
func (o *ComputeFleetMetrics) GetGpuUtil() float64 {
if o == nil || IsNil(o.GpuUtil) {
var ret float64
return ret
}
return *o.GpuUtil
}
// GetGpuUtilOk returns a tuple with the GpuUtil field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeFleetMetrics) GetGpuUtilOk() (*float64, bool) {
if o == nil || IsNil(o.GpuUtil) {
return nil, false
}
return o.GpuUtil, true
}
// HasGpuUtil returns a boolean if a field has been set.
func (o *ComputeFleetMetrics) HasGpuUtil() bool {
if o != nil && !IsNil(o.GpuUtil) {
return true
}
return false
}
// SetGpuUtil gets a reference to the given float64 and assigns it to the GpuUtil field.
func (o *ComputeFleetMetrics) SetGpuUtil(v float64) {
o.GpuUtil = &v
}
// GetLoad1 returns the Load1 field value if set, zero value otherwise.
func (o *ComputeFleetMetrics) GetLoad1() float64 {
if o == nil || IsNil(o.Load1) {
var ret float64
return ret
}
return *o.Load1
}
// GetLoad1Ok returns a tuple with the Load1 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeFleetMetrics) GetLoad1Ok() (*float64, bool) {
if o == nil || IsNil(o.Load1) {
return nil, false
}
return o.Load1, true
}
// HasLoad1 returns a boolean if a field has been set.
func (o *ComputeFleetMetrics) HasLoad1() bool {
if o != nil && !IsNil(o.Load1) {
return true
}
return false
}
// SetLoad1 gets a reference to the given float64 and assigns it to the Load1 field.
func (o *ComputeFleetMetrics) SetLoad1(v float64) {
o.Load1 = &v
}
// GetMemFree returns the MemFree field value if set, zero value otherwise.
func (o *ComputeFleetMetrics) GetMemFree() int64 {
if o == nil || IsNil(o.MemFree) {
var ret int64
return ret
}
return *o.MemFree
}
// GetMemFreeOk returns a tuple with the MemFree field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeFleetMetrics) GetMemFreeOk() (*int64, bool) {
if o == nil || IsNil(o.MemFree) {
return nil, false
}
return o.MemFree, true
}
// HasMemFree returns a boolean if a field has been set.
func (o *ComputeFleetMetrics) HasMemFree() bool {
if o != nil && !IsNil(o.MemFree) {
return true
}
return false
}
// SetMemFree gets a reference to the given int64 and assigns it to the MemFree field.
func (o *ComputeFleetMetrics) SetMemFree(v int64) {
o.MemFree = &v
}
// GetMemUsed returns the MemUsed field value if set, zero value otherwise.
func (o *ComputeFleetMetrics) GetMemUsed() int64 {
if o == nil || IsNil(o.MemUsed) {
var ret int64
return ret
}
return *o.MemUsed
}
// GetMemUsedOk returns a tuple with the MemUsed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeFleetMetrics) GetMemUsedOk() (*int64, bool) {
if o == nil || IsNil(o.MemUsed) {
return nil, false
}
return o.MemUsed, true
}
// HasMemUsed returns a boolean if a field has been set.
func (o *ComputeFleetMetrics) HasMemUsed() bool {
if o != nil && !IsNil(o.MemUsed) {
return true
}
return false
}
// SetMemUsed gets a reference to the given int64 and assigns it to the MemUsed field.
func (o *ComputeFleetMetrics) SetMemUsed(v int64) {
o.MemUsed = &v
}
func (o ComputeFleetMetrics) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeFleetMetrics) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.At) {
toSerialize["at"] = o.At
}
if !IsNil(o.GpuUtil) {
toSerialize["gpuUtil"] = o.GpuUtil
}
if !IsNil(o.Load1) {
toSerialize["load1"] = o.Load1
}
if !IsNil(o.MemFree) {
toSerialize["memFree"] = o.MemFree
}
if !IsNil(o.MemUsed) {
toSerialize["memUsed"] = o.MemUsed
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeFleetMetrics) UnmarshalJSON(data []byte) (err error) {
varComputeFleetMetrics := _ComputeFleetMetrics{}
err = json.Unmarshal(data, &varComputeFleetMetrics)
if err != nil {
return err
}
*o = ComputeFleetMetrics(varComputeFleetMetrics)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "at")
delete(additionalProperties, "gpuUtil")
delete(additionalProperties, "load1")
delete(additionalProperties, "memFree")
delete(additionalProperties, "memUsed")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeFleetMetrics struct {
value *ComputeFleetMetrics
isSet bool
}
func (v NullableComputeFleetMetrics) Get() *ComputeFleetMetrics {
return v.value
}
func (v *NullableComputeFleetMetrics) Set(val *ComputeFleetMetrics) {
v.value = val
v.isSet = true
}
func (v NullableComputeFleetMetrics) IsSet() bool {
return v.isSet
}
func (v *NullableComputeFleetMetrics) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeFleetMetrics(val *ComputeFleetMetrics) *NullableComputeFleetMetrics {
return &NullableComputeFleetMetrics{value: val, isSet: true}
}
func (v NullableComputeFleetMetrics) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeFleetMetrics) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}