This commit is contained in:
2025-05-21 16:38:25 +03:00
parent 2c70109d2d
commit 9e68edb2b9
1034 changed files with 73925 additions and 3187 deletions

View File

@@ -326,6 +326,10 @@ func dataSourceAccountSchemaMake() map[string]*schema.Schema {
Type: schema.TypeFloat,
Computed: true,
},
"desc": {
Type: schema.TypeString,
Computed: true,
},
"deleted_by": {
Type: schema.TypeString,
Computed: true,

View File

@@ -49,6 +49,7 @@ func flattenAccountList(al *account.ListAccounts) []map[string]interface{} {
"acl": flattenRgAcl(acc.ACL),
"compute_features": acc.ComputeFeatures,
"created_time": acc.CreatedTime,
"desc": acc.Description,
"deleted_time": acc.DeletedTime,
"account_id": acc.ID,
"account_name": acc.Name,
@@ -176,6 +177,10 @@ func dataSourceAccountListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
"desc": {
Type: schema.TypeString,
Computed: true,
},
"deleted_time": {
Type: schema.TypeInt,
Computed: true,

View File

@@ -50,6 +50,7 @@ func flattenAccountRGList(argl *account.ListRG) []map[string]interface{} {
"resources": flattenAccRGResources(arg.Resources),
"created_by": arg.CreatedBy,
"created_time": arg.CreatedTime,
"desc": arg.Description,
"deleted_by": arg.DeletedBy,
"deleted_time": arg.DeletedTime,
"rg_id": arg.RGID,
@@ -314,6 +315,10 @@ func dataSourceAccountRGListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
"desc": {
Type: schema.TypeString,
Computed: true,
},
"deleted_by": {
Type: schema.TypeString,
Computed: true,

View File

@@ -7,6 +7,7 @@ import (
func flattenAccount(d *schema.ResourceData, acc account.RecordAccount) error {
d.Set("dc_location", acc.DCLocation)
d.Set("desc", acc.Description)
// d.Set("resources", flattenAccResources(acc.Resources))
d.Set("ckey", acc.CKey)
d.Set("acl", flattenAccAcl(acc.ACL))
@@ -16,6 +17,7 @@ func flattenAccount(d *schema.ResourceData, acc account.RecordAccount) error {
d.Set("created_by", acc.CreatedBy)
d.Set("created_time", acc.CreatedTime)
d.Set("deactivation_time", acc.DeactivationTime)
d.Set("desc", acc.Description)
d.Set("deleted_by", acc.DeletedBy)
d.Set("deleted_time", acc.DeletedTime)
d.Set("displayname", acc.DisplayName)

View File

@@ -176,6 +176,7 @@ func resourceAccountUpdate(ctx context.Context, d *schema.ResourceData, m interf
if d.HasChange("enable") {
reqSwitch := account.DisableEnableRequest{
AccountID: accountId,
Reason: d.Get("reason").(string),
}
enable := d.Get("enable").(bool)
@@ -207,6 +208,11 @@ func resourceAccountUpdate(ctx context.Context, d *schema.ResourceData, m interf
updated = true
}
if d.HasChange("desc") {
req.Description = d.Get("desc").(string)
updated = true
}
if d.HasChange("resource_limits") {
resLimit := d.Get("resource_limits").([]interface{})[0]
resLimitConv := resLimit.(map[string]interface{})
@@ -394,10 +400,10 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
Required: true,
Description: "account name",
},
"username": {
"desc": {
Type: schema.TypeString,
Required: true,
Description: "username of owner the account",
Optional: true,
Description: "description",
},
"emailaddress": {
Type: schema.TypeString,
@@ -425,6 +431,11 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
},
},
},
"reason": {
Type: schema.TypeBool,
Optional: true,
Description: "reason for deactivation",
},
"restore": {
Type: schema.TypeBool,
Optional: true,