4.12.0
This commit is contained in:
@@ -88,6 +88,8 @@ func createVinsInAcc(ctx context.Context, d *schema.ResourceData, m interface{},
|
||||
req.ZoneID = uint64(zoneID.(int))
|
||||
}
|
||||
|
||||
req.EnableSecGroups = d.Get("enable_secgroups").(bool)
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
@@ -143,6 +145,8 @@ func createVinsInRG(ctx context.Context, d *schema.ResourceData, m interface{},
|
||||
req.ZoneID = uint64(zoneID.(int))
|
||||
}
|
||||
|
||||
req.EnableSecGroups = d.Get("enable_secgroups").(bool)
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -115,12 +115,6 @@ func resourceVinsCreate(ctx context.Context, d *schema.ResourceData, m interface
|
||||
}
|
||||
}
|
||||
|
||||
if d.Get("enable_secgroups").(bool) {
|
||||
if err := resourceVinsEnableSecgroups(ctx, d, m, vinsID); err != nil {
|
||||
warnings.Add(err)
|
||||
}
|
||||
}
|
||||
|
||||
return append(warnings.Get(), resourceVinsRead(ctx, d, m)...)
|
||||
}
|
||||
|
||||
@@ -437,21 +431,6 @@ func resourceVinsIpReserve(ctx context.Context, d *schema.ResourceData, m interf
|
||||
return errs
|
||||
}
|
||||
|
||||
func resourceVinsEnableSecgroups(ctx context.Context, d *schema.ResourceData, m interface{}, vinsID uint64) error {
|
||||
c := m.(*controller.ControllerCfg)
|
||||
|
||||
req := vins.UpdateRequest{
|
||||
VINSID: vinsID,
|
||||
EnableSecGroups: true,
|
||||
}
|
||||
|
||||
_, err := c.CloudBroker().VINS().Update(ctx, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func resourceVinsNatRuleAdd(ctx context.Context, d *schema.ResourceData, m interface{}, vinsId uint64) []error {
|
||||
var errs []error
|
||||
c := m.(*controller.ControllerCfg)
|
||||
|
||||
Reference in New Issue
Block a user