This commit is contained in:
asteam
2025-06-16 14:17:01 +03:00
parent 9e68edb2b9
commit e04dab77cb
4880 changed files with 97 additions and 535839 deletions

View File

@@ -22,6 +22,7 @@ func flattenResourceAccount(d *schema.ResourceData, acc *account.RecordAccount)
d.Set("deleted_by", acc.DeletedBy)
d.Set("deleted_time", acc.DeletedTime)
d.Set("displayname", acc.DisplayName)
d.Set("enable", flattenEnabled(acc.Status))
d.Set("guid", acc.GUID)
d.Set("account_id", acc.ID)
d.Set("account_name", acc.Name)
@@ -422,3 +423,7 @@ func flattenAccResourceConsumption(lrc *account.ListResources) []map[string]inte
}
return res
}
func flattenEnabled(status string) bool {
return status == "CONFIRMED"
}

View File

@@ -78,7 +78,7 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
Description: "Share images with account",
},
"reason": {
Type: schema.TypeBool,
Type: schema.TypeString,
Optional: true,
Description: "reason for restore or deactivation",
},

View File

@@ -81,7 +81,7 @@ func utilityAccountEnableUpdate(ctx context.Context, d *schema.ResourceData, m i
if err != nil {
return err
}
} else if !enable && acc.Status == status.Enabled {
} else if !enable && acc.Status == status.Confirmed {
_, err := c.CloudBroker().Account().Disable(ctx, account.DisableRequest{
AccountID: acc.ID,
})