mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix: ServerCreateInput add deprecated sku field for backward
compatibility
This commit is contained in:
+12
-6
@@ -424,9 +424,6 @@ type ServerCreateInput struct {
|
||||
// swagger:ignore
|
||||
AutoPrepaidRecycle bool `json:"auto_prepaid_recycle,omitfalse"`
|
||||
|
||||
// 安全组Id, 此参数会和secgroups参数合并
|
||||
SecgroupId string `json:"secgrp_id"`
|
||||
|
||||
// 弹性公网IP带宽
|
||||
// 指定此参数后会创建新的弹性公网IP并绑定到新建的虚拟机
|
||||
// 私有云不支持此参数
|
||||
@@ -445,6 +442,8 @@ type ServerCreateInput struct {
|
||||
// required: false
|
||||
InstanceSnapshotId string `json:"instance_snapshot_id,omitempty"`
|
||||
|
||||
// 安全组Id, 此参数会和secgroups参数合并
|
||||
SecgroupId string `json:"secgrp_id"`
|
||||
// 安全组Id列表
|
||||
Secgroups []string `json:"secgroups"`
|
||||
|
||||
@@ -458,7 +457,8 @@ type ServerCreateInput struct {
|
||||
// swagger:ignore
|
||||
BillingCycle string `json:"billing_cycle"`
|
||||
|
||||
// DEPRECATE
|
||||
// swagger:ignore
|
||||
// Deprecated
|
||||
// 此参数等同于 hypervisor=baremetal
|
||||
Baremetal bool `json:"baremetal"`
|
||||
|
||||
@@ -469,8 +469,14 @@ type ServerCreateInput struct {
|
||||
// swagger:ignore
|
||||
DefaultStorageType string `json:"default_storage_type,omitempty"`
|
||||
|
||||
// Guest Image ID
|
||||
GuestImageID string
|
||||
// 指定用于新建主机的主机镜像ID
|
||||
GuestImageID string `json:"guest_image_id"`
|
||||
}
|
||||
|
||||
func (input *ServerCreateInput) AfterUnmarshal() {
|
||||
if input.Baremetal {
|
||||
input.Hypervisor = HYPERVISOR_BAREMETAL
|
||||
}
|
||||
}
|
||||
|
||||
type ServerCloneInput struct {
|
||||
|
||||
@@ -19,13 +19,13 @@ import (
|
||||
"strings"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/utils"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/sqlchemy"
|
||||
)
|
||||
|
||||
type SAdminSharableVirtualResourceBase struct {
|
||||
|
||||
@@ -22,13 +22,13 @@ import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/util/regutils"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/sqlchemy"
|
||||
)
|
||||
|
||||
type SBaremetalagentManager struct {
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/tristate"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
@@ -30,7 +31,6 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/util/conditionparser"
|
||||
"yunion.io/x/pkg/errors"
|
||||
)
|
||||
|
||||
type IDynamicResourceManager interface {
|
||||
|
||||
@@ -26,6 +26,7 @@ import (
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/gotypes"
|
||||
"yunion.io/x/pkg/util/compare"
|
||||
"yunion.io/x/sqlchemy"
|
||||
@@ -38,7 +39,6 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/pkg/errors"
|
||||
)
|
||||
|
||||
type SLoadbalancerAclEntry struct {
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
"context"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
@@ -25,7 +26,6 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/pkg/errors"
|
||||
)
|
||||
|
||||
type SRegionManager struct {
|
||||
|
||||
Reference in New Issue
Block a user