diff --git a/go.mod b/go.mod index 9331c5dfe60..a784b178ad0 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.5 require ( github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113 - github.com/IBM-Cloud/power-go-client v1.7.0 + github.com/IBM-Cloud/power-go-client v1.8.1 github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca github.com/IBM/appconfiguration-go-admin-sdk v0.3.0 github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f diff --git a/go.sum b/go.sum index 5db19a9fe9f..6e1a9cdfea9 100644 --- a/go.sum +++ b/go.sum @@ -118,8 +118,8 @@ github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be/go.mod h1:/7h github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113 h1:f2Erqfea1dKpaTFagTJM6W/wnD3JGq/Vn9URh8nuRwk= github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY= github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.5.3/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs= -github.com/IBM-Cloud/power-go-client v1.7.0 h1:/GuGwPMTKoCZACfnwt7b6wKr4v32q1VO1AMFGNETRN4= -github.com/IBM-Cloud/power-go-client v1.7.0/go.mod h1:9izycYAmNQ+NAdVPXDC3fHYxqWLjlR2YiwqKYveMv5Y= +github.com/IBM-Cloud/power-go-client v1.8.1 h1:tx1aPJmIQrNru1MD1VHGNasGx3eRIs0zzPZ0KvdFQrg= +github.com/IBM-Cloud/power-go-client v1.8.1/go.mod h1:N4RxrsMUvBQjSQ/qPk0iMZ8zK+fZPRTnHi/gTaASw0g= github.com/IBM-Cloud/softlayer-go v1.0.5-tf h1:koUAyF9b6X78lLLruGYPSOmrfY2YcGYKOj/Ug9nbKNw= github.com/IBM-Cloud/softlayer-go v1.0.5-tf/go.mod h1:6HepcfAXROz0Rf63krk5hPZyHT6qyx2MNvYyHof7ik4= github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca h1:crniVcf+YcmgF03NmmfonXwSQ73oJF+IohFYBwknMxs= diff --git a/ibm/service/power/data_source_ibm_pi_volume_group.go b/ibm/service/power/data_source_ibm_pi_volume_group.go index daddb0709aa..8ee773b9043 100644 --- a/ibm/service/power/data_source_ibm_pi_volume_group.go +++ b/ibm/service/power/data_source_ibm_pi_volume_group.go @@ -33,11 +33,22 @@ func DataSourceIBMPIVolumeGroup() *schema.Resource { }, // Attributes + Attr_Auxiliary: { + Computed: true, + Description: "Indicates if the volume is auxiliary or not.", + Type: schema.TypeBool, + }, Attr_ConsistencyGroupName: { Computed: true, Description: "The name of consistency group at storage controller level.", Type: schema.TypeString, }, + Attr_ReplicationSites: { + Computed: true, + Description: "Indicates the replication sites of the volume group.", + Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + }, Attr_ReplicationStatus: { Computed: true, Description: "The replication status of volume group.", @@ -73,6 +84,11 @@ func DataSourceIBMPIVolumeGroup() *schema.Resource { }, Type: schema.TypeSet, }, + Attr_StoragePool: { + Computed: true, + Description: "Indicates the storage pool of the volume group", + Type: schema.TypeString, + }, Attr_VolumeGroupName: { Computed: true, Description: "The name of the volume group.", @@ -96,12 +112,17 @@ func dataSourceIBMPIVolumeGroupRead(ctx context.Context, d *schema.ResourceData, } d.SetId(*vgData.ID) + d.Set(Attr_Auxiliary, vgData.Auxiliary) d.Set(Attr_ConsistencyGroupName, vgData.ConsistencyGroupName) d.Set(Attr_ReplicationStatus, vgData.ReplicationStatus) + if len(vgData.ReplicationSites) > 0 { + d.Set(Attr_ReplicationSites, vgData.ReplicationSites) + } d.Set(Attr_Status, vgData.Status) if vgData.StatusDescription != nil { d.Set(Attr_StatusDescriptionErrors, flattenVolumeGroupStatusDescription(vgData.StatusDescription.Errors)) } + d.Set(Attr_StoragePool, vgData.StoragePool) d.Set(Attr_VolumeGroupName, vgData.Name) return nil diff --git a/ibm/service/power/data_source_ibm_pi_volume_group_details.go b/ibm/service/power/data_source_ibm_pi_volume_group_details.go index 518ef8b540e..4448499baad 100644 --- a/ibm/service/power/data_source_ibm_pi_volume_group_details.go +++ b/ibm/service/power/data_source_ibm_pi_volume_group_details.go @@ -32,6 +32,11 @@ func DataSourceIBMPIVolumeGroupDetails() *schema.Resource { }, // Attributes + Attr_Auxiliary: { + Computed: true, + Description: "Indicates if the volume is auxiliary or not.", + Type: schema.TypeBool, + }, Attr_ConsistencyGroupName: { Computed: true, Description: "The name of consistency group at storage controller level.", @@ -42,6 +47,12 @@ func DataSourceIBMPIVolumeGroupDetails() *schema.Resource { Description: "The replication status of volume group.", Type: schema.TypeString, }, + Attr_ReplicationSites: { + Computed: true, + Description: "Indicates the replication sites of the volume group.", + Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + }, Attr_Status: { Computed: true, Description: "The status of the volume group.", @@ -72,6 +83,11 @@ func DataSourceIBMPIVolumeGroupDetails() *schema.Resource { }, Type: schema.TypeSet, }, + Attr_StoragePool: { + Computed: true, + Description: "Indicates the storage pool of the volume group", + Type: schema.TypeString, + }, Attr_VolumeIDs: { Computed: true, Description: "List of volume IDs, member of volume group.", @@ -101,12 +117,17 @@ func dataSourceIBMPIVolumeGroupDetailsRead(ctx context.Context, d *schema.Resour } d.SetId(*vgData.ID) + d.Set(Attr_Auxiliary, vgData.Auxiliary) d.Set(Attr_ConsistencyGroupName, vgData.ConsistencyGroupName) d.Set(Attr_ReplicationStatus, vgData.ReplicationStatus) + if len(vgData.ReplicationSites) > 0 { + d.Set(Attr_ReplicationSites, vgData.ReplicationSites) + } d.Set(Attr_Status, vgData.Status) if vgData.StatusDescription != nil { d.Set(Attr_StatusDescriptionErrors, flattenVolumeGroupStatusDescription(vgData.StatusDescription.Errors)) } + d.Set(Attr_StoragePool, vgData.StoragePool) d.Set(Attr_VolumeIDs, vgData.VolumeIDs) d.Set(Attr_VolumeGroupName, vgData.Name) diff --git a/ibm/service/power/data_source_ibm_pi_volume_groups.go b/ibm/service/power/data_source_ibm_pi_volume_groups.go index a704297f9e1..b3c79262fa8 100644 --- a/ibm/service/power/data_source_ibm_pi_volume_groups.go +++ b/ibm/service/power/data_source_ibm_pi_volume_groups.go @@ -35,6 +35,11 @@ func DataSourceIBMPIVolumeGroups() *schema.Resource { Description: "List of all volume groups.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + Attr_Auxiliary: { + Computed: true, + Description: "Indicates if the volume is auxiliary or not.", + Type: schema.TypeBool, + }, Attr_ConsistencyGroupName: { Computed: true, Description: "The name of consistency group at storage controller level.", @@ -50,6 +55,12 @@ func DataSourceIBMPIVolumeGroups() *schema.Resource { Description: "The replication status of volume group.", Type: schema.TypeString, }, + Attr_ReplicationSites: { + Computed: true, + Description: "Indicates the replication sites of the volume group.", + Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + }, Attr_Status: { Computed: true, Description: "The status of the volume group.", @@ -80,6 +91,11 @@ func DataSourceIBMPIVolumeGroups() *schema.Resource { }, Type: schema.TypeSet, }, + Attr_StoragePool: { + Computed: true, + Description: "Indicates the storage pool of the volume group", + Type: schema.TypeString, + }, Attr_VolumeGroupName: { Computed: true, Description: "The name of the volume group.", @@ -118,13 +134,19 @@ func flattenVolumeGroups(list []*models.VolumeGroup) []map[string]interface{} { result := make([]map[string]interface{}, 0, len(list)) for _, i := range list { l := map[string]interface{}{ + Attr_Auxiliary: i.Auxiliary, Attr_ConsistencyGroupName: i.ConsistencyGroupName, Attr_ID: *i.ID, Attr_ReplicationStatus: i.ReplicationStatus, Attr_Status: i.Status, Attr_StatusDescriptionErrors: flattenVolumeGroupStatusDescription(i.StatusDescription.Errors), + Attr_StoragePool: i.StoragePool, Attr_VolumeGroupName: i.Name, } + if len(i.ReplicationSites) > 0 { + l[Attr_ReplicationSites] = i.ReplicationSites + } + result = append(result, l) } return result diff --git a/ibm/service/power/data_source_ibm_pi_volume_groups_details.go b/ibm/service/power/data_source_ibm_pi_volume_groups_details.go index e11c5583d4b..6098962552d 100644 --- a/ibm/service/power/data_source_ibm_pi_volume_groups_details.go +++ b/ibm/service/power/data_source_ibm_pi_volume_groups_details.go @@ -35,6 +35,11 @@ func DataSourceIBMPIVolumeGroupsDetails() *schema.Resource { Description: "List of all volume group.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + Attr_Auxiliary: { + Computed: true, + Description: "Indicates if the volume is auxiliary or not.", + Type: schema.TypeBool, + }, Attr_ConsistencyGroupName: { Computed: true, Description: "The name of consistency group at storage controller level.", @@ -50,11 +55,22 @@ func DataSourceIBMPIVolumeGroupsDetails() *schema.Resource { Description: "The replication status of volume group.", Type: schema.TypeString, }, + Attr_ReplicationSites: { + Computed: true, + Description: "Indicates the replication sites of the volume group.", + Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + }, Attr_Status: { Computed: true, Description: "The status of the volume group.", Type: schema.TypeString, }, + Attr_StoragePool: { + Computed: true, + Description: "Indicates the storage pool of the volume group", + Type: schema.TypeString, + }, Attr_StatusDescriptionErrors: { Computed: true, Description: "The status details of the volume group.", @@ -124,14 +140,20 @@ func flattenVolumeGroupsDetails(list []*models.VolumeGroupDetails) []map[string] result := make([]map[string]interface{}, 0, len(list)) for _, i := range list { l := map[string]interface{}{ + Attr_Auxiliary: i.Auxiliary, Attr_ConsistencyGroupName: i.ConsistencyGroupName, Attr_ID: *i.ID, Attr_ReplicationStatus: i.ReplicationStatus, Attr_Status: i.Status, + Attr_StoragePool: i.StoragePool, "status_description_errors": flattenVolumeGroupStatusDescription(i.StatusDescription.Errors), Attr_VolumeGroupName: i.Name, Attr_VolumeIDs: i.VolumeIDs, } + if len(i.ReplicationSites) > 0 { + l[Attr_ReplicationSites] = i.ReplicationSites + } + result = append(result, l) } return result diff --git a/ibm/service/power/ibm_pi_constants.go b/ibm/service/power/ibm_pi_constants.go index 6f3fff85090..be1889ccddc 100644 --- a/ibm/service/power/ibm_pi_constants.go +++ b/ibm/service/power/ibm_pi_constants.go @@ -61,6 +61,7 @@ const ( Arg_ReplicationEnabled = "pi_replication_enabled" Arg_ReplicationPolicy = "pi_replication_policy" Arg_ReplicationScheme = "pi_replication_scheme" + Arg_ReplicationSites = "pi_replication_sites" Arg_ResourceGroupID = "pi_resource_group_id" Arg_SAP = "sap" Arg_SAPDeploymentType = "pi_sap_deployment_type" diff --git a/ibm/service/power/resource_ibm_pi_volume_group.go b/ibm/service/power/resource_ibm_pi_volume_group.go index a1031973fd5..c98497d4764 100644 --- a/ibm/service/power/resource_ibm_pi_volume_group.go +++ b/ibm/service/power/resource_ibm_pi_volume_group.go @@ -68,6 +68,12 @@ func ResourceIBMPIVolumeGroup() *schema.Resource { Description: "Consistency Group Name if volume is a part of volume group", Type: schema.TypeString, }, + Attr_ReplicationSites: { + Computed: true, + Description: "Indicates the replication sites of the volume group.", + Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + }, Attr_ReplicationStatus: { Computed: true, Description: "Volume Group Replication Status", @@ -168,6 +174,7 @@ func resourceIBMPIVolumeGroupRead(ctx context.Context, d *schema.ResourceData, m d.Set(Arg_VolumeGroupName, vg.Name) d.Set(Arg_VolumeIDs, vg.VolumeIDs) d.Set(Attr_ConsistencyGroupName, vg.ConsistencyGroupName) + d.Set(Attr_ReplicationSites, vg.ReplicationSites) d.Set(Attr_ReplicationStatus, vg.ReplicationStatus) if vg.StatusDescription != nil { d.Set(Attr_StatusDescriptionErrors, flattenVolumeGroupStatusDescription(vg.StatusDescription.Errors)) diff --git a/website/docs/d/pi_volume_group_details.html.markdown b/website/docs/d/pi_volume_group_details.html.markdown index 1f7a6619a08..0d1aa1f6322 100644 --- a/website/docs/d/pi_volume_group_details.html.markdown +++ b/website/docs/d/pi_volume_group_details.html.markdown @@ -42,9 +42,11 @@ 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. +- `auxiliary` - (Boolean) Indicates if the volume group is auxiliary. - `consistency_group_name` - (String) The name of consistency group at storage controller level. - `id` - (String) The unique identifier of the volume group. - `replication_status` - (String) The replication status of volume group. +- `replication_sites` - (List) Indicates the replication sites of the volume group. - `status` - (String) The status of the volume group. - `status_description_errors` - (List) The status details of the volume group. @@ -52,5 +54,6 @@ In addition to all argument reference list, you can access the following attribu - `key` - (String) The volume group error key. - `message` - (String) The failure message providing more details about the error key. - `volume_ids` - (List) List of volume IDs, which failed to be added/removed to/from the volume group, with the given error. +- `storage_pool` - (String) Storage pool of the volume group. - `volume_group_name` - (String) The name of the volume group. - `volume_ids` - (List) List of volume IDs, member of volume group. diff --git a/website/docs/d/pi_volume_groups.html.markdown b/website/docs/d/pi_volume_groups.html.markdown index 4b660bfbd85..00e55e61ed9 100644 --- a/website/docs/d/pi_volume_groups.html.markdown +++ b/website/docs/d/pi_volume_groups.html.markdown @@ -43,9 +43,11 @@ In addition to all argument reference list, you can access the following attribu - `volume_groups`: List of all volume groups. Nested scheme for `volume_groups`: + - `auxiliary` - (Boolean) Indicates if the volume group is auxiliary. - `consistency_group_name` - (String) The name of consistency group at storage controller level. - `id` - (String) The unique identifier of the volume group. - `replication_status` - (String) The replication status of volume group. + - `replication_sites` - (List) Indicates the replication sites of the volume group. - `status` - (String) The status of the volume group. - `status_description_errors` - (List) The status details of the volume group. @@ -53,4 +55,5 @@ In addition to all argument reference list, you can access the following attribu - `key` - (String) The volume group error key. - `message` - (String) The failure message providing more details about the error key. - `volume_ids` - (List) List of volume IDs, which failed to be added/removed to/from the volume group, with the given error. + - `storage_pool` - (String) Storage pool of the volume group. - `volume_group_name` - (String) The name of the volume group. \ No newline at end of file diff --git a/website/docs/d/pi_volume_groups_details.html.markdown b/website/docs/d/pi_volume_groups_details.html.markdown index 69f6f90b633..d690cdd2bbf 100644 --- a/website/docs/d/pi_volume_groups_details.html.markdown +++ b/website/docs/d/pi_volume_groups_details.html.markdown @@ -43,9 +43,11 @@ In addition to all argument reference list, you can access the following attribu - `volume_groups` - (List) List of all volume group. Nested scheme for `volume_groups`: + - `auxiliary` - (Boolean) Indicates if the volume group is auxiliary. - `consistency_group_name` - (String) The name of consistency group at storage controller level. - `id` - (String) The unique identifier of the volume group. - `replication_status` - (String) The replication status of volume group. + - `replication_sites` - (List) Indicates the replication sites of the volume group. - `status` - (String) The status of the volume group. - `status_description_errors` - (List) The status details of the volume group. @@ -53,5 +55,6 @@ In addition to all argument reference list, you can access the following attribu - `key` - (String) The volume group error key. - `message` - (String) The failure message providing more details about the error key. - `volume_ids` - (List) List of volume IDs, which failed to be added/removed to/from the volume group, with the given error. + - `storage_pool` - (String) Storage pool of the volume group. - `volume_group_name` - (String) The name of the volume group. - - `volume_ids` - (List) List of volume IDs, member of volume group. + - `volume_ids` - (List) List of volume IDs, member of volume group. diff --git a/website/docs/r/pi_volume_group.html.markdown b/website/docs/r/pi_volume_group.html.markdown index 27c927952fb..40b2b5b9107 100644 --- a/website/docs/r/pi_volume_group.html.markdown +++ b/website/docs/r/pi_volume_group.html.markdown @@ -59,8 +59,10 @@ Review the argument references that you can specify for your resource. In addition to all argument reference list, you can access the following attribute reference after your resource is created. +- `auxiliary` - (Boolean) Indicates if the volume group is auxiliary. - `consistency_group_name` - (String) The consistency Group Name if volume is a part of volume group. - `id` - (String) The unique identifier of the volume group. The ID is composed of `/`. +- `replication_sites` - (List) Indicates the replication sites of the volume group. - `replication_status` - (String) The replication status of volume group. - `status_description_errors` - (Set) The status details of the volume group. @@ -68,6 +70,7 @@ In addition to all argument reference list, you can access the following attribu - `key` - (String) The volume group error key. - `message` - (String) The failure message providing more details about the error key. - `volume_ids` - (List of String) List of volume IDs, which failed to be added to or removed from the volume group, with the given error. +- `storage_pool` - (String) Storage pool of the volume group. - `volume_group_id` - (String) The unique identifier of the volume group. - `volume_group_status` - (String) The status of the volume group.