From dc255059a90b6b38182c745f128623c57ff6e7b3 Mon Sep 17 00:00:00 2001 From: weihong Date: Mon, 6 Nov 2023 11:50:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8E=BB=E9=99=A4cpumode=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/instance.go | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/service/instance.go b/service/instance.go index 458056d..a6d107b 100644 --- a/service/instance.go +++ b/service/instance.go @@ -643,25 +643,25 @@ func (v *RunInstancesInput) Validate() error { } } - if v.CPUModel != nil { - cpuModelValidValues := []string{"Westmere", "SandyBridge", "IvyBridge", "Haswell", "Broadwell"} - cpuModelParameterValue := fmt.Sprint(*v.CPUModel) - - cpuModelIsValid := false - for _, value := range cpuModelValidValues { - if value == cpuModelParameterValue { - cpuModelIsValid = true - } - } - - if !cpuModelIsValid { - return errors.ParameterValueNotAllowedError{ - ParameterName: "CPUModel", - ParameterValue: cpuModelParameterValue, - AllowedValues: cpuModelValidValues, - } - } - } + //if v.CPUModel != nil { + // cpuModelValidValues := []string{"Westmere", "SandyBridge", "IvyBridge", "Haswell", "Broadwell"} + // cpuModelParameterValue := fmt.Sprint(*v.CPUModel) + // + // cpuModelIsValid := false + // for _, value := range cpuModelValidValues { + // if value == cpuModelParameterValue { + // cpuModelIsValid = true + // } + // } + // + // if !cpuModelIsValid { + // return errors.ParameterValueNotAllowedError{ + // ParameterName: "CPUModel", + // ParameterValue: cpuModelParameterValue, + // AllowedValues: cpuModelValidValues, + // } + // } + //} if v.ImageID == nil { return errors.ParameterRequiredError{ From 7b58359308a50633fd7849ec7659624930095a6e Mon Sep 17 00:00:00 2001 From: weihong Date: Mon, 6 Nov 2023 12:36:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8E=BB=E6=8E=89cpumode=E7=9A=84=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/instance.go b/service/instance.go index a6d107b..024d113 100644 --- a/service/instance.go +++ b/service/instance.go @@ -569,7 +569,7 @@ type RunInstancesInput struct { // CPUMax's available values: 1, 2, 4, 8, 16 CPUMax *int `json:"cpu_max" name:"cpu_max" location:"params"` // CPUModel's available values: Westmere, SandyBridge, IvyBridge, Haswell, Broadwell - CPUModel *string `json:"cpu_model" name:"cpu_model" default:"Westmere" location:"params"` + CPUModel *string `json:"cpu_model" name:"cpu_model" location:"params"` Gpu *int `json:"gpu" name:"gpu" default:"0" location:"params"` Hostname *string `json:"hostname" name:"hostname" location:"params"` ImageID *string `json:"image_id" name:"image_id" location:"params"` // Required