diff --git a/go.mod b/go.mod index de81d322f1..a6ef2a413c 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 4b4ae2f1f9..9608c2c7cb 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= @@ -138,8 +138,6 @@ github.com/IBM/container-registry-go-sdk v1.1.0 h1:sYyknIod8R4RJZQqAheiduP6wbSTp github.com/IBM/container-registry-go-sdk v1.1.0/go.mod h1:4TwsCnQtVfZ4Vkapy/KPvQBKFc3VOyUZYkwRU4FTPrs= github.com/IBM/continuous-delivery-go-sdk v1.6.0 h1:eAL/jIWHrDFlWDF+Qd9Y5UN99Pr5Mjd/H/bvTbXUbz4= github.com/IBM/continuous-delivery-go-sdk v1.6.0/go.mod h1:nZdKUnubXNLo+zo28R4Rd+TGDqiJ/xoE8WO/A3kLw1E= -github.com/IBM/event-notifications-go-admin-sdk v0.8.0 h1:xk2CYTayQtKi6LSgGGFRxFJfWUxyM5SY8Rs64ducAhw= -github.com/IBM/event-notifications-go-admin-sdk v0.8.0/go.mod h1:OByvqfrNVxs7G6ggv8pwQCEVw10/TBJCLh7NM3z707w= github.com/IBM/event-notifications-go-admin-sdk v0.9.0 h1:eaCd+GkxhNyot+8rA9WkAQdlVYrRD20LYiXjEytFO6M= github.com/IBM/event-notifications-go-admin-sdk v0.9.0/go.mod h1:OByvqfrNVxs7G6ggv8pwQCEVw10/TBJCLh7NM3z707w= github.com/IBM/eventstreams-go-sdk v1.4.0 h1:yS/Ns29sBOe8W2tynQmz9HTKqQZ0ckse4Py5Oy/F2rM= @@ -187,8 +185,6 @@ github.com/IBM/scc-go-sdk/v5 v5.4.1 h1:RXIuxOo9/hxkWyHCI69ae+KIJgSbXcAkJwTEl+fO3 github.com/IBM/scc-go-sdk/v5 v5.4.1/go.mod h1:2xQTDgNXG5QMEfQxBDKB067z+5ha6OgcaKCTcdGDAo8= github.com/IBM/schematics-go-sdk v0.2.3 h1:lgTt0Sbudii3cuSk1YSQgrtiZAXDbBABAoVj3eQuBrU= github.com/IBM/schematics-go-sdk v0.2.3/go.mod h1:Tw2OSAPdpC69AxcwoyqcYYaGTTW6YpERF9uNEU+BFRQ= -github.com/IBM/secrets-manager-go-sdk/v2 v2.0.5 h1:VMc/Zd6RzB8j60CqZekkwYT2wQsCfrkGV2n01Gviuaw= -github.com/IBM/secrets-manager-go-sdk/v2 v2.0.5/go.mod h1:5kUgJ1dG9cdiAcPDqVz46m362bPnoqZQSth24NiowSg= github.com/IBM/secrets-manager-go-sdk/v2 v2.0.6 h1:bF6bAdI4wDZSje6+Yx1mJxvirboxO+uMuKhzgfRCNxE= github.com/IBM/secrets-manager-go-sdk/v2 v2.0.6/go.mod h1:XWYnbcc5vN1RnKwk/fCzfD8aZd7At/Y1/b6c+oDyliU= github.com/IBM/vmware-go-sdk v0.1.2 h1:5lKWFyInWz9e2hwGsoFTEoLa1jYkD30SReN0fQ10w9M= diff --git a/ibm/service/power/data_source_ibm_pi_disaster_recovery_location.go b/ibm/service/power/data_source_ibm_pi_disaster_recovery_location.go index 4c839ab37f..c8f9a557d3 100644 --- a/ibm/service/power/data_source_ibm_pi_disaster_recovery_location.go +++ b/ibm/service/power/data_source_ibm_pi_disaster_recovery_location.go @@ -47,6 +47,25 @@ func DataSourceIBMPIDisasterRecoveryLocation() *schema.Resource { Description: "The region zone of the location.", Type: schema.TypeString, }, + Attr_ReplicationPoolMap: { + Computed: true, + Description: "List of replication pool map.", + Type: schema.TypeList, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + Attr_RemotePool: { + Computed: true, + Description: "Remote pool.", + Type: schema.TypeString, + }, + Attr_VolumePool: { + Computed: true, + Description: "Volume pool.", + Type: schema.TypeString, + }, + }, + }, + }, }, }, Type: schema.TypeList, @@ -69,11 +88,22 @@ func dataSourceIBMPIDisasterRecoveryLocation(ctx context.Context, d *schema.Reso } result := make([]map[string]interface{}, 0, len(drLocationSite.ReplicationSites)) - for _, i := range drLocationSite.ReplicationSites { - if i != nil { + for _, site := range drLocationSite.ReplicationSites { + if site != nil { + replicationPoolMap := make([]map[string]string, 0) + if site.ReplicationPoolMap != nil { + for _, rMap := range site.ReplicationPoolMap { + replicationPool := make(map[string]string) + replicationPool[Attr_RemotePool] = rMap.RemotePool + replicationPool[Attr_VolumePool] = rMap.VolumePool + replicationPoolMap = append(replicationPoolMap, replicationPool) + } + } + l := map[string]interface{}{ - Attr_IsActive: i.IsActive, - Attr_Location: i.Location, + Attr_IsActive: site.IsActive, + Attr_Location: site.Location, + Attr_ReplicationPoolMap: replicationPoolMap, } result = append(result, l) } diff --git a/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations.go b/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations.go index c838348000..7ff1a9f0a3 100644 --- a/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations.go +++ b/ibm/service/power/data_source_ibm_pi_disaster_recovery_locations.go @@ -43,6 +43,25 @@ func DataSourceIBMPIDisasterRecoveryLocations() *schema.Resource { Description: "The region zone of the location.", Type: schema.TypeString, }, + Attr_ReplicationPoolMap: { + Computed: true, + Description: "List of replication pool map.", + Type: schema.TypeList, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + Attr_RemotePool: { + Computed: true, + Description: "Remote pool.", + Type: schema.TypeString, + }, + Attr_VolumePool: { + Computed: true, + Description: "Volume pool.", + Type: schema.TypeString, + }, + }, + }, + }, }, }, Type: schema.TypeList, @@ -67,20 +86,30 @@ func dataSourceIBMPIDisasterRecoveryLocations(ctx context.Context, d *schema.Res } results := make([]map[string]interface{}, 0, len(drLocationSites.DisasterRecoveryLocations)) - for _, i := range drLocationSites.DisasterRecoveryLocations { - if i != nil { - replicationSites := make([]map[string]interface{}, 0, len(i.ReplicationSites)) - for _, j := range i.ReplicationSites { - if j != nil { + for _, drl := range drLocationSites.DisasterRecoveryLocations { + if drl != nil { + replicationSites := make([]map[string]interface{}, 0, len(drl.ReplicationSites)) + for _, site := range drl.ReplicationSites { + if site != nil { + replicationPoolMap := make([]map[string]string, 0) + if site.ReplicationPoolMap != nil { + for _, rMap := range site.ReplicationPoolMap { + replicationPool := make(map[string]string) + replicationPool[Attr_RemotePool] = rMap.RemotePool + replicationPool[Attr_VolumePool] = rMap.VolumePool + replicationPoolMap = append(replicationPoolMap, replicationPool) + } + } r := map[string]interface{}{ - Attr_IsActive: j.IsActive, - Attr_Location: j.Location, + Attr_IsActive: site.IsActive, + Attr_Location: site.Location, + Attr_ReplicationPoolMap: replicationPoolMap, } replicationSites = append(replicationSites, r) } } l := map[string]interface{}{ - Attr_Location: i.Location, + Attr_Location: drl.Location, Attr_ReplicationSites: replicationSites, } results = append(results, l) diff --git a/ibm/service/power/ibm_pi_constants.go b/ibm/service/power/ibm_pi_constants.go index 6f3fff8509..4e672b0e61 100644 --- a/ibm/service/power/ibm_pi_constants.go +++ b/ibm/service/power/ibm_pi_constants.go @@ -290,7 +290,9 @@ const ( Attr_RemoteCopyID = "remote_copy_id" Attr_RemoteCopyRelationshipNames = "remote_copy_relationship_names" Attr_RemoteCopyRelationships = "remote_copy_relationships" + Attr_RemotePool = "remote_pool" Attr_ReplicationEnabled = "replication_enabled" + Attr_ReplicationPoolMap = "replication_pool_map" Attr_ReplicationSites = "replication_sites" Attr_ReplicationStatus = "replication_status" Attr_ReplicationType = "replication_type" diff --git a/website/docs/d/pi_disaster_recovery_location.html.markdown b/website/docs/d/pi_disaster_recovery_location.html.markdown index 60e7415568..9c34604e24 100644 --- a/website/docs/d/pi_disaster_recovery_location.html.markdown +++ b/website/docs/d/pi_disaster_recovery_location.html.markdown @@ -46,3 +46,7 @@ In addition to all argument reference list, you can access the following attribu Nested scheme for `replication_sites`: - `is_active` - (Boolean) Indicates the location is active or not, `true` if location is active , otherwise it is `false`. - `location` - (String) The region zone of the location. + - `replication_pool_map` - (List) List of replication pool map. + Nested scheme for `replication_pool_map`: + - `remote_pool` - (String) Remote pool. + - `volume_pool` - (String) Volume pool. diff --git a/website/docs/d/pi_disaster_recovery_locations.html.markdown b/website/docs/d/pi_disaster_recovery_locations.html.markdown index 6ed0e43817..c15ed91d56 100644 --- a/website/docs/d/pi_disaster_recovery_locations.html.markdown +++ b/website/docs/d/pi_disaster_recovery_locations.html.markdown @@ -38,7 +38,10 @@ In addition to all argument reference list, you can access the following attribu Nested scheme for `disaster_recovery_locations`: - `location` - (String) The region zone of a site. - `replication_sites` - List of Replication Sites. - Nested scheme for `replication_sites`: - `is_active` - (Boolean) Indicates the location is active or not, `true` if location is active, otherwise it is `false`. - `location` - (String) The region zone of the location. + - `replication_pool_map` - (List) List of replication pool maps. + Nested scheme for `replication_pool_map`: + - `remote_pool` - (String) Remote pool. + - `volume_pool` - (String) Volume pool.