diff --git a/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go b/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go index 84500c05d0..004cffea82 100644 --- a/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go +++ b/ibm/service/power/data_source_ibm_pi_storage_pool_capacity.go @@ -6,58 +6,53 @@ package power import ( "context" "fmt" - "log" - st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" - - "github.com/IBM-Cloud/power-go-client/helpers" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -const ( - PIPoolName = "pi_storage_pool" -) - func DataSourceIBMPIStoragePoolCapacity() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIStoragePoolCapacityRead, Schema: map[string]*schema.Schema{ - helpers.PICloudInstanceId: { - Type: schema.TypeString, + // Arguments + Arg_CloudInstanceID: { + Description: "The GUID of the service instance associated with an account.", Required: true, + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, }, - PIPoolName: { - Type: schema.TypeString, + Arg_StoragePool: { + Description: "The storage pool name.", Required: true, + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, - Description: "Storage pool name", }, - // Computed Attributes - MaxAllocationSize: { - Type: schema.TypeInt, + + // Attributes + Attr_MaxAllocationSize: { Computed: true, - Description: "Maximum allocation storage size (GB)", + Description: "Maximum allocation storage size (GB).", + Type: schema.TypeInt, }, - StorageType: { - Type: schema.TypeString, + Attr_ReplicationEnabled: { Computed: true, - Description: "Storage type of the storage pool", + Description: "Replication status of the storage pool.", + Type: schema.TypeBool, }, - TotalCapacity: { - Type: schema.TypeInt, + Attr_StorageType: { Computed: true, - Description: "Total pool capacity (GB)", + Description: "Storage type of the storage pool.", + Type: schema.TypeString, }, - ReplicationEnabled: { - Type: schema.TypeBool, + Attr_TotalCapacity: { Computed: true, - Description: "Replication status of the storage pool", + Description: "Total pool capacity (GB).", + Type: schema.TypeInt, }, }, } @@ -69,10 +64,10 @@ func dataSourceIBMPIStoragePoolCapacityRead(ctx context.Context, d *schema.Resou return diag.FromErr(err) } - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) - storagePool := d.Get(PIPoolName).(string) + cloudInstanceID := d.Get(Arg_CloudInstanceID).(string) + storagePool := d.Get(Arg_StoragePool).(string) - client := st.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) + client := instance.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) sp, err := client.GetStoragePoolCapacity(storagePool) if err != nil { log.Printf("[ERROR] get storage pool capacity failed %v", err) @@ -80,9 +75,9 @@ func dataSourceIBMPIStoragePoolCapacityRead(ctx context.Context, d *schema.Resou } d.SetId(fmt.Sprintf("%s/%s", cloudInstanceID, storagePool)) - d.Set(MaxAllocationSize, *sp.MaxAllocationSize) - d.Set(StorageType, sp.StorageType) - d.Set(TotalCapacity, sp.TotalCapacity) - d.Set(ReplicationEnabled, *sp.ReplicationEnabled) + d.Set(Attr_MaxAllocationSize, *sp.MaxAllocationSize) + d.Set(Attr_ReplicationEnabled, *sp.ReplicationEnabled) + d.Set(Attr_StorageType, sp.StorageType) + d.Set(Attr_TotalCapacity, sp.TotalCapacity) return nil } diff --git a/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go b/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go index 4e64ec5209..6c5ac36fd4 100644 --- a/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go +++ b/ibm/service/power/data_source_ibm_pi_storage_pools_capacity.go @@ -5,95 +5,82 @@ package power import ( "context" - "log" - st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" - - "github.com/IBM-Cloud/power-go-client/helpers" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -const ( - MaximumStorageAllocation = "maximum_storage_allocation" - StoragePoolsCapacity = "storage_pools_capacity" - MaxAllocationSize = "max_allocation_size" - PoolName = "pool_name" - StoragePool = "storage_pool" - StorageType = "storage_type" - TotalCapacity = "total_capacity" - ReplicationEnabled = "replication_enabled" -) - func DataSourceIBMPIStoragePoolsCapacity() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIStoragePoolsCapacityRead, Schema: map[string]*schema.Schema{ - helpers.PICloudInstanceId: { - Type: schema.TypeString, + // Arguments + Arg_CloudInstanceID: { + Description: "The GUID of the service instance associated with an account.", Required: true, + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, }, - // Computed Attributes - MaximumStorageAllocation: { - Type: schema.TypeMap, + + // Attributes + Attr_MaximumStorageAllocation: { Computed: true, - Description: "Maximum storage allocation", + Description: "Maximum storage allocation.", + Type: schema.TypeMap, }, - StoragePoolsCapacity: { - Type: schema.TypeList, + Attr_StoragePoolsCapacity: { Computed: true, - Description: "Storage pools capacity", + Description: "List of storage pools capacity.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - MaxAllocationSize: { - Type: schema.TypeInt, + Attr_MaxAllocationSize: { Computed: true, - Description: "Maximum allocation storage size (GB)", + Description: "Maximum allocation storage size (GB).", + Type: schema.TypeInt, }, - PoolName: { - Type: schema.TypeString, + Attr_PoolName: { Computed: true, - Description: "Pool name", - }, - StorageType: { + Description: "The pool name.", Type: schema.TypeString, + }, + Attr_ReplicationEnabled: { Computed: true, - Description: "Storage type of the storage pool", + Description: "Replication status of the storage pool.", + Type: schema.TypeBool, }, - TotalCapacity: { - Type: schema.TypeInt, + Attr_StorageType: { Computed: true, - Description: "Total pool capacity (GB)", + Description: "Storage type of the storage pool.", + Type: schema.TypeString, }, - ReplicationEnabled: { - Type: schema.TypeBool, + Attr_TotalCapacity: { Computed: true, - Description: "Replication status of the storage pool", + Description: "Total pool capacity (GB).", + Type: schema.TypeInt, }, }, }, + Type: schema.TypeList, }, }, } } func dataSourceIBMPIStoragePoolsCapacityRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - sess, err := meta.(conns.ClientSession).IBMPISession() if err != nil { return diag.FromErr(err) } - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + cloudInstanceID := d.Get(Arg_CloudInstanceID).(string) - client := st.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) + client := instance.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) spc, err := client.GetAllStoragePoolsCapacity() if err != nil { log.Printf("[ERROR] get all storage pools capacity failed %v", err) @@ -106,26 +93,25 @@ func dataSourceIBMPIStoragePoolsCapacityRead(ctx context.Context, d *schema.Reso if spc.MaximumStorageAllocation != nil { msa := spc.MaximumStorageAllocation data := map[string]interface{}{ - MaxAllocationSize: *msa.MaxAllocationSize, - StoragePool: *msa.StoragePool, - StorageType: *msa.StorageType, + Attr_MaxAllocationSize: *msa.MaxAllocationSize, + Attr_StoragePool: *msa.StoragePool, + Attr_StorageType: *msa.StorageType, } - d.Set(MaximumStorageAllocation, flex.Flatten(data)) + d.Set(Attr_MaximumStorageAllocation, flex.Flatten(data)) } result := make([]map[string]interface{}, 0, len(spc.StoragePoolsCapacity)) for _, sp := range spc.StoragePoolsCapacity { data := map[string]interface{}{ - MaxAllocationSize: *sp.MaxAllocationSize, - PoolName: sp.PoolName, - StorageType: sp.StorageType, - TotalCapacity: sp.TotalCapacity, - ReplicationEnabled: *sp.ReplicationEnabled, + Attr_MaxAllocationSize: *sp.MaxAllocationSize, + Attr_PoolName: sp.PoolName, + Attr_ReplicationEnabled: *sp.ReplicationEnabled, + Attr_StorageType: sp.StorageType, + Attr_TotalCapacity: sp.TotalCapacity, } - result = append(result, data) } - d.Set(StoragePoolsCapacity, result) + d.Set(Attr_StoragePoolsCapacity, result) return nil } diff --git a/ibm/service/power/data_source_ibm_pi_storage_type_capacity.go b/ibm/service/power/data_source_ibm_pi_storage_type_capacity.go index d33d338ff1..0c66f566f5 100644 --- a/ibm/service/power/data_source_ibm_pi_storage_type_capacity.go +++ b/ibm/service/power/data_source_ibm_pi_storage_type_capacity.go @@ -6,73 +6,68 @@ package power import ( "context" "fmt" - "log" - st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" - - "github.com/IBM-Cloud/power-go-client/helpers" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -const ( - PITypeName = "pi_storage_type" -) - func DataSourceIBMPIStorageTypeCapacity() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIStorageTypeCapacityRead, Schema: map[string]*schema.Schema{ - helpers.PICloudInstanceId: { - Type: schema.TypeString, + // Arguments + Arg_CloudInstanceID: { + Description: "The GUID of the service instance associated with an account.", Required: true, + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, }, - PITypeName: { - Type: schema.TypeString, + Arg_StorageType: { + Description: "The storage type name.", Required: true, + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, - Description: "Storage type name", }, - // Computed Attributes - MaximumStorageAllocation: { - Type: schema.TypeMap, + + // Attributes + Attr_MaximumStorageAllocation: { Computed: true, - Description: "Maximum storage allocation", + Description: "Maximum storage allocation.", + Type: schema.TypeMap, }, - StoragePoolsCapacity: { - Type: schema.TypeList, + Attr_StoragePoolsCapacity: { Computed: true, - Description: "Storage pools capacity", + Description: "List of storage pools capacity.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - MaxAllocationSize: { - Type: schema.TypeInt, + Attr_MaxAllocationSize: { Computed: true, - Description: "Maximum allocation storage size (GB)", + Description: "Maximum allocation storage size (GB).", + Type: schema.TypeInt, }, - PoolName: { - Type: schema.TypeString, + Attr_PoolName: { Computed: true, - Description: "Pool name", - }, - StorageType: { + Description: "The pool name", Type: schema.TypeString, + }, + Attr_StorageType: { Computed: true, - Description: "Storage type of the storage pool", + Description: "Storage type of the storage pool.", + Type: schema.TypeString, }, - TotalCapacity: { - Type: schema.TypeInt, + Attr_TotalCapacity: { Computed: true, - Description: "Total pool capacity (GB)", + Description: "Total pool capacity (GB).", + Type: schema.TypeInt, }, }, }, + Type: schema.TypeList, }, }, } @@ -84,10 +79,10 @@ func dataSourceIBMPIStorageTypeCapacityRead(ctx context.Context, d *schema.Resou return diag.FromErr(err) } - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) - storageType := d.Get(PITypeName).(string) + cloudInstanceID := d.Get(Arg_CloudInstanceID).(string) + storageType := d.Get(Arg_StorageType).(string) - client := st.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) + client := instance.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) stc, err := client.GetStorageTypeCapacity(storageType) if err != nil { log.Printf("[ERROR] get storage type capacity failed %v", err) @@ -99,24 +94,24 @@ func dataSourceIBMPIStorageTypeCapacityRead(ctx context.Context, d *schema.Resou if stc.MaximumStorageAllocation != nil { msa := stc.MaximumStorageAllocation data := map[string]interface{}{ - MaxAllocationSize: *msa.MaxAllocationSize, - StoragePool: *msa.StoragePool, - StorageType: *msa.StorageType, + Attr_MaxAllocationSize: *msa.MaxAllocationSize, + Attr_StoragePool: *msa.StoragePool, + Attr_StorageType: *msa.StorageType, } - d.Set(MaximumStorageAllocation, flex.Flatten(data)) + d.Set(Attr_MaximumStorageAllocation, flex.Flatten(data)) } result := make([]map[string]interface{}, 0, len(stc.StoragePoolsCapacity)) for _, sp := range stc.StoragePoolsCapacity { data := map[string]interface{}{ - MaxAllocationSize: *sp.MaxAllocationSize, - PoolName: sp.PoolName, - StorageType: sp.StorageType, - TotalCapacity: sp.TotalCapacity, + Attr_MaxAllocationSize: *sp.MaxAllocationSize, + Attr_PoolName: sp.PoolName, + Attr_StorageType: sp.StorageType, + Attr_TotalCapacity: sp.TotalCapacity, } result = append(result, data) } - d.Set(StoragePoolsCapacity, result) + d.Set(Attr_StoragePoolsCapacity, result) return nil } diff --git a/ibm/service/power/data_source_ibm_pi_storage_types_capacity.go b/ibm/service/power/data_source_ibm_pi_storage_types_capacity.go index 59feb27952..9ab4950012 100644 --- a/ibm/service/power/data_source_ibm_pi_storage_types_capacity.go +++ b/ibm/service/power/data_source_ibm_pi_storage_types_capacity.go @@ -5,84 +5,79 @@ package power import ( "context" - "log" - st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" - - "github.com/IBM-Cloud/power-go-client/helpers" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -const ( - StorageTypesCapacity = "storage_types_capacity" -) - func DataSourceIBMPIStorageTypesCapacity() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIStorageTypesCapacityRead, Schema: map[string]*schema.Schema{ - helpers.PICloudInstanceId: { - Type: schema.TypeString, + // Arguments + Arg_CloudInstanceID: { + Description: "The GUID of the service instance associated with an account.", Required: true, + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, }, - // Computed Attributes - MaximumStorageAllocation: { - Type: schema.TypeMap, + + // Attributes + Attr_MaximumStorageAllocation: { Computed: true, - Description: "Maximum storage allocation", + Description: "Maximum storage allocation.", + Type: schema.TypeMap, }, - StorageTypesCapacity: { + Attr_StorageTypesCapacity: { Type: schema.TypeList, Computed: true, - Description: "Storage types capacity", + Description: "List of storage types capacity.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - MaximumStorageAllocation: { - Type: schema.TypeMap, + Attr_MaximumStorageAllocation: { Computed: true, - Description: "Maximum storage allocation", + Description: "Maximum storage allocation.", + Type: schema.TypeMap, }, - StoragePoolsCapacity: { - Type: schema.TypeList, + Attr_StoragePoolsCapacity: { Computed: true, - Description: "Storage pools capacity", + Description: "List of storage types capacity.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - MaxAllocationSize: { - Type: schema.TypeInt, + Attr_MaxAllocationSize: { Computed: true, - Description: "Maximum allocation storage size (GB)", + Description: "Maximum allocation storage size (GB).", + Type: schema.TypeInt, }, - PoolName: { - Type: schema.TypeString, + Attr_PoolName: { Computed: true, - Description: "Pool name", - }, - StorageType: { + Description: "The pool name.", Type: schema.TypeString, + }, + Attr_StorageType: { Computed: true, - Description: "Storage type of the storage pool", + Description: "Storage type of the storage pool.", + Type: schema.TypeString, }, - TotalCapacity: { - Type: schema.TypeInt, + Attr_TotalCapacity: { Computed: true, - Description: "Total pool capacity (GB)", + Description: "Total pool capacity (GB).", + Type: schema.TypeInt, }, }, }, + Type: schema.TypeList, }, - StorageType: { - Type: schema.TypeString, + Attr_StorageType: { Computed: true, - Description: "The storage type", + Description: "The storage type.", + Type: schema.TypeString, }, }, }, @@ -97,9 +92,9 @@ func dataSourceIBMPIStorageTypesCapacityRead(ctx context.Context, d *schema.Reso return diag.FromErr(err) } - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + cloudInstanceID := d.Get(Arg_CloudInstanceID).(string) - client := st.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) + client := instance.NewIBMPIStorageCapacityClient(ctx, sess, cloudInstanceID) stc, err := client.GetAllStorageTypesCapacity() if err != nil { log.Printf("[ERROR] get all storage types capacity failed %v", err) @@ -112,11 +107,11 @@ func dataSourceIBMPIStorageTypesCapacityRead(ctx context.Context, d *schema.Reso if stc.MaximumStorageAllocation != nil { msa := stc.MaximumStorageAllocation data := map[string]interface{}{ - MaxAllocationSize: *msa.MaxAllocationSize, - StoragePool: *msa.StoragePool, - StorageType: *msa.StorageType, + Attr_MaxAllocationSize: *msa.MaxAllocationSize, + Attr_StoragePool: *msa.StoragePool, + Attr_StorageType: *msa.StorageType, } - d.Set(MaximumStorageAllocation, flex.Flatten(data)) + d.Set(Attr_MaximumStorageAllocation, flex.Flatten(data)) } stcResult := make([]map[string]interface{}, 0, len(stc.StorageTypesCapacity)) for _, st := range stc.StorageTypesCapacity { @@ -124,28 +119,28 @@ func dataSourceIBMPIStorageTypesCapacityRead(ctx context.Context, d *schema.Reso if st.MaximumStorageAllocation != nil { msa := st.MaximumStorageAllocation data := map[string]interface{}{ - MaxAllocationSize: *msa.MaxAllocationSize, - StoragePool: *msa.StoragePool, - StorageType: *msa.StorageType, + Attr_MaxAllocationSize: *msa.MaxAllocationSize, + Attr_StoragePool: *msa.StoragePool, + Attr_StorageType: *msa.StorageType, } - stResult[MaximumStorageAllocation] = flex.Flatten(data) + stResult[Attr_MaximumStorageAllocation] = flex.Flatten(data) } spc := make([]map[string]interface{}, 0, len(st.StoragePoolsCapacity)) for _, sp := range st.StoragePoolsCapacity { data := map[string]interface{}{ - MaxAllocationSize: *sp.MaxAllocationSize, - PoolName: sp.PoolName, - StorageType: sp.StorageType, - TotalCapacity: sp.TotalCapacity, + Attr_MaxAllocationSize: *sp.MaxAllocationSize, + Attr_PoolName: sp.PoolName, + Attr_StorageType: sp.StorageType, + Attr_TotalCapacity: sp.TotalCapacity, } spc = append(spc, data) } - stResult[StoragePoolsCapacity] = spc - stResult[StorageType] = st.StorageType + stResult[Attr_StoragePoolsCapacity] = spc + stResult[Attr_StorageType] = st.StorageType stcResult = append(stcResult, stResult) } - d.Set(StorageTypesCapacity, stcResult) + d.Set(Attr_StorageTypesCapacity, stcResult) return nil } diff --git a/ibm/service/power/data_source_ibm_pi_system_pools.go b/ibm/service/power/data_source_ibm_pi_system_pools.go index 7e2f52b633..f1664e0bc6 100644 --- a/ibm/service/power/data_source_ibm_pi_system_pools.go +++ b/ibm/service/power/data_source_ibm_pi_system_pools.go @@ -5,121 +5,100 @@ package power import ( "context" - "log" - st "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/power/models" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" - - "github.com/IBM-Cloud/power-go-client/helpers" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -const ( - SystemPoolName = "system_pool_name" - SystemPools = "system_pools" - SystemPool = "system_pool" - Capacity = "capacity" - CoreMemoryRatio = "core_memory_ratio" - MaxAvailable = "max_available" - MaxCoresAvailable = "max_cores_available" - MaxMemoryAvailable = "max_memory_available" - SharedCoreRatio = "shared_core_ratio" - Type = "type" - Systems = "systems" - Cores = "cores" - ID = "id" - Memory = "memory" - Default = "default" - Max = "max" - Min = "min" -) - func DataSourceIBMPISystemPools() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPISystemPoolsRead, Schema: map[string]*schema.Schema{ - helpers.PICloudInstanceId: { - Type: schema.TypeString, + // Arguments + Arg_CloudInstanceID: { + Description: "The GUID of the service instance associated with an account.", Required: true, + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, }, - // Computed Attributes - SystemPools: { + + // Attributes + Attr_SystemPools: { Type: schema.TypeList, Computed: true, - Description: "List of available system pools within a particular DataCenter", + Description: "List of available system pools within a particular Datacenter.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - SystemPoolName: { - Type: schema.TypeString, + Attr_Capacity: { Computed: true, - Description: "The system pool name", - }, - Capacity: { + Description: "Advertised capacity cores and memory (GB).", Type: schema.TypeMap, - Computed: true, - Description: "Advertised capacity cores and memory (GB)", }, - CoreMemoryRatio: { - Type: schema.TypeFloat, + Attr_CoreMemoryRatio: { Computed: true, - Description: "Processor to Memory (GB) Ratio", + Description: "Processor to Memory (GB) Ratio.", + Type: schema.TypeFloat, }, - MaxAvailable: { - Type: schema.TypeMap, + Attr_MaxAvailable: { Computed: true, - Description: "Maximum configurable cores and memory (GB) (aggregated from all hosts)", - }, - MaxCoresAvailable: { + Description: "Maximum configurable cores and memory (GB) (aggregated from all hosts).", Type: schema.TypeMap, - Computed: true, - Description: "Maximum configurable cores available combined with available memory of that host", }, - MaxMemoryAvailable: { + Attr_MaxCoresAvailable: { + Computed: true, + Description: "Maximum configurable cores available combined with available memory of that host.", Type: schema.TypeMap, + }, + Attr_MaxMemoryAvailable: { Computed: true, - Description: "Maximum configurable memory available combined with available cores of that host", + Description: "Maximum configurable memory available combined with available cores of that host.", + Type: schema.TypeMap, }, - SharedCoreRatio: { + Attr_SharedCoreRatio: { + Computed: true, + Description: "The min-max-default allocation percentage of shared core per vCPU.", Type: schema.TypeMap, + }, + Attr_SystemPoolName: { Computed: true, - Description: "The min-max-default allocation percentage of shared core per vCPU", + Description: "The system pool name", + Type: schema.TypeString, }, - Systems: { - Type: schema.TypeList, + Attr_Systems: { Computed: true, - Description: "The DataCenter list of servers and their available resources", + Description: "The Datacenter list of servers and their available resources.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - Cores: { - Type: schema.TypeString, + Attr_Cores: { Computed: true, - Description: "The host available Processor units", - }, - ID: { + Description: "The host available Processor units.", Type: schema.TypeString, - Computed: true, - Description: "The host identifier", }, - Memory: { + Attr_ID: { + Computed: true, + Description: "The host identifier.", Type: schema.TypeString, + }, + Attr_Memory: { Computed: true, - Description: "The host available RAM memory in GiB", + Description: "The host available RAM memory in GiB.", + Type: schema.TypeString, }, }, }, + Type: schema.TypeList, }, - Type: { - Type: schema.TypeString, + Attr_Type: { Computed: true, - Description: "Type of system hardware", + Description: "Type of system hardware.", + Type: schema.TypeString, }, }, }, @@ -134,9 +113,9 @@ func dataSourceIBMPISystemPoolsRead(ctx context.Context, d *schema.ResourceData, return diag.FromErr(err) } - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + cloudInstanceID := d.Get(Arg_CloudInstanceID).(string) - client := st.NewIBMPISystemPoolClient(ctx, sess, cloudInstanceID) + client := instance.NewIBMPISystemPoolClient(ctx, sess, cloudInstanceID) sps, err := client.GetSystemPools() if err != nil { log.Printf("[ERROR] get system pools capacity failed %v", err) @@ -149,37 +128,37 @@ func dataSourceIBMPISystemPoolsRead(ctx context.Context, d *schema.ResourceData, result := make([]map[string]interface{}, 0, len(sps)) for s, sp := range sps { data := map[string]interface{}{ - SystemPoolName: s, - Capacity: flattenMax(sp.Capacity), - CoreMemoryRatio: sp.CoreMemoryRatio, - MaxAvailable: flattenMax(sp.MaxAvailable), - MaxCoresAvailable: flattenMax(sp.MaxCoresAvailable), - MaxMemoryAvailable: flattenMax(sp.MaxMemoryAvailable), - SharedCoreRatio: flattenSharedCoreRatio(sp.SharedCoreRatio), - Type: sp.Type, - Systems: flattenSystems(sp.Systems), + Attr_SystemPoolName: s, + Attr_Capacity: flattenMax(sp.Capacity), + Attr_CoreMemoryRatio: sp.CoreMemoryRatio, + Attr_MaxAvailable: flattenMax(sp.MaxAvailable), + Attr_MaxCoresAvailable: flattenMax(sp.MaxCoresAvailable), + Attr_MaxMemoryAvailable: flattenMax(sp.MaxMemoryAvailable), + Attr_SharedCoreRatio: flattenSharedCoreRatio(sp.SharedCoreRatio), + Attr_Type: sp.Type, + Attr_Systems: flattenSystems(sp.Systems), } result = append(result, data) } - d.Set(SystemPools, result) + d.Set(Attr_SystemPools, result) return nil } func flattenMax(s *models.System) map[string]string { ret := map[string]interface{}{ - Cores: *s.Cores, - Memory: *s.Memory, + Attr_Cores: *s.Cores, + Attr_Memory: *s.Memory, } return flex.Flatten(ret) } func flattenSystem(s *models.System) map[string]string { ret := map[string]interface{}{ - Cores: *s.Cores, - ID: s.ID, - Memory: *s.Memory, + Attr_Cores: *s.Cores, + Attr_ID: s.ID, + Attr_Memory: *s.Memory, } return flex.Flatten(ret) } @@ -197,9 +176,9 @@ func flattenSystems(sl []*models.System) (systems []map[string]string) { func flattenSharedCoreRatio(scr *models.MinMaxDefault) map[string]string { ret := map[string]interface{}{ - Default: scr.Default, - Max: scr.Max, - Min: scr.Min, + Attr_Default: scr.Default, + Attr_Max: scr.Max, + Attr_Min: scr.Min, } return flex.Flatten(ret) } diff --git a/ibm/service/power/data_source_ibm_pi_tenant.go b/ibm/service/power/data_source_ibm_pi_tenant.go index 5aceed866b..7e5dd40a4e 100644 --- a/ibm/service/power/data_source_ibm_pi_tenant.go +++ b/ibm/service/power/data_source_ibm_pi_tenant.go @@ -6,55 +6,59 @@ package power import ( "context" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - //"fmt" "github.com/IBM-Cloud/power-go-client/clients/instance" - "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) func DataSourceIBMPITenant() *schema.Resource { - return &schema.Resource{ ReadContext: dataSourceIBMPITenantRead, Schema: map[string]*schema.Schema{ - helpers.PICloudInstanceId: { - Type: schema.TypeString, + // Arguments + Arg_CloudInstanceID: { + Description: "The GUID of the service instance associated with an account.", Required: true, + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, }, - // Computed Attributes - "creation_date": { - Type: schema.TypeString, - Computed: true, - }, - "enabled": { - Type: schema.TypeBool, - Computed: true, - }, - "tenant_name": { - Type: schema.TypeString, - Computed: true, - }, - "cloud_instances": { - Type: schema.TypeSet, - Computed: true, + // Attributes + Attr_CloudInstances: { + Computed: true, + Description: "Set of regions and Power Systems Virtual Server instance IDs that the tenant owns.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cloud_instance_id": { - Type: schema.TypeString, - Computed: true, + Attr_CloudInstanceID: { + Computed: true, + Description: "The unique identifier of the cloud instance.", + Type: schema.TypeString, }, - "region": { - Type: schema.TypeString, - Computed: true, + Attr_Region: { + Computed: true, + Description: "The region of the cloud instance.", + Type: schema.TypeString, }, }, }, + Type: schema.TypeSet, + }, + Attr_CreationDate: { + Computed: true, + Description: "Date of tenant creation.", + Type: schema.TypeString, + }, + Attr_Enabled: { + Computed: true, + Description: "Indicates if the tenant is enabled for the Power Systems Virtual Server instance ID.", + Type: schema.TypeBool, + }, + Attr_TenantName: { + Computed: true, + Description: "The name of the tenant.", + Type: schema.TypeString, }, }, } @@ -66,8 +70,7 @@ func dataSourceIBMPITenantRead(ctx context.Context, d *schema.ResourceData, meta return diag.FromErr(err) } - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) - //tenantid := d.Get("tenantid").(string) + cloudInstanceID := d.Get(Arg_CloudInstanceID).(string) tenantC := instance.NewIBMPITenantClient(ctx, sess, cloudInstanceID) tenantData, err := tenantC.GetSelfTenant() @@ -76,23 +79,23 @@ func dataSourceIBMPITenantRead(ctx context.Context, d *schema.ResourceData, meta } d.SetId(*tenantData.TenantID) - d.Set("creation_date", tenantData.CreationDate.String()) - d.Set("enabled", tenantData.Enabled) + d.Set(Attr_CreationDate, tenantData.CreationDate.String()) + d.Set(Attr_Enabled, tenantData.Enabled) if tenantData.CloudInstances != nil { - d.Set("tenant_name", tenantData.CloudInstances[0].Name) + d.Set(Attr_TenantName, tenantData.CloudInstances[0].Name) } if tenantData.CloudInstances != nil { tenants := make([]map[string]interface{}, len(tenantData.CloudInstances)) for i, cloudinstance := range tenantData.CloudInstances { j := make(map[string]interface{}) - j["region"] = cloudinstance.Region - j["cloud_instance_id"] = cloudinstance.CloudInstanceID + j[Attr_CloudInstanceID] = cloudinstance.CloudInstanceID + j[Attr_Region] = cloudinstance.Region tenants[i] = j } - d.Set("cloud_instances", tenants) + d.Set(Attr_CloudInstances, tenants) } return nil diff --git a/ibm/service/power/data_source_ibm_pi_tenant_test.go b/ibm/service/power/data_source_ibm_pi_tenant_test.go index e5aa91cd31..d0d52a4e89 100644 --- a/ibm/service/power/data_source_ibm_pi_tenant_test.go +++ b/ibm/service/power/data_source_ibm_pi_tenant_test.go @@ -13,8 +13,6 @@ import ( ) func TestAccIBMPITenantDataSource_basic(t *testing.T) { - - //name := "Trial Tenant" resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, Providers: acc.TestAccProviders, @@ -31,9 +29,7 @@ func TestAccIBMPITenantDataSource_basic(t *testing.T) { func testAccCheckIBMPITenantDataSourceConfig() string { return fmt.Sprintf(` - -data "ibm_pi_tenant" "testacc_ds_tenant" { - pi_cloud_instance_id = "%s" -}`, acc.Pi_cloud_instance_id) - + data "ibm_pi_tenant" "testacc_ds_tenant" { + pi_cloud_instance_id = "%s" + }`, acc.Pi_cloud_instance_id) } diff --git a/ibm/service/power/data_source_ibm_pi_volume.go b/ibm/service/power/data_source_ibm_pi_volume.go index f54ccd75db..52da72ec80 100644 --- a/ibm/service/power/data_source_ibm_pi_volume.go +++ b/ibm/service/power/data_source_ibm_pi_volume.go @@ -6,114 +6,117 @@ package power import ( "context" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/IBM-Cloud/power-go-client/clients/instance" "github.com/IBM-Cloud/power-go-client/helpers" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) func DataSourceIBMPIVolume() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIVolumeRead, Schema: map[string]*schema.Schema{ - helpers.PIVolumeName: { - Type: schema.TypeString, + // Arguments + Arg_CloudInstanceID: { + Description: "The GUID of the service instance associated with an account.", Required: true, - Description: "Volume Name to be used for pvminstances", + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, }, - helpers.PICloudInstanceId: { + helpers.PIVolumeName: { Type: schema.TypeString, Required: true, + Description: "Volume Name to be used for pvminstances", ValidateFunc: validation.NoZeroValues, }, - // Computed Attributes - "state": { - Type: schema.TypeString, - Computed: true, - }, - "size": { - Type: schema.TypeInt, - Computed: true, - }, - "shareable": { - Type: schema.TypeBool, - Computed: true, - }, - "bootable": { - Type: schema.TypeBool, - Computed: true, - }, - "disk_type": { - Type: schema.TypeString, - Computed: true, - }, - "volume_pool": { - Type: schema.TypeString, - Computed: true, - }, - "wwn": { - Type: schema.TypeString, - Computed: true, - }, - "replication_enabled": { - Type: schema.TypeBool, + // Attributes + Attr_Auxiliary: { Computed: true, - Description: "Indicates if the volume should be replication enabled or not", + Description: "Indicates if the volume is auxiliary or not.", + Type: schema.TypeBool, }, - "replication_type": { + Attr_AuxiliaryVolumeName: { + Computed: true, + Description: "The auxiliary volume name.", Type: schema.TypeString, + }, + Attr_Bootable: { Computed: true, - Description: "Replication type(metro,global)", + Description: "Indicates if the volume is boot capable.", + Type: schema.TypeBool, }, - "replication_status": { + Attr_ConsistencyGroupName: { + Computed: true, + Description: "Consistency group name if volume is a part of volume group.", Type: schema.TypeString, + }, + Attr_DiskType: { Computed: true, - Description: "Replication status of a volume", + Description: "The disk type that is used for the volume.", + Type: schema.TypeString, }, - "auxiliary": { - Type: schema.TypeBool, + Attr_GroupID: { Computed: true, - Description: "true if volume is auxiliary otherwise false", + Description: "The volume group id in which the volume belongs.", + Type: schema.TypeString, }, - "consistency_group_name": { + Attr_MasterVolumeName: { + Computed: true, + Description: "The master volume name.", Type: schema.TypeString, + }, + Attr_MirroringState: { Computed: true, - Description: "Consistency Group Name if volume is a part of volume group", + Description: "Mirroring state for replication enabled volume.", + Type: schema.TypeString, }, - "group_id": { + Attr_PrimaryRole: { + Computed: true, + Description: "Indicates whether master/auxiliary volume is playing the primary role.", Type: schema.TypeString, + }, + Attr_ReplicationEnabled: { Computed: true, - Description: "Volume Group ID", + Description: "Indicates if the volume should be replication enabled or not.", + Type: schema.TypeBool, }, - "mirroring_state": { - Type: schema.TypeString, + Attr_ReplicationStatus: { Computed: true, - Description: "Mirroring state for replication enabled volume", + Description: "The replication status of the volume.", + Type: schema.TypeString, }, - "primary_role": { + Attr_ReplicationType: { + Computed: true, + Description: "The replication type of the volume, metro or global.", Type: schema.TypeString, + }, + Attr_Shareable: { Computed: true, - Description: "Indicates whether master/aux volume is playing the primary role", + Description: "Indicates if the volume is shareable between VMs.", + Type: schema.TypeBool, }, - "auxiliary_volume_name": { - Type: schema.TypeString, + Attr_Size: { Computed: true, - Description: "Indicates auxiliary volume name", + Description: "The size of the volume in gigabytes.", + Type: schema.TypeInt, }, - "master_volume_name": { - Type: schema.TypeString, + Attr_State: { Computed: true, - Description: "Indicates master volume name", + Description: "The state of the volume.", + Type: schema.TypeString, }, - "io_throttle_rate": { + Attr_VolumePool: { + Computed: true, + Description: "Volume pool, name of storage pool where the volume is located.", Type: schema.TypeString, + }, + Attr_WWN: { Computed: true, - Description: "Amount of iops assigned to the volume", + Description: "The world wide name of the volume.", + Type: schema.TypeString, }, }, } @@ -125,7 +128,7 @@ func dataSourceIBMPIVolumeRead(ctx context.Context, d *schema.ResourceData, meta return diag.FromErr(err) } - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + cloudInstanceID := d.Get(Arg_CloudInstanceID).(string) volumeC := instance.NewIBMPIVolumeClient(ctx, sess, cloudInstanceID) volumedata, err := volumeC.Get(d.Get(helpers.PIVolumeName).(string)) if err != nil { @@ -133,24 +136,23 @@ func dataSourceIBMPIVolumeRead(ctx context.Context, d *schema.ResourceData, meta } d.SetId(*volumedata.VolumeID) - d.Set("size", volumedata.Size) - d.Set("state", volumedata.State) - d.Set("shareable", volumedata.Shareable) - d.Set("bootable", volumedata.Bootable) - d.Set("disk_type", volumedata.DiskType) - d.Set("volume_pool", volumedata.VolumePool) - d.Set("wwn", volumedata.Wwn) - d.Set("replication_enabled", volumedata.ReplicationEnabled) - d.Set("replication_type", volumedata.ReplicationType) - d.Set("replication_status", volumedata.ReplicationStatus) - d.Set("auxiliary", volumedata.Auxiliary) - d.Set("consistency_group_name", volumedata.ConsistencyGroupName) - d.Set("group_id", volumedata.GroupID) - d.Set("mirroring_state", volumedata.MirroringState) - d.Set("primary_role", volumedata.PrimaryRole) - d.Set("auxiliary_volume_name", volumedata.AuxVolumeName) - d.Set("master_volume_name", volumedata.MasterVolumeName) - d.Set("io_throttle_rate", volumedata.IoThrottleRate) + d.Set(Attr_Auxiliary, volumedata.Auxiliary) + d.Set(Attr_AuxiliaryVolumeName, volumedata.AuxVolumeName) + d.Set(Attr_Bootable, volumedata.Bootable) + d.Set(Attr_ConsistencyGroupName, volumedata.ConsistencyGroupName) + d.Set(Attr_DiskType, volumedata.DiskType) + d.Set(Attr_GroupID, volumedata.GroupID) + d.Set(Attr_MasterVolumeName, volumedata.MasterVolumeName) + d.Set(Attr_MirroringState, volumedata.MirroringState) + d.Set(Attr_PrimaryRole, volumedata.PrimaryRole) + d.Set(Attr_ReplicationEnabled, volumedata.ReplicationEnabled) + d.Set(Attr_ReplicationType, volumedata.ReplicationType) + d.Set(Attr_ReplicationStatus, volumedata.ReplicationStatus) + d.Set(Attr_State, volumedata.State) + d.Set(Attr_Shareable, volumedata.Shareable) + d.Set(Attr_Size, volumedata.Size) + d.Set(Attr_VolumePool, volumedata.VolumePool) + d.Set(Attr_WWN, volumedata.Wwn) return nil } diff --git a/ibm/service/power/data_source_ibm_pi_volume_flash_copy_mappings.go b/ibm/service/power/data_source_ibm_pi_volume_flash_copy_mappings.go index 3a281ba4d4..56cd536cb1 100644 --- a/ibm/service/power/data_source_ibm_pi_volume_flash_copy_mappings.go +++ b/ibm/service/power/data_source_ibm_pi_volume_flash_copy_mappings.go @@ -6,75 +6,76 @@ package power import ( "context" + "github.com/IBM-Cloud/power-go-client/clients/instance" + "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - - "github.com/IBM-Cloud/power-go-client/clients/instance" - "github.com/IBM-Cloud/power-go-client/helpers" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ) func DataSourceIBMPIVolumeFlashCopyMappings() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceIBMPIVolumeFlashCopyMappings, Schema: map[string]*schema.Schema{ - helpers.PIVolumeId: { - Type: schema.TypeString, + // Arguments + Arg_CloudInstanceID: { + Description: "The GUID of the service instance associated with an account.", Required: true, - Description: "Volume ID", + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, }, - helpers.PICloudInstanceId: { - Type: schema.TypeString, + Arg_VolumeID: { + Description: "The ID of the volume for which you want to retrieve detailed information.", Required: true, + Type: schema.TypeString, ValidateFunc: validation.NoZeroValues, }, - // Computed Attributes - "flash_copy_mappings": { - Type: schema.TypeList, - Computed: true, + // Attributes + Attr_FlashCopyMappings: { + Computed: true, + Description: "List of flash copy mappings details of a volume.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "copy_rate": { - Type: schema.TypeInt, + Attr_CopyRate: { Computed: true, - Description: "Indicates the rate of flash copy operation of a volume", + Description: "The rate of flash copy operation of a volume.", + Type: schema.TypeInt, }, - "flash_copy_name": { - Type: schema.TypeString, + Attr_FlashCopyName: { Computed: true, - Description: "Indicates flash copy name of the volume", + Description: "The flash copy name of the volume.", + Type: schema.TypeString, }, - "progress": { - Type: schema.TypeInt, + Attr_Progress: { Computed: true, - Description: "Indicates the progress of flash copy operation", + Description: "The progress of flash copy operation.", + Type: schema.TypeInt, }, - "source_volume_name": { - Type: schema.TypeString, + Attr_SourceVolumeName: { Computed: true, - Description: "Indicates name of the source volume", - }, - "start_time": { + Description: "The name of the source volume.", Type: schema.TypeString, - Computed: true, - Description: "Indicates the start time of flash copy operation", }, - "status": { - Type: schema.TypeString, + Attr_StartTime: { Computed: true, - Description: "Copy status of a volume", + Description: "The start time of flash copy operation.", + Type: schema.TypeString, }, - "target_volume_name": { + Attr_Status: { + Computed: true, + Description: "The copy status of a volume.", Type: schema.TypeString, + }, + Attr_TargetVolumeName: { Computed: true, - Description: "Indicates name of the target volume", + Description: "The name of the target volume.", + Type: schema.TypeString, }, }, }, + Type: schema.TypeList, }, }, } @@ -86,9 +87,9 @@ func dataSourceIBMPIVolumeFlashCopyMappings(ctx context.Context, d *schema.Resou return diag.FromErr(err) } - cloudInstanceID := d.Get(helpers.PICloudInstanceId).(string) + cloudInstanceID := d.Get(Arg_CloudInstanceID).(string) volClient := instance.NewIBMPIVolumeClient(ctx, sess, cloudInstanceID) - volData, err := volClient.GetVolumeFlashCopyMappings(d.Get(helpers.PIVolumeId).(string)) + volData, err := volClient.GetVolumeFlashCopyMappings(d.Get(Arg_VolumeID).(string)) if err != nil { return diag.FromErr(err) } @@ -97,22 +98,22 @@ func dataSourceIBMPIVolumeFlashCopyMappings(ctx context.Context, d *schema.Resou for _, i := range volData { if i != nil { l := map[string]interface{}{ - "copy_rate": i.CopyRate, - "progress": i.Progress, - "source_volume_name": i.SourceVolumeName, - "start_time": i.StartTime.String(), - "status": i.Status, - "target_volume_name": i.TargetVolumeName, + Attr_CopyRate: i.CopyRate, + Attr_Progress: i.Progress, + Attr_SourceVolumeName: i.SourceVolumeName, + Attr_StartTime: i.StartTime.String(), + Attr_Status: i.Status, + Attr_TargetVolumeName: i.TargetVolumeName, } if i.FlashCopyName != nil { - l["flash_copy_name"] = i.FlashCopyName + l[Attr_FlashCopyName] = i.FlashCopyName } results = append(results, l) } } var clientgenU, _ = uuid.GenerateUUID() d.SetId(clientgenU) - d.Set("flash_copy_mappings", results) + d.Set(Attr_FlashCopyMappings, results) return nil } diff --git a/ibm/service/power/data_source_ibm_pi_volume_flash_copy_mappings_test.go b/ibm/service/power/data_source_ibm_pi_volume_flash_copy_mappings_test.go index 77be9df8ad..3d77b0ec4d 100644 --- a/ibm/service/power/data_source_ibm_pi_volume_flash_copy_mappings_test.go +++ b/ibm/service/power/data_source_ibm_pi_volume_flash_copy_mappings_test.go @@ -29,9 +29,8 @@ func TestAccIBMPIVolumeFlashCopyMappingsDataSource_basic(t *testing.T) { func testAccCheckIBMPIVolumeFlashCopyMappingsDataSourceConfig() string { return fmt.Sprintf(` -data "ibm_pi_volume_flash_copy_mappings" "testacc_volume_flash_copy_mappings" { - pi_cloud_instance_id = "%s" - pi_volume_id = "%s" -}`, acc.Pi_cloud_instance_id, acc.Pi_volume_id) - + data "ibm_pi_volume_flash_copy_mappings" "testacc_volume_flash_copy_mappings" { + pi_cloud_instance_id = "%s" + pi_volume_id = "%s" + }`, acc.Pi_cloud_instance_id, acc.Pi_volume_id) } diff --git a/ibm/service/power/data_source_ibm_pi_volume_test.go b/ibm/service/power/data_source_ibm_pi_volume_test.go index 2707485a0e..a3b8498b7a 100644 --- a/ibm/service/power/data_source_ibm_pi_volume_test.go +++ b/ibm/service/power/data_source_ibm_pi_volume_test.go @@ -29,11 +29,10 @@ func TestAccIBMPIVolumeDataSource_basic(t *testing.T) { func testAccCheckIBMPIVolumeDataSourceConfig() string { return fmt.Sprintf(` -data "ibm_pi_volume" "testacc_ds_volume" { - pi_volume_name = "%s" - pi_cloud_instance_id = "%s" -}`, acc.Pi_volume_name, acc.Pi_cloud_instance_id) - + data "ibm_pi_volume" "testacc_ds_volume" { + pi_volume_name = "%s" + pi_cloud_instance_id = "%s" + }`, acc.Pi_volume_name, acc.Pi_cloud_instance_id) } func TestAccIBMPIVolumeDataSource_replication(t *testing.T) { @@ -55,9 +54,8 @@ func TestAccIBMPIVolumeDataSource_replication(t *testing.T) { func testAccCheckIBMPIVolumeDataSourceReplicationConfig() string { return fmt.Sprintf(` -data "ibm_pi_volume" "testacc_ds_volume" { - pi_volume_name = "%s" - pi_cloud_instance_id = "%s" -}`, acc.Pi_replication_volume_name, acc.Pi_cloud_instance_id) - + data "ibm_pi_volume" "testacc_ds_volume" { + pi_volume_name = "%s" + pi_cloud_instance_id = "%s" + }`, acc.Pi_replication_volume_name, acc.Pi_cloud_instance_id) } diff --git a/ibm/service/power/ibm_pi_constants.go b/ibm/service/power/ibm_pi_constants.go index 8e66a4bd83..6c7d8eaeeb 100644 --- a/ibm/service/power/ibm_pi_constants.go +++ b/ibm/service/power/ibm_pi_constants.go @@ -150,13 +150,69 @@ const ( SctionStop = "stop" // Workspaces - Attr_WorkspaceCapabilities = "pi_workspace_capabilities" - Attr_WorkspaceDetails = "pi_workspace_details" - Attr_WorkspaceID = "pi_workspace_id" - Attr_WorkspaceLocation = "pi_workspace_location" - Attr_WorkspaceName = "pi_workspace_name" - Attr_WorkspaceStatus = "pi_workspace_status" - Attr_WorkspaceType = "pi_workspace_type" + Attr_WorkspaceCapabilities = "pi_workspace_capabilities" + Attr_WorkspaceDetails = "pi_workspace_details" + Attr_WorkspaceID = "pi_workspace_id" + Attr_WorkspaceLocation = "pi_workspace_location" + Attr_WorkspaceName = "pi_workspace_name" + Attr_WorkspaceStatus = "pi_workspace_status" + Attr_WorkspaceType = "pi_workspace_type" + Arg_StoragePool = "pi_storage_pool" + Attr_MaxAllocationSize = "max_allocation_size" + Attr_ReplicationEnabled = "replication_enabled" + Attr_StorageType = "storage_type" + Attr_TotalCapacity = "total_capacity" + Attr_MaximumStorageAllocation = "max_storage_allocation" + Attr_StoragePoolsCapacity = "storage_pools_capacity" + Attr_PoolName = "pool_name" + Attr_StoragePool = "storage_pool" + Attr_SystemPools = "system_pools" + Attr_Capacity = "capacity" + Attr_CoreMemoryRatio = "core_memory_ratio" + Attr_MaxAvailable = "max_available" + Attr_MaxCoresAvailable = "max_cores_available" + Attr_MaxMemoryAvailable = "max_memory_available" + Attr_SharedCoreRatio = "shared_core_ratio" + Attr_SystemPoolName = "system_pool_name" + Attr_Systems = "systems" + Attr_Cores = "cores" + Attr_ID = "id" + Attr_Memory = "memory" + Attr_Type = "type" + Attr_Default = "default" + Attr_Max = "max" + Attr_Min = "min" + Arg_StorageType = "pi_storage_type" + Attr_StorageTypesCapacity = "storage_types_capacity" + Attr_CloudInstances = "cloud_instances" + Attr_CloudInstanceID = "cloud_instance_id" + Attr_Region = "region" + Attr_CreationDate = "creation_date" + Attr_Enabled = "enabled" + Attr_TenantName = "tenant_name" + Attr_Auxiliary = "auxiliary" + Attr_AuxiliaryVolumeName = "auxiliary_volume_name" + Attr_Bootable = "bootable" + Attr_ConsistencyGroupName = "consistency_group_name" + Attr_DiskType = "disk_type" + Attr_GroupID = "group_id" + Attr_MasterVolumeName = "master_volume_name" + Attr_MirroringState = "mirroring_state" + Attr_PrimaryRole = "primary_role" + Attr_ReplicationStatus = "replication_status" + Attr_ReplicationType = "replication_type" + Attr_Shareable = "shreable" + Attr_Size = "size" + Attr_State = "state" + Attr_VolumePool = "volume_pool" + Attr_WWN = "wwn" + Arg_VolumeID = "pi_volume_id" + Attr_FlashCopyMappings = "flash_copy_mappings" + Attr_CopyRate = "copy_rate" + Attr_FlashCopyName = "flash_copy_name" + Attr_SourceVolumeName = "source_volume_name" + Attr_StartTime = "start_time" + Attr_TargetVolumeName = "target_volume_name" // Datacenter Arg_DatacenterZone = "pi_datacenter_zone" diff --git a/website/docs/d/pi_storage_pool_capacity.markdown b/website/docs/d/pi_storage_pool_capacity.markdown index a38e01eb79..75cb264e8c 100644 --- a/website/docs/d/pi_storage_pool_capacity.markdown +++ b/website/docs/d/pi_storage_pool_capacity.markdown @@ -1,5 +1,4 @@ --- - subcategory: "Power Systems" layout: "ibm" page_title: "IBM: pi_storage_pool_capacity" @@ -11,7 +10,6 @@ description: |- Retrieve information about storages capacity for a storage pool in a region. For more information, see [getting started with IBM Power Systems Virtual Servers](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started). ## Example usage - ```terraform data "ibm_pi_storage_pool_capacity" "pool" { pi_cloud_instance_id = "" @@ -20,14 +18,12 @@ data "ibm_pi_storage_pool_capacity" "pool" { ``` **Notes** - -* Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. -* If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - * `region` - `lon` - * `zone` - `lon04` +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` Example usage: - ```terraform provider "ibm" { region = "lon" @@ -47,4 +43,4 @@ In addition to all argument reference list, you can access the following attribu - `max_allocation_size` - (Integer) Maximum allocation storage size (GB). - `storage_type` - (String) Storage type of the storage pool. - `total_capacity` - (Integer) Total pool capacity (GB). -- `replication_enabled` - (Boolean) Replication status of the storage pool. +- `replication_enabled` - (Bool) Replication status of the storage pool. diff --git a/website/docs/d/pi_storage_pools_capacity.markdown b/website/docs/d/pi_storage_pools_capacity.markdown index f85cecb0d3..2882528b40 100644 --- a/website/docs/d/pi_storage_pools_capacity.markdown +++ b/website/docs/d/pi_storage_pools_capacity.markdown @@ -1,5 +1,4 @@ --- - subcategory: "Power Systems" layout: "ibm" page_title: "IBM: pi_storage_pools_capacity" @@ -11,7 +10,6 @@ description: |- Retrieve information about storages capacity for all available storage pools in a region. For more information, see [getting started with IBM Power Systems Virtual Servers](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started). ## Example usage - ```terraform data "ibm_pi_storage_pools_capacity" "pools" { pi_cloud_instance_id = "" @@ -19,14 +17,12 @@ data "ibm_pi_storage_pools_capacity" "pools" { ``` **Notes** - -* Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. -* If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - * `region` - `lon` - * `zone` - `lon04` +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` Example usage: - ```terraform provider "ibm" { region = "lon" @@ -56,4 +52,4 @@ In addition to all argument reference list, you can access the following attribu - `pool_name` - (String) The pool name. - `storage_type` - (String) Storage type of the storage pool. - `total_capacity` - (Integer) Total pool capacity (GB). - - `replication_enabled` - (Boolean) Replication status of the storage pool. + - `replication_enabled` - (Bool) Replication status of the storage pool. diff --git a/website/docs/d/pi_storage_type_capacity.markdown b/website/docs/d/pi_storage_type_capacity.markdown index 1a53cbc391..5c3a81a3e5 100644 --- a/website/docs/d/pi_storage_type_capacity.markdown +++ b/website/docs/d/pi_storage_type_capacity.markdown @@ -1,5 +1,4 @@ --- - subcategory: "Power Systems" layout: "ibm" page_title: "IBM: pi_storage_type_capacity" @@ -11,7 +10,6 @@ description: |- Retrieve information about storages capacity for a storage type in a region. For more information, see [getting started with IBM Power Systems Virtual Servers](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started). ## Example usage - ```terraform data "ibm_pi_storage_type_capacity" "type" { pi_cloud_instance_id = "" @@ -20,14 +18,12 @@ data "ibm_pi_storage_type_capacity" "type" { ``` **Notes** - -* Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. -* If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - * `region` - `lon` - * `zone` - `lon04` +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` Example usage: - ```terraform provider "ibm" { region = "lon" diff --git a/website/docs/d/pi_storage_types_capacity.markdown b/website/docs/d/pi_storage_types_capacity.markdown index 1a0c75595e..8377ae3882 100644 --- a/website/docs/d/pi_storage_types_capacity.markdown +++ b/website/docs/d/pi_storage_types_capacity.markdown @@ -1,5 +1,4 @@ --- - subcategory: "Power Systems" layout: "ibm" page_title: "IBM: pi_storage_types_capacity" @@ -11,7 +10,6 @@ description: |- Retrieve information about storages capacity for all available storage types in a region. For more information, see [getting started with IBM Power Systems Virtual Servers](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started). ## Example usage - ```terraform data "ibm_pi_storage_types_capacity" "types" { pi_cloud_instance_id = "" @@ -19,14 +17,12 @@ data "ibm_pi_storage_types_capacity" "types" { ``` **Notes** - -* Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. -* If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - * `region` - `lon` - * `zone` - `lon04` +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` Example usage: - ```terraform provider "ibm" { region = "lon" @@ -54,17 +50,17 @@ In addition to all argument reference list, you can access the following attribu Nested scheme for `storage_types_capacity`: - `maximum_storage_allocation` - (Map) Maximum storage allocation. - Nested scheme for `maximum_storage_allocation`: - - `max_allocation_size` - (Integer) Maximum allocation storage size (GB). - - `storage_pool` - (String) The storage pool. - - `storage_type`- (String) The storage type. + Nested scheme for `maximum_storage_allocation`: + - `max_allocation_size` - (Integer) Maximum allocation storage size (GB). + - `storage_pool` - (String) The storage pool. + - `storage_type`- (String) The storage type. - `storage_pools_capacity` - (List) List of storage pools capacity. - Nested scheme for `storage_pools_capacity`: - - `max_allocation_size` - (Integer) Maximum allocation storage size (GB). - - `pool_name` - (String) The pool name. - - `storage_type` - (String) Storage type of the storage pool. - - `total_capacity` - (Integer) Total pool capacity (GB). + Nested scheme for `storage_pools_capacity`: + - `max_allocation_size` - (Integer) Maximum allocation storage size (GB). + - `pool_name` - (String) The pool name. + - `storage_type` - (String) Storage type of the storage pool. + - `total_capacity` - (Integer) Total pool capacity (GB). - `storage_type` - (String) The storage type. diff --git a/website/docs/d/pi_system_pools.markdown b/website/docs/d/pi_system_pools.markdown index 28ce84b76d..09cb154c97 100644 --- a/website/docs/d/pi_system_pools.markdown +++ b/website/docs/d/pi_system_pools.markdown @@ -1,5 +1,4 @@ --- - subcategory: "Power Systems" layout: "ibm" page_title: "IBM: pi_system_pools" @@ -11,7 +10,6 @@ description: |- Retrieve information about list of system pools within a particular data center. For more information, see [getting started with IBM Power Systems Virtual Servers](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started). ## Example usage - ```terraform data "ibm_pi_system_pools" "pools" { pi_cloud_instance_id = "" @@ -19,14 +17,12 @@ data "ibm_pi_system_pools" "pools" { ``` **Notes** - -* Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. -* If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - * `region` - `lon` - * `zone` - `lon04` +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` Example usage: - ```terraform provider "ibm" { region = "lon" @@ -42,47 +38,46 @@ Review the argument references that you can specify for your data source. ## Attribute reference In addition to all argument reference list, you can access the following attribute references after your data source is created. -- `system_pools` - (List) The available system pools within a particular DataCenter. +- `system_pools` - (List) List of available system pools within a particular Datacenter. Nested scheme for `system_pools`: - - `system_pool_name` - (String) The system pool name. - `capacity` - (Map) Advertised capacity cores and memory (GB). - Nested scheme for `capacity`: - - `cores` - (String) The host available Processor units. - - `memory`- (String) The host available RAM memory in GiB. + Nested scheme for `capacity`: + - `cores` - (String) The host available Processor units. + - `memory`- (String) The host available RAM memory in GiB. - `core_memory_ratio` - (Float) Processor to Memory (GB) Ratio. - `max_available` - (Map) Maximum configurable cores and memory (GB) (aggregated from all hosts). - Nested scheme for `max_available`: - - `cores` - (String) The host available Processor units. - - `memory`- (String) The host available RAM memory in GiB. + Nested scheme for `max_available`: + - `cores` - (String) The host available Processor units. + - `memory`- (String) The host available RAM memory in GiB. - `max_cores_available` - (Map) Maximum configurable cores available combined with available memory of that host. - Nested scheme for `max_cores_available`: - - `cores` - (String) The host available Processor units. - - `memory`- (String) The host available RAM memory in GiB. + Nested scheme for `max_cores_available`: + - `cores` - (String) The host available Processor units. + - `memory`- (String) The host available RAM memory in GiB. - `max_memory_available` - (Map) Maximum configurable memory available combined with available cores of that host. - Nested scheme for `max_memory_available`: - - `cores` - (String) The host available Processor units. - - `memory`- (String) The host available RAM memory in GiB. + Nested scheme for `max_memory_available`: + - `cores` - (String) The host available Processor units. + - `memory`- (String) The host available RAM memory in GiB. - `shared_core_ratio` - (Map) The min-max-default allocation percentage of shared core per vCPU. - Nested scheme for `shared_core_ratio`: - - `default` - (String) The default value. - - `max` - (String) The max value. - - `min`- (String) The min value. - - - `systems` - (List) The DataCenter list of servers and their available resources. + Nested scheme for `shared_core_ratio`: + - `default` - (String) The default value. + - `max` - (String) The max value. + - `min`- (String) The min value. + - `system_pool_name` - (String) The system pool name. + - `systems` - (List) The Datacenter list of servers and their available resources. - Nested scheme for `systems`: - - `cores` - (String) The host available Processor units. - - `id` - (String) The host identifier. - - `memory`- (String) The host available RAM memory in GiB. + Nested scheme for `systems`: + - `cores` - (String) The host available Processor units. + - `id` - (String) The host identifier. + - `memory`- (String) The host available RAM memory in GiB. - `type` - (String) Type of system hardware. diff --git a/website/docs/d/pi_tenant.html.markdown b/website/docs/d/pi_tenant.html.markdown index 1376c8540f..b1f775eac4 100644 --- a/website/docs/d/pi_tenant.html.markdown +++ b/website/docs/d/pi_tenant.html.markdown @@ -1,5 +1,4 @@ --- - subcategory: "Power Systems" layout: "ibm" page_title: "IBM: pi_tenant" @@ -19,15 +18,13 @@ data "ibm_pi_tenant" "ds_tenant" { } ``` -**Note** - -* Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. -* If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - * `region` - `lon` - * `zone` - `lon04` +**Notes** +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` - Example usage: - +Example usage: ```terraform provider "ibm" { region = "lon" @@ -43,12 +40,12 @@ Review the argument references that you can specify for your data source. ## Attribute reference In addition to all argument reference list, you can access the following attribute references after your data source is created. -- `creation_date` - (Timestamp) The timestamp when the tenant was created. -- `cloud_instances` - (List) A list with the regions and Power Systems Virtual Server instance IDs that the tenant owns. +- `cloud_instances` - (Set) Set of regions and Power Systems Virtual Server instance IDs that the tenant owns. Nested scheme for `cloud_instances`: - `cloud_instance_id` - (String) The unique identifier of the cloud instance. - `region` - (String) The region of the cloud instance. +- `creation_date` - (String) Date of tenant creation. - `enabled` - (Bool) Indicates if the tenant is enabled for the Power Systems Virtual Server instance ID. - `id` - (String) The ID of the tenant. - `tenant_name` - (String) The name of the tenant. diff --git a/website/docs/d/pi_volume.html.markdown b/website/docs/d/pi_volume.html.markdown index 4d4ef82032..de8eaa9419 100644 --- a/website/docs/d/pi_volume.html.markdown +++ b/website/docs/d/pi_volume.html.markdown @@ -1,5 +1,4 @@ --- - subcategory: "Power Systems" layout: "ibm" page_title: "IBM: pi_volume" @@ -19,13 +18,14 @@ data "ibm_pi_volume" "ds_volume" { pi_cloud_instance_id = "49fba6c9-23f8-40bc-9899-aca322ee7d5b" } ``` + **Notes** -* Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. -* If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - * `region` - `lon` - * `zone` - `lon04` +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` - Example usage: +Example usage: ```terraform provider "ibm" { region = "lon" @@ -44,9 +44,9 @@ In addition to all argument reference list, you can access the following attribu - `auxiliary` - (Bool) Indicates if the volume is auxiliary or not. - `auxiliary_volume_name` - (String) The auxiliary volume name. +- `bootable` - (Bool) Indicates if the volume is boot capable. - `consistency_group_name` - (String) Consistency group name if volume is a part of volume group. - `disk_type` - (String) The disk type that is used for the volume. -- `bootable` - (Bool) Indicates if the volume is boot capable. - `group_id` - (String) The volume group id in which the volume belongs. - `id` - (String) The unique identifier of the volume. - `master_volume_name` - (String) The master volume name. @@ -54,10 +54,9 @@ In addition to all argument reference list, you can access the following attribu - `primary_role` - (String) Indicates whether `master`/`auxiliary` volume is playing the primary role. - `replication_enabled` - (Bool) Indicates if the volume should be replication enabled or not. - `replication_status` - (String) The replication status of the volume. -- `replication_type` - (String) The replication type of the volume `metro` or `global`. +- `replication_type` - (String) The replication type of the volume, `metro` or `global`. - `shareable` - (String) Indicates if the volume is shareable between VMs. - `size` - (Integer) The size of the volume in gigabytes. - `state` - (String) The state of the volume. - `volume_pool` - (String) Volume pool, name of storage pool where the volume is located. - `wwn` - (String) The world wide name of the volume. -- `io_throttle_rate` -(String) Amount of iops assigned to the volume. diff --git a/website/docs/d/pi_volume_flash_copy_mappings_html.markdown b/website/docs/d/pi_volume_flash_copy_mappings_html.markdown index 3ebda03b80..4c750f7b29 100644 --- a/website/docs/d/pi_volume_flash_copy_mappings_html.markdown +++ b/website/docs/d/pi_volume_flash_copy_mappings_html.markdown @@ -1,5 +1,4 @@ --- - subcategory: "Power Systems" layout: "ibm" page_title: "IBM: pi_volume_flash_copy_mappings" @@ -19,13 +18,14 @@ data "pi_volume_flash_copy_mappings" "ds_volume_flash_copy_mappings" { pi_cloud_instance_id = "49fba6c9-23f8-40bc-9899-aca322ee7d5b" } ``` + **Notes** -* Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. -* If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - * `region` - `lon` - * `zone` - `lon04` +- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. +- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: + - `region` - `lon` + - `zone` - `lon04` - Example usage: +Example usage: ```terraform provider "ibm" { region = "lon" @@ -42,7 +42,7 @@ Review the argument references that you can specify for your data source. ## Attribute reference In addition to all argument reference list, you can access the following attribute references after your data source is created. -- `flash_copy_mappings` - (List of objects) - The flash copy mappings details of a volume. +- `flash_copy_mappings` - (List) List of flash copy mappings details of a volume. Nested scheme for `flash_copy_mappings`: - `copy_rate` - (Integer) The rate of flash copy operation of a volume. @@ -51,4 +51,4 @@ In addition to all argument reference list, you can access the following attribu - `source_volume_name` (String) The name of the source volume. - `start_time` - (String) The start time of flash copy operation. - `status` - (String) The copy status of a volume. - - `target_volume_name` (String) The name of the target volume. \ No newline at end of file + - `target_volume_name` (String) The name of the target volume.