Merge pull request #127 from yunify/fix-incorrect-vxnet_type-content
fix-incorrect-vxnet_type-content
This commit is contained in:
commit
c8f8d40dd4
|
@ -238,9 +238,8 @@ type DescribeNicsInput struct {
|
|||
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
||||
Owner *string `json:"owner" name:"owner" location:"params"`
|
||||
// Status's available values: available, in-use
|
||||
Status *string `json:"status" name:"status" location:"params"`
|
||||
// VxNetType's available values: 0, 1
|
||||
VxNetType *int `json:"vxnet_type" name:"vxnet_type" location:"params"`
|
||||
Status *string `json:"status" name:"status" location:"params"`
|
||||
VxNetType []*int `json:"vxnet_type" name:"vxnet_type" 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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue