mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #4146 from zexi/bugfix/schedule-input-project-domain-missing
region: fix schedule input project and domain missing
This commit is contained in:
@@ -121,10 +121,8 @@ type ServerConfigs struct {
|
||||
// ResourceType "shared|prepaid|dedicated"`
|
||||
ResourceType string `json:"resource_type"`
|
||||
InstanceType string `json:"instance_type"`
|
||||
// Project string `json:"project_id"`
|
||||
// Domain string `json:"domain_id"`
|
||||
Backup bool `json:"backup"`
|
||||
Count int `json:"count"`
|
||||
Backup bool `json:"backup"`
|
||||
Count int `json:"count"`
|
||||
|
||||
Disks []*DiskConfig `json:"disks"`
|
||||
Networks []*NetworkConfig `json:"nets"`
|
||||
@@ -161,8 +159,6 @@ type ServerCreateInput struct {
|
||||
|
||||
*ServerConfigs
|
||||
|
||||
// Name string `json:"name"`
|
||||
// GenerateName string `json:"generate_name"`
|
||||
VmemSize int `json:"vmem_size"`
|
||||
VcpuCount int `json:"vcpu_count"`
|
||||
UserData string `json:"user_data"`
|
||||
|
||||
@@ -337,6 +337,12 @@ func FetchScheduleInputByJSON(obj jsonutils.JSONObject) (*scheduler.ScheduleInpu
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if input.Domain == "" {
|
||||
input.Domain = jsonutils.GetAnyString(obj, []string{"project_domain", "domain_id"})
|
||||
}
|
||||
if input.Project == "" {
|
||||
input.Project = jsonutils.GetAnyString(obj, []string{"project", "project_id"})
|
||||
}
|
||||
return input, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user