Skip to content

Commit

Permalink
Merge pull request #119 from yunify/add-new-instance-volume-type
Browse files Browse the repository at this point in the history
add-new-instance-volume-type
  • Loading branch information
Sunight authored Feb 12, 2019
2 parents be6068c + b22398f commit ecebf15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions service/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ type RunInstancesInput struct {
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
// InstanceClass's available values: 0, 1
// InstanceClass's available values: 0, 1, 2, 3, 4, 5, 6, 100, 101, 200, 201, 300, 301
InstanceClass *int `json:"instance_class" name:"instance_class" location:"params"`
InstanceName *string `json:"instance_name" name:"instance_name" location:"params"`
InstanceType *string `json:"instance_type" name:"instance_type" location:"params"`
Expand Down Expand Up @@ -670,7 +670,7 @@ func (v *RunInstancesInput) Validate() error {
}

if v.InstanceClass != nil {
instanceClassValidValues := []string{"0", "1"}
instanceClassValidValues := []string{"0", "1", "2", "3", "4", "5", "6", "100", "101", "200", "201", "300", "301"}
instanceClassParameterValue := fmt.Sprint(*v.InstanceClass)

instanceClassIsValid := false
Expand Down
8 changes: 4 additions & 4 deletions service/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ type CreateVolumesInput struct {
Count *int `json:"count" name:"count" default:"1" location:"params"`
Size *int `json:"size" name:"size" location:"params"` // Required
VolumeName *string `json:"volume_name" name:"volume_name" location:"params"`
// VolumeType's available values: 0, 1, 2, 3
// VolumeType's available values: 0, 1, 2, 3, 4, 5, 10, 100, 200
VolumeType *int `json:"volume_type" name:"volume_type" default:"0" location:"params"`
}

Expand All @@ -148,7 +148,7 @@ func (v *CreateVolumesInput) Validate() error {
}

if v.VolumeType != nil {
volumeTypeValidValues := []string{"0", "1", "2", "3"}
volumeTypeValidValues := []string{"0", "1", "2", "3", "4", "5", "10", "100", "200"}
volumeTypeParameterValue := fmt.Sprint(*v.VolumeType)

volumeTypeIsValid := false
Expand Down Expand Up @@ -262,7 +262,7 @@ type DescribeVolumesInput struct {
Tags []*string `json:"tags" name:"tags" location:"params"`
// Verbose's available values: 0, 1
Verbose *int `json:"verbose" name:"verbose" default:"0" location:"params"`
// VolumeType's available values: 0, 1, 2, 3, 5
// VolumeType's available values: 0, 1, 2, 3, 4, 5, 10, 100, 200
VolumeType *int `json:"volume_type" name:"volume_type" location:"params"`
Volumes []*string `json:"volumes" name:"volumes" location:"params"`
}
Expand Down Expand Up @@ -290,7 +290,7 @@ func (v *DescribeVolumesInput) Validate() error {
}

if v.VolumeType != nil {
volumeTypeValidValues := []string{"0", "1", "2", "3", "5"}
volumeTypeValidValues := []string{"0", "1", "2", "3", "4", "5", "10", "100", "200"}
volumeTypeParameterValue := fmt.Sprint(*v.VolumeType)

volumeTypeIsValid := false
Expand Down

0 comments on commit ecebf15

Please sign in to comment.