This commit is contained in:
2026-02-11 13:02:14 +03:00
parent 069d63a65c
commit b8283ebfaf
277 changed files with 2184 additions and 4192 deletions

View File

@@ -58,6 +58,10 @@ func dataSourceZoneSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Required: true,
},
"auto_start": {
Type: schema.TypeBool,
Computed: true,
},
"guid": {
Type: schema.TypeInt,
Computed: true,

View File

@@ -115,6 +115,10 @@ func dataSourceZoneListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Required: true,
},
"auto_start": {
Type: schema.TypeBool,
Computed: true,
},
"guid": {
Type: schema.TypeInt,
Computed: true,

View File

@@ -59,6 +59,7 @@ func flattenZone(d *schema.ResourceData, item *zone.RecordZone) error {
d.Set("lb_ids", item.LBIDs)
d.Set("bservice_ids", item.BserviceIDs)
d.Set("k8s_ids", item.K8SIDs)
d.Set("auto_start", item.AutoStart)
log.Debugf("flattenZone: decoded RecordZone name %q / ID %d, complete",
item.Name, item.ID)
@@ -80,6 +81,7 @@ func flattenZoneList(zone *zone.ListZones) []map[string]interface{} {
"created_time": zone.CreatedTime,
"updated_time": zone.UpdatedTime,
"node_ids": zone.NodeIDs,
"auto_start": zone.AutoStart,
}
res = append(res, temp)
}

View File

@@ -56,6 +56,10 @@ func resourceZoneCreate(ctx context.Context, d *schema.ResourceData, m interface
Name: zoneName,
}
if aS, ok := d.GetOk("auto_start"); ok {
req.AutoStart = aS.(bool)
}
if desc, ok := d.GetOk("description"); ok {
req.Description = desc.(string)
}
@@ -113,7 +117,7 @@ func resourceZoneUpdate(ctx context.Context, d *schema.ResourceData, m interface
log.Debugf("resourceZoneUpdate: called Zone with id %d", zoneID)
if d.HasChanges("name", "description", "node_ids") {
if d.HasChanges("name", "description", "node_ids", "auto_start") {
if err := utilityZoneUpdate(ctx, d, m, zoneID); err != nil {
return diag.FromErr(err)
}
@@ -193,6 +197,11 @@ func resourceZoneSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
},
},
"auto_start": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
"zone_id": {
Type: schema.TypeInt,
Computed: true,

View File

@@ -65,7 +65,7 @@ func utilityZoneCheckPresence(ctx context.Context, d *schema.ResourceData, m int
func utilityZoneUpdate(ctx context.Context, d *schema.ResourceData, m interface{}, zoneID uint64) error {
c := m.(*controller.ControllerCfg)
if d.HasChanges("name", "description") {
if d.HasChanges("name", "description", "auto_start") {
req := zone.UpdateRequest{
ID: zoneID,
}
@@ -77,6 +77,10 @@ func utilityZoneUpdate(ctx context.Context, d *schema.ResourceData, m interface{
req.Description = d.Get("description").(string)
}
if d.HasChange("auto_start") {
req.AutoStart = d.Get("auto_start").(bool)
}
_, err := c.CloudBroker().Zone().Update(ctx, req)
if err != nil {
return err