This commit is contained in:
2023-12-14 18:32:46 +03:00
parent 2453a32d01
commit ce4b847596
9 changed files with 220 additions and 261 deletions

View File

@@ -97,14 +97,13 @@ func resourceResgroupCreate(ctx context.Context, d *schema.ResourceData, m inter
setQuota = true
}
log.Debugf("resourceResgroupCreate: called by user %q for RG name %s, account ID %d",
c.GetDecortUsername(),
log.Debugf("resourceResgroupCreate: called for RG name %s, account ID %d",
// c.GetDecortUsername(),
rgName.(string), d.Get("account_id").(int))
req.AccountID = uint64(d.Get("account_id").(int))
req.Name = rgName.(string)
req.GID = uint64(location.DefaultGridID)
req.Owner = c.GetDecortUsername()
if setQuota {
req.MaxCPUCapacity = int64(quotaRecord.Cpu)
@@ -121,6 +120,11 @@ func resourceResgroupCreate(ctx context.Context, d *schema.ResourceData, m inter
d.Set("def_net_type", "PRIVATE")
}
owner, ok := d.GetOk("owner")
if ok {
req.Owner = owner.(string)
}
ipcidr, ok := d.GetOk("ipcidr")
if ok {
req.IPCIDR = ipcidr.(string)
@@ -658,6 +662,11 @@ func ResourceRgSchemaMake() map[string]*schema.Schema {
Description: "Address of the netowrk inside the private network segment (aka ViNS) if def_net_type=PRIVATE",
},
"owner": {
Type: schema.TypeString,
Optional: true,
},
"ext_net_id": {
Type: schema.TypeInt,
Optional: true,