This commit is contained in:
2024-11-12 13:41:38 +03:00
parent 040af43607
commit 36879efd58
517 changed files with 37877 additions and 1900 deletions

View File

@@ -86,9 +86,17 @@ func resourceSnapshotDelete(ctx context.Context, d *schema.ResourceData, m inter
Label: d.Get("label").(string),
}
_, err := c.CloudAPI().Compute().SnapshotDelete(ctx, req)
if err != nil {
return diag.FromErr(err)
asyncMode, ok := d.GetOk("delete_async_mode")
if ok && asyncMode.(bool) {
_, err := c.CloudAPI().Compute().SnapshotDeleteAsync(ctx, req)
if err != nil {
return diag.FromErr(err)
}
} else {
_, err := c.CloudAPI().Compute().SnapshotDelete(ctx, req)
if err != nil {
return diag.FromErr(err)
}
}
d.SetId("")
@@ -160,6 +168,11 @@ func resourceSnapshotSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "timestamp",
},
"delete_async_mode": {
Type: schema.TypeBool,
Computed: true,
Description: "async mode",
},
}
}