fix: update vmInfo 060601

Former-commit-id: 8d2c4ce27e51ef178a07f6361d5bb7ecb2e0837b
This commit is contained in:
qiwang 2024-06-06 12:24:11 +08:00
parent a1d6951493
commit c2a3b77aff
4 changed files with 18 additions and 16 deletions

View File

@ -163,19 +163,19 @@ type VmInfo struct {
AdapterName string `json:"adapterName,omitempty,optional"`
ClusterId int64 `json:"clusterId,omitempty,optional"`
ClusterName string `json:"clusterName,omitempty,optional"`
FlavorRef string `json:"flavor_ref,omitempty"`
ImageRef string `json:"image_ref,omitempty"`
FlavorRef string `json:"flavorRef,omitempty"`
ImageRef string `json:"imageRef,omitempty"`
Status string `json:"status,omitempty"`
Platform string `json:"platform,omitempty"`
Description string `json:"description,omitempty"` // 描述
AvailabilityZone string `json:"availability_zone,omitempty"`
MinCount string `json:"min_count,omitempty"`
MinCount string `json:"minCount,omitempty"`
Uuid string `json:"uuid,omitempty"`
StartTime string `json:"startTime,omitempty"`
RunningTime string `json:"runningTime,omitempty"`
Result string `json:"result,omitempty"`
DeletedAt string `json:"deleted_at,omitempty"`
VmName string `json:"vm_name,omitempty"`
DeletedAt string `json:"deletedAt,omitempty"`
VmName string `json:"vmName,omitempty"`
Replicas int64 `json:"replicas,omitempty"`
ServerId string `json:"serverId,omitempty"`
}

View File

@ -215,17 +215,17 @@ type (
type (
commitVmTaskReq {
Name string `json:"name"`
Name string `json:"name"`
AdapterIds []string `json:"adapterIds,optional"`
ClusterIds []string `json:"clusterIds"`
Strategy string `json:"strategy"`
ClusterIds []string `json:"clusterIds"`
Strategy string `json:"strategy"`
StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"`
MinCount int64 `json:"min_count,optional"`
ImageRef int64 `json:"imageRef,optional"`
FlavorRef int64 `json:"flavorRef,optional"`
Uuid int64 `json:"uuid,optional"`
Replicas int32 `json:"replicas,string"`
VmName string `json:"vm_name,optional"`
MinCount int64 `json:"min_count,optional"`
ImageRef int64 `json:"imageRef,optional"`
FlavorRef int64 `json:"flavorRef,optional"`
Uuid int64 `json:"uuid,optional"`
Replicas int64 `json:"replicas,string"`
VmName string `json:"vm_name,optional"`
}
TaskVm {
Image string `json:"image"`

View File

@ -119,7 +119,7 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type
logx.Errorf("CommitGeneralTask() => sql execution error: %v", err)
//return errors.Errorf("the cluster does not match the drive resources. Check the data"), nil
}*/
taskVm.Name = req.VmName
taskVm.Name = req.Name
taskVm.Status = "Saved"
taskVm.StartTime = time.Now().String()
taskVm.MinCount = req.MinCount
@ -133,6 +133,8 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type
l.svcCtx.DbEngin.Raw("select name from t_cluster where id= ?", r.ClusterId).Scan(&clusterName)
taskVm.ClusterName = clusterName
taskVm.ClusterId, err = strconv.ParseInt(clusterId, 10, 64)
taskVm.VmName = req.VmName
taskVm.Replicas = req.Replicas
if err != nil {
fmt.Println("Error converting string to int64:", err)
return

View File

@ -202,7 +202,7 @@ type CommitVmTaskReq struct {
ImageRef int64 `json:"imageRef,optional"`
FlavorRef int64 `json:"flavorRef,optional"`
Uuid int64 `json:"uuid,optional"`
Replicas int32 `json:"replicas,string"`
Replicas int64 `json:"replicas,string"`
VmName string `json:"vm_name,optional"`
}