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

@@ -58,6 +58,7 @@ func flattenImage(d *schema.ResourceData, img *image.RecordImage) {
d.Set("sep_id", img.SepID)
d.Set("shared_with", img.SharedWith)
d.Set("size", img.Size)
d.Set("snapshot_id", img.SnapshotID)
d.Set("status", img.Status)
d.Set("tech_status", img.TechStatus)
d.Set("type", img.Type)

View File

@@ -169,7 +169,7 @@ func dataSourceImageExtendSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"present_to": {
Type: schema.TypeList,
Type: schema.TypeMap,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeInt,
@@ -198,6 +198,10 @@ func dataSourceImageExtendSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
"snapshot_id": {
Type: schema.TypeString,
Computed: true,
},
"status": {
Type: schema.TypeString,
Computed: true,

View File

@@ -68,8 +68,8 @@ func resourceImageSchemaMake(sch map[string]*schema.Schema) map[string]*schema.S
sch["type"] = &schema.Schema{
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"linux", "windows", "other"}, true),
Description: "Image type linux, windows or other",
ValidateFunc: validation.StringInSlice([]string{"linux", "windows", "unknown"}, true),
Description: "Image type linux, windows or unknown",
}
sch["hot_resize"] = &schema.Schema{

View File

@@ -90,9 +90,6 @@ func resourceImageFromBlankComputeCreate(ctx context.Context, d *schema.Resource
if accountId, ok := d.GetOk("account_id"); ok {
req.AccountID = uint64(accountId.(int))
}
if sepId, ok := d.GetOk("sep_id"); ok {
req.SepID = uint64(sepId.(int))
}
if poolName, ok := d.GetOk("pool_name"); ok {
req.PoolName = poolName.(string)
}
@@ -302,8 +299,8 @@ func resourceImageFromBlankComputeSchemaMake() map[string]*schema.Schema {
"type": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"linux", "windows", "other"}, true),
Description: "Image type linux, windows or other",
ValidateFunc: validation.StringInSlice([]string{"linux", "windows", "unknown"}, true),
Description: "Image type linux, windows or unknown",
},
"username": {
@@ -326,7 +323,6 @@ func resourceImageFromBlankComputeSchemaMake() map[string]*schema.Schema {
},
"sep_id": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "storage endpoint provider ID",
},
@@ -457,7 +453,7 @@ func resourceImageFromBlankComputeSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"present_to": {
Type: schema.TypeList,
Type: schema.TypeMap,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeInt,
@@ -482,6 +478,10 @@ func resourceImageFromBlankComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
"snapshot_id": {
Type: schema.TypeString,
Computed: true,
},
"status": {
Type: schema.TypeString,
Computed: true,

View File

@@ -93,9 +93,6 @@ func resourceImageFromPlatformDiskCreate(ctx context.Context, d *schema.Resource
if accountId, ok := d.GetOk("account_id"); ok {
req.AccountID = uint64(accountId.(int))
}
if sepId, ok := d.GetOk("sep_id"); ok {
req.SepID = uint64(sepId.(int))
}
if poolName, ok := d.GetOk("pool_name"); ok {
req.PoolName = poolName.(string)
}
@@ -292,8 +289,8 @@ func resourceImageFromPlatformDiskSchemaMake() map[string]*schema.Schema {
"type": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"linux", "windows", "other"}, true),
Description: "Image type linux, windows or other",
ValidateFunc: validation.StringInSlice([]string{"linux", "windows", "unknown"}, true),
Description: "Image type linux, windows or unknown",
},
"architecture": {
Type: schema.TypeString,
@@ -322,7 +319,6 @@ func resourceImageFromPlatformDiskSchemaMake() map[string]*schema.Schema {
},
"sep_id": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "storage endpoint provider ID",
},
@@ -454,7 +450,7 @@ func resourceImageFromPlatformDiskSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"present_to": {
Type: schema.TypeList,
Type: schema.TypeMap,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeInt,
@@ -479,6 +475,10 @@ func resourceImageFromPlatformDiskSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
"snapshot_id": {
Type: schema.TypeString,
Computed: true,
},
"status": {
Type: schema.TypeString,
Computed: true,