mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix(region): disk update disk type (#21160)
This commit is contained in:
@@ -174,7 +174,7 @@ func init() {
|
||||
Desc string `help:"Description" metavar:"DESCRIPTION"`
|
||||
AutoDelete string `help:"enable/disable auto delete of disk" choices:"enable|disable"`
|
||||
AutoSnapshot string `help:"enable/disable auto snapshot of disk" choices:"enable|disable"`
|
||||
DiskType string `help:"Disk type" choices:"data|volume"`
|
||||
DiskType string `help:"Disk type" choices:"data|volume|sys"`
|
||||
IsSsd *bool `help:"mark disk as ssd" negative:"no-is-ssd"`
|
||||
}
|
||||
R(&DiskUpdateOptions{}, "disk-update", "Update property of a virtual disk", func(s *mcclient.ClientSession, args *DiskUpdateOptions) error {
|
||||
|
||||
@@ -425,7 +425,7 @@ func (self *SDisk) ValidateUpdateData(ctx context.Context, userCred mcclient.Tok
|
||||
var err error
|
||||
|
||||
if input.DiskType != "" {
|
||||
if !utils.IsInStringArray(input.DiskType, []string{api.DISK_TYPE_DATA, api.DISK_TYPE_VOLUME}) {
|
||||
if !utils.IsInStringArray(input.DiskType, []string{api.DISK_TYPE_DATA, api.DISK_TYPE_VOLUME, api.DISK_TYPE_SYS}) {
|
||||
return input, httperrors.NewInputParameterError("not support update disk_type %s", input.DiskType)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user