mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
networks: server_type: do not allow update
Transition between guest, baremetal, ipmi, eip, etc. all requires sanity checks on relevant types allocated from the network
This commit is contained in:
@@ -316,10 +316,6 @@ type NetworkUpdateInput struct {
|
||||
|
||||
VlanId *int `json:"vlan_id"`
|
||||
|
||||
// 服务器类型
|
||||
// example: server
|
||||
ServerType string `json:"server_type"`
|
||||
|
||||
// 分配策略
|
||||
AllocPolicy string `json:"alloc_policy"`
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ type SNetwork struct {
|
||||
|
||||
// 服务器类型
|
||||
// example: server
|
||||
ServerType string `width:"16" charset:"ascii" default:"guest" nullable:"true" list:"user" update:"user" create:"optional"`
|
||||
ServerType string `width:"16" charset:"ascii" default:"guest" nullable:"true" list:"user" create:"optional"`
|
||||
|
||||
// 分配策略
|
||||
AllocPolicy string `width:"16" charset:"ascii" nullable:"true" get:"user" update:"user" create:"optional"`
|
||||
|
||||
@@ -58,7 +58,6 @@ func (opts *NetworkListOptions) Params() (jsonutils.JSONObject, error) {
|
||||
type NetworkUpdateOptions struct {
|
||||
BaseUpdateOptions
|
||||
|
||||
ServerType string `help:"server type," choices:"baremetal|container|eip|guest|ipmi|pxe"`
|
||||
StartIp string `help:"Start ip"`
|
||||
EndIp string `help:"end ip"`
|
||||
NetMask int64 `help:"Netmask"`
|
||||
@@ -80,9 +79,6 @@ func (opts *NetworkUpdateOptions) Params() (jsonutils.JSONObject, error) {
|
||||
if len(opts.Desc) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.Desc), "description")
|
||||
}
|
||||
if len(opts.ServerType) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.ServerType), "server_type")
|
||||
}
|
||||
if len(opts.StartIp) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.StartIp), "guest_ip_start")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user