models

package
v0.0.1-alpha4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateInstanceRequest

type CreateInstanceRequest struct {
	MachineID      string `json:"machine_id"`       // 机器ID
	ReqGPUAmount   int32  `json:"req_gpu_amount"`   // 请求GPU数量
	ImageType      string `json:"image_type"`       // 镜像类型 官方镜像 用户自定义镜像
	Image          string `json:"image"`            // 镜像ID (官方镜像)
	PrivateImage   string `json:"private_image"`    // 用户自定义镜像ID
	InstanceName   string `json:"instance_name"`    // 实例名称
	ExpandDataDisk int64  `json:"expand_data_disk"` // 扩容数据盘大小
	SkuID          string `json:"sku_id"`           // 计费类型 按量计费 包年包月
	Duration       int64  `json:"duration"`         // 时长
	AutoRenew      string `json:"auto_renew"`       // auto 自动续费  manual 手动续费
}

type GpuMachine

type GpuMachine struct {
	MachineId         string                 `json:"machine_id"`
	MachineName       string                 `json:"machine_name"`
	MachineSupply     string                 `json:"machine_supply"`
	GpuName           string                 `json:"gpu_name"`
	GpuNum            int32                  `json:"gpu_num"`
	GpuIdle           int32                  `json:"gpu_idle"`
	GpuUsed           int32                  `json:"gpu_used"`
	GpuMemory         int64                  `json:"gpu_memory" ` // GPU显存大小 单位 GB
	RentStartTime     time.Time              `json:"rent_start_time"`
	RentEndTime       time.Time              `json:"rent_end_time"`
	Status            int32                  `json:"status"`
	RentHours         int32                  `json:"rent_hours"`
	RentTimes         int32                  `json:"rent_times"`
	CpuPerGpu         int32                  `json:"cpu_per_gpu"`
	MemoryPerGpu      int64                  `json:"memory_per_gpu"`
	MaxDiskExpand     int64                  `json:"max_disk_expand"`
	Level             string                 `json:"level"`
	Score             int32                  `json:"score"`
	Nas               int32                  `json:"nas"`
	Tag               string                 `json:"tag"`
	IsOnline          int32                  `json:"is_online"`
	RegionName        string                 `json:"region_name"`
	RegionId          string                 `json:"region_id"`
	GpuLowPrice       string                 `json:"gpu_low_price"`
	GpuHighPrice      string                 `json:"gpu_high_price"`
	BaseInfo          *MarketMachineBaseInfo `json:"base_info"`
	Sku               []SkuInfo              `json:"sku"`
	SupplierID        string                 `json:"supplier_id"`
	MainTenanceStatus int32                  `json:"maintenance_status"`
}

type ImageItem

type ImageItem struct {
	Label    string      `json:"label"`
	Value    string      `json:"value"`
	Children []ImageItem `json:"children"`
	Uuid     *string     `json:"uuid"`
}

type InstanceInfo

type InstanceInfo struct {
	InstanceID          string  `json:"instance_id"`
	MachineID           string  `json:"machine_id"`
	MachineName         string  `json:"machine_name"`
	RegionID            string  `json:"region_id"`
	RegionName          string  `json:"region_name"`
	DriverVersion       string  `json:"driver_version"`
	Status              string  `json:"status"`
	SSHProxyHost        string  `json:"ssh_proxy_host"`
	SSHCommand          string  `json:"ssh_command"`
	SSHRootPassword     string  `json:"ssh_root_password"`
	JupyterDomain       string  `json:"jupyter_domain"`
	JupyterToken        string  `json:"jupyter_token"`
	JupyterPort         int     `json:"jupyter_port"`
	TensorboardDomain   string  `json:"tensorboard_domain"`
	TensorboardPort     int     `json:"tensorboard_port"`
	CustomServiceStatus string  `json:"custom_service_status"`
	CustomUrl           string  `json:"custom_url"`
	ImageID             string  `json:"image_id"`
	SkuID               string  `json:"sku_id"`
	ReqGpuAmount        int     `json:"req_gpu_amount"`
	InstanceGPUNum      int     `json:"instance_gpu_num"`
	GPUIdleNum          int     `json:"gpu_idle_num"`
	StartedAt           string  `json:"started_at"`
	StoppedAt           string  `json:"stopped_at"`
	ScheduleStopTime    string  `json:"schedule_stop_time"`
	ScheduleReleaseTime string  `json:"schedule_release_time"`
	DiskUsedRate        float64 `json:"disk_used_rate"`
	TmpDiskUsedRate     float64 `json:"tmp_disk_used_rate"`
	AutoRenew           string  `json:"auto_renew"`
}

type ListInstancesResponse

type ListInstancesResponse struct {
	Pagination Pagination      `json:"pagination"`
	Result     []*InstanceInfo `json:"result"`
}

type ListMachinesResponse

type ListMachinesResponse struct {
	Pagination Pagination    `json:"pagination"`
	Result     []*GpuMachine `json:"result"`
}

type MarketMachineBaseInfo

type MarketMachineBaseInfo struct {
	Id                int64     `json:"id"` // id
	MachineId         string    `json:"machine_id"`
	MachineType       string    `json:"machine_type"`
	PhysicalMachineID string    `json:"physical_machine_id"`
	CPUCoreNum        int       `json:"cpu_core_num"`
	CPUBaseFrequency  string    `json:"cpu_base_frequency"`
	CPUName           string    `json:"cpu_name"`
	PhysicalCPUNum    int       `json:"physical_cpu_num"`
	DiskSize          int64     `json:"disk_size"`
	DiskType          string    `json:"disk_type"`
	GPUToolkitName    string    `json:"gpu_toolkit_name"`
	GPUToolkitVersion string    `json:"gpu_toolkit_version"`
	GPUDriverVersion  string    `json:"gpu_driver_version"`
	GPUName           string    `json:"gpu_name"`
	GPUNum            int       `json:"gpu_num"`
	MemoryTotal       int64     `json:"memory_total"`
	NetDownloadSpeed  int64     `json:"net_download_speed"`
	NetUploadSpeed    int64     `json:"net_upload_speed"`
	OSName            string    `json:"os_name"`
	Hostname          string    `json:"hostname"`
	RegionID          string    `json:"region_id"`
	VMType            string    `json:"vm_type"`
	CreateTime        time.Time `json:"create_time" `
	UpdateTime        time.Time `json:"update_time"`
}

type MarketResponse

type MarketResponse struct {
	SkuList []Sku    `json:"sku_list"` // 计费方式
	Region  []Region `json:"region"`   // 地域
}

type Pagination

type Pagination struct {
	Page  int `json:"page"`
	Size  int `json:"size"`
	Total int `json:"total"`
}

type Region

type Region struct {
	RegionID   string `json:"region_id"`
	Name       string `json:"name"`
	Datacenter string `json:"datacenter"`
	Visible    string `json:"visible"`
	UsedFor    string `json:"used_for"`
}

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type Sku

type Sku struct {
	SkuID string `json:"skuID"`
	Name  string `json:"name"`
}

type SkuInfo

type SkuInfo struct {
	SkuId         string `json:"sku_id"`
	Price         string `json:"price"`
	OriginalPrice string `json:"original_price"`
	Discount      string `json:"discount"`
	Status        int32  `json:"status"`
	Enable        int32  `json:"enable"`
	StartTime     string `json:"start_time"`
	EndTime       string `json:"end_time"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL