Former-commit-id: 5c1c0d40d8
pull/215/head
| @@ -163,19 +163,19 @@ type VmInfo struct { | |||||
| AdapterName string `json:"adapterName,omitempty,optional"` | AdapterName string `json:"adapterName,omitempty,optional"` | ||||
| ClusterId int64 `json:"clusterId,omitempty,optional"` | ClusterId int64 `json:"clusterId,omitempty,optional"` | ||||
| ClusterName string `json:"clusterName,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"` | Status string `json:"status,omitempty"` | ||||
| Platform string `json:"platform,omitempty"` | Platform string `json:"platform,omitempty"` | ||||
| Description string `json:"description,omitempty"` // 描述 | Description string `json:"description,omitempty"` // 描述 | ||||
| AvailabilityZone string `json:"availability_zone,omitempty"` | AvailabilityZone string `json:"availability_zone,omitempty"` | ||||
| MinCount string `json:"min_count,omitempty"` | |||||
| MinCount string `json:"minCount,omitempty"` | |||||
| Uuid string `json:"uuid,omitempty"` | Uuid string `json:"uuid,omitempty"` | ||||
| StartTime string `json:"startTime,omitempty"` | StartTime string `json:"startTime,omitempty"` | ||||
| RunningTime string `json:"runningTime,omitempty"` | RunningTime string `json:"runningTime,omitempty"` | ||||
| Result string `json:"result,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"` | Replicas int64 `json:"replicas,omitempty"` | ||||
| ServerId string `json:"serverId,omitempty"` | ServerId string `json:"serverId,omitempty"` | ||||
| } | } | ||||
| @@ -215,17 +215,17 @@ type ( | |||||
| type ( | type ( | ||||
| commitVmTaskReq { | commitVmTaskReq { | ||||
| Name string `json:"name"` | |||||
| Name string `json:"name"` | |||||
| AdapterIds []string `json:"adapterIds,optional"` | 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"` | 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 { | TaskVm { | ||||
| Image string `json:"image"` | Image string `json:"image"` | ||||
| @@ -119,7 +119,7 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type | |||||
| logx.Errorf("CommitGeneralTask() => sql execution error: %v", err) | logx.Errorf("CommitGeneralTask() => sql execution error: %v", err) | ||||
| //return errors.Errorf("the cluster does not match the drive resources. Check the data"), nil | //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.Status = "Saved" | ||||
| taskVm.StartTime = time.Now().String() | taskVm.StartTime = time.Now().String() | ||||
| taskVm.MinCount = req.MinCount | 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) | l.svcCtx.DbEngin.Raw("select name from t_cluster where id= ?", r.ClusterId).Scan(&clusterName) | ||||
| taskVm.ClusterName = clusterName | taskVm.ClusterName = clusterName | ||||
| taskVm.ClusterId, err = strconv.ParseInt(clusterId, 10, 64) | taskVm.ClusterId, err = strconv.ParseInt(clusterId, 10, 64) | ||||
| taskVm.VmName = req.VmName | |||||
| taskVm.Replicas = req.Replicas | |||||
| if err != nil { | if err != nil { | ||||
| fmt.Println("Error converting string to int64:", err) | fmt.Println("Error converting string to int64:", err) | ||||
| return | return | ||||
| @@ -202,7 +202,7 @@ type CommitVmTaskReq struct { | |||||
| ImageRef int64 `json:"imageRef,optional"` | ImageRef int64 `json:"imageRef,optional"` | ||||
| FlavorRef int64 `json:"flavorRef,optional"` | FlavorRef int64 `json:"flavorRef,optional"` | ||||
| Uuid int64 `json:"uuid,optional"` | Uuid int64 `json:"uuid,optional"` | ||||
| Replicas int32 `json:"replicas,string"` | |||||
| Replicas int64 `json:"replicas,string"` | |||||
| VmName string `json:"vm_name,optional"` | VmName string `json:"vm_name,optional"` | ||||
| } | } | ||||