Skip to content

Commit 7d95a2d

Browse files
committed
add ReplicationTargetCRN
1 parent c7af8f5 commit 7d95a2d

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.24.2
55
require (
66
github.com/IBM-Cloud/bluemix-go v0.0.0-20250912140913-e279174fe80b
77
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113
8-
github.com/IBM-Cloud/power-go-client v1.12.0
8+
github.com/IBM-Cloud/power-go-client v1.14.0-beta2
99
github.com/IBM/appconfiguration-go-admin-sdk v0.5.1
1010
github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f
1111
github.com/IBM/cloud-databases-go-sdk v0.8.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ github.com/IBM-Cloud/power-go-client v1.13.0-beta8 h1:SU7ZW9oxBZgvGzcu8oCyzmn6hH
100100
github.com/IBM-Cloud/power-go-client v1.13.0-beta8/go.mod h1:SpTK1ttW8bfMNUVQS8qOEuWn2KOkzaCLyzfze8MG1JE=
101101
github.com/IBM-Cloud/power-go-client v1.13.0-beta9 h1:RYwG71ucJGr3FHoPpFgBx8ak6pVwiEgRg3W/u9HxgTM=
102102
github.com/IBM-Cloud/power-go-client v1.13.0-beta9/go.mod h1:SpTK1ttW8bfMNUVQS8qOEuWn2KOkzaCLyzfze8MG1JE=
103+
github.com/IBM-Cloud/power-go-client v1.14.0-beta2 h1:+wzA0Ej07tDa1VJJIOx7AEWWVfZE8jM5zN7giiiu86c=
104+
github.com/IBM-Cloud/power-go-client v1.14.0-beta2/go.mod h1:SpTK1ttW8bfMNUVQS8qOEuWn2KOkzaCLyzfze8MG1JE=
103105
github.com/IBM-Cloud/softlayer-go v1.0.5-tf h1:koUAyF9b6X78lLLruGYPSOmrfY2YcGYKOj/Ug9nbKNw=
104106
github.com/IBM-Cloud/softlayer-go v1.0.5-tf/go.mod h1:6HepcfAXROz0Rf63krk5hPZyHT6qyx2MNvYyHof7ik4=
105107
github.com/IBM/appconfiguration-go-admin-sdk v0.5.1 h1:EAotl3yQ/u5u/uBryySJMm0COgsYhtNzQ1g2IChtlE0=

ibm/service/power/ibm_pi_constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ const (
415415
Attr_ReplicationPoolMap = "replication_pool_map"
416416
Attr_ReplicationSites = "replication_sites"
417417
Attr_ReplicationStatus = "replication_status"
418+
Attr_ReplicationTargetCRN = "replication_target_crn"
418419
Attr_ReplicationType = "replication_type"
419420
Attr_ReservedCore = "reserved_core"
420421
Attr_ReservedCores = "reserved_cores"

ibm/service/power/resource_ibm_pi_volume_group.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ func ResourceIBMPIVolumeGroup() *schema.Resource {
8585
Description: "Volume Group Replication Status",
8686
Type: schema.TypeString,
8787
},
88+
Attr_ReplicationTargetCRN: {
89+
Computed: true,
90+
Description: "CRN of the replication target workspace; for a primary replicated volume this is the target workspace that owns the auxiliary data; for an auxiliary replicated volume this is the target workspace that owns the primary data.",
91+
Type: schema.TypeString,
92+
},
8893
Attr_StatusDescriptionErrors: {
8994
Computed: true,
9095
Description: "The status details of the volume group.",
@@ -189,6 +194,7 @@ func resourceIBMPIVolumeGroupRead(ctx context.Context, d *schema.ResourceData, m
189194
}
190195
d.Set(Attr_VolumeGroupID, vg.ID)
191196
d.Set(Attr_VolumeGroupStatus, vg.Status)
197+
d.Set(Attr_ReplicationTargetCRN, vg.ReplicationTargetCRN)
192198

193199
return nil
194200
}
@@ -259,12 +265,7 @@ func resourceIBMPIVolumeGroupDelete(ctx context.Context, d *schema.ResourceData,
259265
return diag.FromErr(err)
260266
}
261267
}
262-
body := &models.VolumeGroupDelete{}
263-
if v, ok := d.GetOk(Arg_TargetCRN); ok {
264-
targetCRN := v.(string)
265-
body.TargetCRN = &targetCRN
266-
}
267-
err = client.DeleteVolumeGroupWithBody(vgID, body)
268+
err = client.DeleteVolumeGroup(vgID)
268269
if err != nil {
269270
return diag.FromErr(err)
270271
}

website/docs/r/pi_volume_group.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ In addition to all argument reference list, you can access the following attribu
6565
- `id` - (String) The unique identifier of the volume group. The ID is composed of `<pi_cloud_instance_id>/<volume_group_id>`.
6666
- `replication_sites` - (List) Indicates the replication sites of the volume group.
6767
- `replication_status` - (String) The replication status of volume group.
68+
- `replication_target_crn` - (String) CRN of the replication target workspace; for a primary replicated volume this is the target workspace that owns the auxiliary data; for an auxiliary replicated volume this is the target workspace that owns the primary data.
6869
- `status_description_errors` - (Set) The status details of the volume group.
6970

7071
Nested scheme for `status_description_errors`:

0 commit comments

Comments
 (0)