mirror of
https://github.com/hanzoai/runtime.git
synced 2026-10-30 18:23:13 +00:00
- Add main Dockerfile for production builds - Add Dockerfile.runtime for secure code execution - Add Dockerfile.runtime.fixed with improved configuration - Include .dockerignore for build optimization - Add integration documentation and publishing guides - Update API and CLI components for better runtime support - Enhance sandbox and container management features
660 lines
14 KiB
Go
Generated
660 lines
14 KiB
Go
Generated
/*
|
|
Runtime
|
|
|
|
Runtime AI platform API Docs
|
|
|
|
API version: 1.0
|
|
Contact: [email protected]
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package apiclient
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// checks if the Runner type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Runner{}
|
|
|
|
// Runner struct for Runner
|
|
type Runner struct {
|
|
// The ID of the runner
|
|
Id string `json:"id"`
|
|
// The domain of the runner
|
|
Domain string `json:"domain"`
|
|
// The API URL of the runner
|
|
ApiUrl string `json:"apiUrl"`
|
|
// The API key for the runner
|
|
ApiKey string `json:"apiKey"`
|
|
// The CPU capacity of the runner
|
|
Cpu float32 `json:"cpu"`
|
|
// The memory capacity of the runner in GB
|
|
Memory float32 `json:"memory"`
|
|
// The disk capacity of the runner in GB
|
|
Disk float32 `json:"disk"`
|
|
// The GPU capacity of the runner
|
|
Gpu float32 `json:"gpu"`
|
|
// The type of GPU
|
|
GpuType string `json:"gpuType"`
|
|
// The class of the runner
|
|
Class SandboxClass `json:"class"`
|
|
// The current usage of the runner
|
|
Used float32 `json:"used"`
|
|
// The capacity of the runner
|
|
Capacity float32 `json:"capacity"`
|
|
// The region of the runner
|
|
Region RunnerRegion `json:"region"`
|
|
// The state of the runner
|
|
State RunnerState `json:"state"`
|
|
// The last time the runner was checked
|
|
LastChecked *string `json:"lastChecked,omitempty"`
|
|
// Whether the runner is unschedulable
|
|
Unschedulable bool `json:"unschedulable"`
|
|
// The creation timestamp of the runner
|
|
CreatedAt string `json:"createdAt"`
|
|
// The last update timestamp of the runner
|
|
UpdatedAt string `json:"updatedAt"`
|
|
}
|
|
|
|
type _Runner Runner
|
|
|
|
// NewRunner instantiates a new Runner 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 NewRunner(id string, domain string, apiUrl string, apiKey string, cpu float32, memory float32, disk float32, gpu float32, gpuType string, class SandboxClass, used float32, capacity float32, region RunnerRegion, state RunnerState, unschedulable bool, createdAt string, updatedAt string) *Runner {
|
|
this := Runner{}
|
|
this.Id = id
|
|
this.Domain = domain
|
|
this.ApiUrl = apiUrl
|
|
this.ApiKey = apiKey
|
|
this.Cpu = cpu
|
|
this.Memory = memory
|
|
this.Disk = disk
|
|
this.Gpu = gpu
|
|
this.GpuType = gpuType
|
|
this.Class = class
|
|
this.Used = used
|
|
this.Capacity = capacity
|
|
this.Region = region
|
|
this.State = state
|
|
this.Unschedulable = unschedulable
|
|
this.CreatedAt = createdAt
|
|
this.UpdatedAt = updatedAt
|
|
return &this
|
|
}
|
|
|
|
// NewRunnerWithDefaults instantiates a new Runner 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 NewRunnerWithDefaults() *Runner {
|
|
this := Runner{}
|
|
return &this
|
|
}
|
|
|
|
// GetId returns the Id field value
|
|
func (o *Runner) GetId() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetIdOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Id, true
|
|
}
|
|
|
|
// SetId sets field value
|
|
func (o *Runner) SetId(v string) {
|
|
o.Id = v
|
|
}
|
|
|
|
// GetDomain returns the Domain field value
|
|
func (o *Runner) GetDomain() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Domain
|
|
}
|
|
|
|
// GetDomainOk returns a tuple with the Domain field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetDomainOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Domain, true
|
|
}
|
|
|
|
// SetDomain sets field value
|
|
func (o *Runner) SetDomain(v string) {
|
|
o.Domain = v
|
|
}
|
|
|
|
// GetApiUrl returns the ApiUrl field value
|
|
func (o *Runner) GetApiUrl() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.ApiUrl
|
|
}
|
|
|
|
// GetApiUrlOk returns a tuple with the ApiUrl field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetApiUrlOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.ApiUrl, true
|
|
}
|
|
|
|
// SetApiUrl sets field value
|
|
func (o *Runner) SetApiUrl(v string) {
|
|
o.ApiUrl = v
|
|
}
|
|
|
|
// GetApiKey returns the ApiKey field value
|
|
func (o *Runner) GetApiKey() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.ApiKey
|
|
}
|
|
|
|
// GetApiKeyOk returns a tuple with the ApiKey field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetApiKeyOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.ApiKey, true
|
|
}
|
|
|
|
// SetApiKey sets field value
|
|
func (o *Runner) SetApiKey(v string) {
|
|
o.ApiKey = v
|
|
}
|
|
|
|
// GetCpu returns the Cpu field value
|
|
func (o *Runner) GetCpu() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Cpu
|
|
}
|
|
|
|
// GetCpuOk returns a tuple with the Cpu field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetCpuOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Cpu, true
|
|
}
|
|
|
|
// SetCpu sets field value
|
|
func (o *Runner) SetCpu(v float32) {
|
|
o.Cpu = v
|
|
}
|
|
|
|
// GetMemory returns the Memory field value
|
|
func (o *Runner) GetMemory() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Memory
|
|
}
|
|
|
|
// GetMemoryOk returns a tuple with the Memory field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetMemoryOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Memory, true
|
|
}
|
|
|
|
// SetMemory sets field value
|
|
func (o *Runner) SetMemory(v float32) {
|
|
o.Memory = v
|
|
}
|
|
|
|
// GetDisk returns the Disk field value
|
|
func (o *Runner) GetDisk() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Disk
|
|
}
|
|
|
|
// GetDiskOk returns a tuple with the Disk field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetDiskOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Disk, true
|
|
}
|
|
|
|
// SetDisk sets field value
|
|
func (o *Runner) SetDisk(v float32) {
|
|
o.Disk = v
|
|
}
|
|
|
|
// GetGpu returns the Gpu field value
|
|
func (o *Runner) GetGpu() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Gpu
|
|
}
|
|
|
|
// GetGpuOk returns a tuple with the Gpu field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetGpuOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Gpu, true
|
|
}
|
|
|
|
// SetGpu sets field value
|
|
func (o *Runner) SetGpu(v float32) {
|
|
o.Gpu = v
|
|
}
|
|
|
|
// GetGpuType returns the GpuType field value
|
|
func (o *Runner) GetGpuType() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.GpuType
|
|
}
|
|
|
|
// GetGpuTypeOk returns a tuple with the GpuType field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetGpuTypeOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.GpuType, true
|
|
}
|
|
|
|
// SetGpuType sets field value
|
|
func (o *Runner) SetGpuType(v string) {
|
|
o.GpuType = v
|
|
}
|
|
|
|
// GetClass returns the Class field value
|
|
func (o *Runner) GetClass() SandboxClass {
|
|
if o == nil {
|
|
var ret SandboxClass
|
|
return ret
|
|
}
|
|
|
|
return o.Class
|
|
}
|
|
|
|
// GetClassOk returns a tuple with the Class field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetClassOk() (*SandboxClass, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Class, true
|
|
}
|
|
|
|
// SetClass sets field value
|
|
func (o *Runner) SetClass(v SandboxClass) {
|
|
o.Class = v
|
|
}
|
|
|
|
// GetUsed returns the Used field value
|
|
func (o *Runner) GetUsed() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Used
|
|
}
|
|
|
|
// GetUsedOk returns a tuple with the Used field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetUsedOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Used, true
|
|
}
|
|
|
|
// SetUsed sets field value
|
|
func (o *Runner) SetUsed(v float32) {
|
|
o.Used = v
|
|
}
|
|
|
|
// GetCapacity returns the Capacity field value
|
|
func (o *Runner) GetCapacity() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.Capacity
|
|
}
|
|
|
|
// GetCapacityOk returns a tuple with the Capacity field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetCapacityOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Capacity, true
|
|
}
|
|
|
|
// SetCapacity sets field value
|
|
func (o *Runner) SetCapacity(v float32) {
|
|
o.Capacity = v
|
|
}
|
|
|
|
// GetRegion returns the Region field value
|
|
func (o *Runner) GetRegion() RunnerRegion {
|
|
if o == nil {
|
|
var ret RunnerRegion
|
|
return ret
|
|
}
|
|
|
|
return o.Region
|
|
}
|
|
|
|
// GetRegionOk returns a tuple with the Region field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetRegionOk() (*RunnerRegion, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Region, true
|
|
}
|
|
|
|
// SetRegion sets field value
|
|
func (o *Runner) SetRegion(v RunnerRegion) {
|
|
o.Region = v
|
|
}
|
|
|
|
// GetState returns the State field value
|
|
func (o *Runner) GetState() RunnerState {
|
|
if o == nil {
|
|
var ret RunnerState
|
|
return ret
|
|
}
|
|
|
|
return o.State
|
|
}
|
|
|
|
// GetStateOk returns a tuple with the State field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetStateOk() (*RunnerState, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.State, true
|
|
}
|
|
|
|
// SetState sets field value
|
|
func (o *Runner) SetState(v RunnerState) {
|
|
o.State = v
|
|
}
|
|
|
|
// GetLastChecked returns the LastChecked field value if set, zero value otherwise.
|
|
func (o *Runner) GetLastChecked() string {
|
|
if o == nil || IsNil(o.LastChecked) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.LastChecked
|
|
}
|
|
|
|
// GetLastCheckedOk returns a tuple with the LastChecked field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetLastCheckedOk() (*string, bool) {
|
|
if o == nil || IsNil(o.LastChecked) {
|
|
return nil, false
|
|
}
|
|
return o.LastChecked, true
|
|
}
|
|
|
|
// HasLastChecked returns a boolean if a field has been set.
|
|
func (o *Runner) HasLastChecked() bool {
|
|
if o != nil && !IsNil(o.LastChecked) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLastChecked gets a reference to the given string and assigns it to the LastChecked field.
|
|
func (o *Runner) SetLastChecked(v string) {
|
|
o.LastChecked = &v
|
|
}
|
|
|
|
// GetUnschedulable returns the Unschedulable field value
|
|
func (o *Runner) GetUnschedulable() bool {
|
|
if o == nil {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
|
|
return o.Unschedulable
|
|
}
|
|
|
|
// GetUnschedulableOk returns a tuple with the Unschedulable field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetUnschedulableOk() (*bool, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Unschedulable, true
|
|
}
|
|
|
|
// SetUnschedulable sets field value
|
|
func (o *Runner) SetUnschedulable(v bool) {
|
|
o.Unschedulable = v
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value
|
|
func (o *Runner) GetCreatedAt() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.CreatedAt
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetCreatedAtOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.CreatedAt, true
|
|
}
|
|
|
|
// SetCreatedAt sets field value
|
|
func (o *Runner) SetCreatedAt(v string) {
|
|
o.CreatedAt = v
|
|
}
|
|
|
|
// GetUpdatedAt returns the UpdatedAt field value
|
|
func (o *Runner) GetUpdatedAt() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.UpdatedAt
|
|
}
|
|
|
|
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Runner) GetUpdatedAtOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.UpdatedAt, true
|
|
}
|
|
|
|
// SetUpdatedAt sets field value
|
|
func (o *Runner) SetUpdatedAt(v string) {
|
|
o.UpdatedAt = v
|
|
}
|
|
|
|
func (o Runner) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Runner) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["id"] = o.Id
|
|
toSerialize["domain"] = o.Domain
|
|
toSerialize["apiUrl"] = o.ApiUrl
|
|
toSerialize["apiKey"] = o.ApiKey
|
|
toSerialize["cpu"] = o.Cpu
|
|
toSerialize["memory"] = o.Memory
|
|
toSerialize["disk"] = o.Disk
|
|
toSerialize["gpu"] = o.Gpu
|
|
toSerialize["gpuType"] = o.GpuType
|
|
toSerialize["class"] = o.Class
|
|
toSerialize["used"] = o.Used
|
|
toSerialize["capacity"] = o.Capacity
|
|
toSerialize["region"] = o.Region
|
|
toSerialize["state"] = o.State
|
|
if !IsNil(o.LastChecked) {
|
|
toSerialize["lastChecked"] = o.LastChecked
|
|
}
|
|
toSerialize["unschedulable"] = o.Unschedulable
|
|
toSerialize["createdAt"] = o.CreatedAt
|
|
toSerialize["updatedAt"] = o.UpdatedAt
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Runner) UnmarshalJSON(data []byte) (err error) {
|
|
// This validates that all required properties are included in the JSON object
|
|
// by unmarshalling the object into a generic map with string keys and checking
|
|
// that every required field exists as a key in the generic map.
|
|
requiredProperties := []string{
|
|
"id",
|
|
"domain",
|
|
"apiUrl",
|
|
"apiKey",
|
|
"cpu",
|
|
"memory",
|
|
"disk",
|
|
"gpu",
|
|
"gpuType",
|
|
"class",
|
|
"used",
|
|
"capacity",
|
|
"region",
|
|
"state",
|
|
"unschedulable",
|
|
"createdAt",
|
|
"updatedAt",
|
|
}
|
|
|
|
allProperties := make(map[string]interface{})
|
|
|
|
err = json.Unmarshal(data, &allProperties)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, requiredProperty := range requiredProperties {
|
|
if _, exists := allProperties[requiredProperty]; !exists {
|
|
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
|
}
|
|
}
|
|
|
|
varRunner := _Runner{}
|
|
|
|
decoder := json.NewDecoder(bytes.NewReader(data))
|
|
decoder.DisallowUnknownFields()
|
|
err = decoder.Decode(&varRunner)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Runner(varRunner)
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableRunner struct {
|
|
value *Runner
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableRunner) Get() *Runner {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableRunner) Set(val *Runner) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableRunner) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableRunner) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableRunner(val *Runner) *NullableRunner {
|
|
return &NullableRunner{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableRunner) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableRunner) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|