4.11.0
This commit is contained in:
@@ -80,6 +80,10 @@ func dataSourceDiskSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"blk_discard": {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
// "boot_partition": {
|
||||
// Type: schema.TypeInt,
|
||||
// Computed: true,
|
||||
@@ -382,6 +386,10 @@ func dataSourceDiskSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"cache": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"size_available": {
|
||||
Type: schema.TypeFloat,
|
||||
Computed: true,
|
||||
|
||||
@@ -147,6 +147,10 @@ func dataSourceDiskListSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"blk_discard": {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
// "boot_partition": {
|
||||
// Type: schema.TypeInt,
|
||||
// Computed: true,
|
||||
@@ -456,6 +460,10 @@ func dataSourceDiskListSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"cache": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"size_available": {
|
||||
Type: schema.TypeFloat,
|
||||
Computed: true,
|
||||
|
||||
@@ -138,11 +138,6 @@ func dataSourceDiskListUnattachedSchemaMake() map[string]*schema.Schema {
|
||||
Computed: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"_ckey": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "CKey",
|
||||
},
|
||||
"_meta": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
@@ -165,6 +160,10 @@ func dataSourceDiskListUnattachedSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"blk_discard": {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"boot_partition": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
@@ -391,6 +390,11 @@ func dataSourceDiskListUnattachedSchemaMake() map[string]*schema.Schema {
|
||||
Computed: true,
|
||||
Description: "shareable",
|
||||
},
|
||||
"cache": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "Cache mode for the disk",
|
||||
},
|
||||
"size_max": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
|
||||
@@ -128,6 +128,10 @@ func dataSourceDiskDeletedListSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"blk_discard": {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
// "boot_partition": {
|
||||
// Type: schema.TypeInt,
|
||||
// Computed: true,
|
||||
@@ -437,6 +441,10 @@ func dataSourceDiskDeletedListSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"cache": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"size_available": {
|
||||
Type: schema.TypeFloat,
|
||||
Computed: true,
|
||||
|
||||
@@ -21,11 +21,11 @@ func flattenDiskListUnattached(ul *disks.ListDisksUnattached) []map[string]inter
|
||||
for _, unattachedDisk := range ul.Data {
|
||||
unattachedDiskAcl, _ := json.Marshal(unattachedDisk.ACL)
|
||||
tmp := map[string]interface{}{
|
||||
"_ckey": unattachedDisk.CKey,
|
||||
"_meta": flattens.FlattenMeta(unattachedDisk.Meta),
|
||||
"account_id": unattachedDisk.AccountID,
|
||||
"account_name": unattachedDisk.AccountName,
|
||||
"acl": string(unattachedDiskAcl),
|
||||
"blk_discard": unattachedDisk.BLKDiscard,
|
||||
"boot_partition": unattachedDisk.BootPartition,
|
||||
"created_time": unattachedDisk.CreatedTime,
|
||||
"deleted_time": unattachedDisk.DeletedTime,
|
||||
@@ -57,6 +57,7 @@ func flattenDiskListUnattached(ul *disks.ListDisksUnattached) []map[string]inter
|
||||
"role": unattachedDisk.Role,
|
||||
"sep_id": unattachedDisk.SEPID,
|
||||
"shareable": unattachedDisk.Shareable,
|
||||
"cache": unattachedDisk.Cache,
|
||||
"size_max": unattachedDisk.SizeMax,
|
||||
"size_used": unattachedDisk.SizeUsed,
|
||||
"snapshots": flattenDiskSnapshotList(unattachedDisk.Snapshots),
|
||||
@@ -75,6 +76,7 @@ func flattenDisk(d *schema.ResourceData, disk *disks.RecordDisk) {
|
||||
d.Set("account_id", disk.AccountID)
|
||||
d.Set("account_name", disk.AccountName)
|
||||
d.Set("acl", string(diskAcl))
|
||||
d.Set("blk_discard", disk.BLKDiscard)
|
||||
// d.Set("boot_partition", disk.BootPartition)
|
||||
d.Set("computes", flattenDiskComputes(disk.Computes))
|
||||
d.Set("created_by", disk.CreatedBy)
|
||||
@@ -95,7 +97,6 @@ func flattenDisk(d *schema.ResourceData, disk *disks.RecordDisk) {
|
||||
// d.Set("login", disk.Login)
|
||||
d.Set("machine_id", disk.MachineID)
|
||||
d.Set("machine_name", disk.MachineName)
|
||||
d.Set("milestones", disk.Milestones)
|
||||
d.Set("disk_name", disk.Name)
|
||||
d.Set("order", disk.Order)
|
||||
d.Set("params", disk.Params)
|
||||
@@ -114,10 +115,10 @@ func flattenDisk(d *schema.ResourceData, disk *disks.RecordDisk) {
|
||||
d.Set("role", disk.Role)
|
||||
d.Set("sep_id", disk.SepID)
|
||||
d.Set("sep_type", disk.SepType)
|
||||
d.Set("size_available", disk.SizeAvailable)
|
||||
d.Set("size_max", disk.SizeMax)
|
||||
d.Set("size_used", disk.SizeUsed)
|
||||
d.Set("shareable", disk.Shareable)
|
||||
d.Set("cache", disk.Cache)
|
||||
d.Set("snapshots", flattenDiskSnapshotList(disk.Snapshots))
|
||||
d.Set("status", disk.Status)
|
||||
d.Set("storage_policy_id", disk.StoragePolicyID)
|
||||
@@ -186,6 +187,7 @@ func flattenDiskReplica(d *schema.ResourceData, disk *disks.RecordDisk, statusRe
|
||||
d.Set("size_max", disk.SizeMax)
|
||||
d.Set("size_used", disk.SizeUsed)
|
||||
d.Set("shareable", disk.Shareable)
|
||||
d.Set("cache", disk.Cache)
|
||||
d.Set("snapshots", flattenDiskSnapshotList(disk.Snapshots))
|
||||
d.Set("status", disk.Status)
|
||||
d.Set("status_replication", statusReplication)
|
||||
@@ -219,6 +221,7 @@ func flattenDiskList(dl *disks.ListDisks) []map[string]interface{} {
|
||||
"account_id": disk.AccountID,
|
||||
"account_name": disk.AccountName,
|
||||
"acl": string(diskAcl),
|
||||
"blk_discard": disk.BLKDiscard,
|
||||
"computes": flattenDiskComputes(disk.Computes),
|
||||
"created_by": disk.CreatedBy,
|
||||
"created_time": disk.CreatedTime,
|
||||
@@ -250,6 +253,7 @@ func flattenDiskList(dl *disks.ListDisks) []map[string]interface{} {
|
||||
"sep_id": disk.SepID,
|
||||
"sep_type": disk.SepType,
|
||||
"shareable": disk.Shareable,
|
||||
"cache": disk.Cache,
|
||||
"size_available": disk.SizeAvailable,
|
||||
"size_max": disk.SizeMax,
|
||||
"size_used": disk.SizeUsed,
|
||||
|
||||
@@ -533,6 +533,10 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"cache": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
// "boot_partition": {
|
||||
// Type: schema.TypeInt,
|
||||
// Computed: true,
|
||||
|
||||
@@ -133,7 +133,7 @@ func resourceDiskSnapshotUpdate(ctx context.Context, d *schema.ResourceData, m i
|
||||
TimeStamp: uint64(d.Get("timestamp").(int)),
|
||||
}
|
||||
|
||||
log.Debugf("resourceDiskUpdtae: Snapshot rollback with label", label)
|
||||
log.Debugf("resourceDiskUpdtae: Snapshot rollback with label %s", label)
|
||||
_, err := c.CloudAPI().Disks().SnapshotRollback(ctx, req)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
|
||||
Reference in New Issue
Block a user