Merge pull request #127 from yunify/fix-incorrect-vxnet_type-content

fix-incorrect-vxnet_type-content
This commit is contained in:
Simon 2019-05-31 17:32:13 +08:00 committed by GitHub
commit c8f8d40dd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 23 deletions

View File

@ -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
}