Skip to content

Commit fa7bbee

Browse files
committed
add ReplicationTargetCRN
1 parent 92a6f6b commit fa7bbee

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

ibm/service/power/ibm_pi_constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ const (
452452
Attr_ReplicationPoolMap = "replication_pool_map"
453453
Attr_ReplicationSites = "replication_sites"
454454
Attr_ReplicationStatus = "replication_status"
455+
Attr_ReplicationTargetCRN = "replication_target_crn"
455456
Attr_ReplicationType = "replication_type"
456457
Attr_ReservedCore = "reserved_core"
457458
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)