mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region,climc): eips: rename arg name for requested eip addr
This commit is contained in:
@@ -50,7 +50,7 @@ func init() {
|
||||
Manager string `help:"cloud provider"`
|
||||
Region string `help:"cloud region in which EIP is allocated"`
|
||||
Bandwidth int `help:"Bandwidth in Mbps"`
|
||||
Ip string `help:"IP address of the EIP"`
|
||||
IpAddr string `help:"IP address of the EIP" json:"ip_addr"`
|
||||
Network string `help:"Network of the EIP"`
|
||||
BgpType string `help:"BgpType of the EIP" positional:"false"`
|
||||
ChargeType string `help:"bandwidth charge type" choices:"traffic|bandwidth"`
|
||||
@@ -79,8 +79,8 @@ func init() {
|
||||
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
|
||||
}
|
||||
|
||||
if len(args.Ip) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Ip), "ip")
|
||||
if len(args.IpAddr) > 0 {
|
||||
params.Add(jsonutils.NewString(args.IpAddr), "ip_addr")
|
||||
}
|
||||
|
||||
result, err := modules.Elasticips.Create(s, params)
|
||||
|
||||
@@ -67,6 +67,8 @@ type SElasticipCreateInput struct {
|
||||
// 子网Id
|
||||
// 私有云创建此参数必传,例如Openstack, ZStack
|
||||
NetworkId string `json:"network_id"`
|
||||
// 指定新建EIP的地址
|
||||
IpAddr string `json:"ip_addr"`
|
||||
|
||||
// description: BgpType for the new eip
|
||||
BgpType string `json:"bgp_type"`
|
||||
|
||||
@@ -85,7 +85,7 @@ type SElasticip struct {
|
||||
Mode string `width:"32" charset:"ascii" get:"user" list:"user" create:"optional"`
|
||||
|
||||
// IP地址
|
||||
IpAddr string `width:"17" charset:"ascii" list:"user" create:"optional"`
|
||||
IpAddr string `width:"17" charset:"ascii" list:"user"`
|
||||
|
||||
// 绑定资源类型
|
||||
AssociateType string `width:"32" charset:"ascii" list:"user"`
|
||||
|
||||
@@ -82,7 +82,7 @@ func (self *EipAllocateTask) OnInit(ctx context.Context, obj db.IStandaloneModel
|
||||
return
|
||||
}
|
||||
network := _network.(*models.SNetwork)
|
||||
reqIp, _ := self.GetParams().GetString("ip")
|
||||
reqIp, _ := self.GetParams().GetString("ip_addr")
|
||||
if reqIp != "" || !eipIsManaged {
|
||||
lockman.LockObject(ctx, network)
|
||||
defer lockman.ReleaseObject(ctx, network)
|
||||
|
||||
Reference in New Issue
Block a user