fix-incorrect-vxnet_type-content
This commit is contained in:
parent
d4f377108a
commit
28fb1fe90e
|
@ -238,9 +238,8 @@ type DescribeNicsInput struct {
|
||||||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||||
// Status's available values: available, in-use
|
// Status's available values: available, in-use
|
||||||
Status *string `json:"status" name:"status" location:"params"`
|
Status *string `json:"status" name:"status" location:"params"`
|
||||||
// VxNetType's available values: 0, 1
|
VxNetType []*int `json:"vxnet_type" name:"vxnet_type" location:"params"`
|
||||||
VxNetType *int `json:"vxnet_type" name:"vxnet_type" location:"params"`
|
|
||||||
VxNets []*string `json:"vxnets" name:"vxnets" location:"params"`
|
VxNets []*string `json:"vxnets" name:"vxnets" location:"params"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,26 +265,6 @@ func (v *DescribeNicsInput) Validate() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if v.VxNetType != nil {
|
|
||||||
vxnetTypeValidValues := []string{"0", "1"}
|
|
||||||
vxnetTypeParameterValue := fmt.Sprint(*v.VxNetType)
|
|
||||||
|
|
||||||
vxnetTypeIsValid := false
|
|
||||||
for _, value := range vxnetTypeValidValues {
|
|
||||||
if value == vxnetTypeParameterValue {
|
|
||||||
vxnetTypeIsValid = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !vxnetTypeIsValid {
|
|
||||||
return errors.ParameterValueNotAllowedError{
|
|
||||||
ParameterName: "VxNetType",
|
|
||||||
ParameterValue: vxnetTypeParameterValue,
|
|
||||||
AllowedValues: vxnetTypeValidValues,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue