diff --git a/client.go b/client.go index 1e7dda4..43eeffe 100644 --- a/client.go +++ b/client.go @@ -132,6 +132,7 @@ type Client interface { GetVolumeGroups(ctx context.Context) ([]VolumeGroup, error) CreateVolumeGroup(ctx context.Context, createParams *VolumeGroupCreate) (CreateResponse, error) CreateVolumeGroupSnapshot(ctx context.Context, volumeGroupID string, createParams *VolumeGroupSnapshotCreate) (resp CreateResponse, err error) + ModifyVolumeGroupSnapshot(ctx context.Context, modifyParams *VolumeGroupSnapshotModify, id string) (resp EmptyResponse, err error) UpdateVolumeGroupProtectionPolicy(ctx context.Context, id string, params *VolumeGroupChangePolicy) (resp EmptyResponse, err error) RemoveMembersFromVolumeGroup(ctx context.Context, params *VolumeGroupMembers, id string) (EmptyResponse, error) AddMembersToVolumeGroup(ctx context.Context, params *VolumeGroupMembers, id string) (EmptyResponse, error) diff --git a/volume_group.go b/volume_group.go index 644fffa..4bf95b4 100644 --- a/volume_group.go +++ b/volume_group.go @@ -218,6 +218,22 @@ func (c *ClientIMPL) CreateVolumeGroupSnapshot(ctx context.Context, volumeGroupI return resp, WrapErr(err) } +// ModifyVolumeGroup modifies existing volume group snapshot +func (c *ClientIMPL) ModifyVolumeGroupSnapshot(ctx context.Context, + modifyParams *VolumeGroupSnapshotModify, id string, +) (resp EmptyResponse, err error) { + _, err = c.APIClient().Query( + ctx, + RequestConfig{ + Method: "PATCH", + Endpoint: volumeGroupURL, + ID: id, + Body: modifyParams, + }, + &resp) + return resp, WrapErr(err) +} + // GetVolumeGroupSnapshot query and return specific snapshot by id func (c *ClientIMPL) GetVolumeGroupSnapshot(ctx context.Context, snapID string) (resVol VolumeGroup, err error) { qp := getVolumeGroupDefaultQueryParams(c) diff --git a/volume_group_types.go b/volume_group_types.go index 57c4c02..ee69b1d 100644 --- a/volume_group_types.go +++ b/volume_group_types.go @@ -110,6 +110,14 @@ type VolumeGroupModify struct { ExpirationTimestamp *string `json:"expiration_timestamp,omitempty"` } +// VolumeGroupSnapshotModify modifies existing Volume Group Snapshot Similar to volume group modify without protection policy since this is an invalid field for VolumeGroupSnapshot +type VolumeGroupSnapshotModify struct { + Description string `json:"description"` + Name string `json:"name,omitempty"` + IsWriteOrderConsistent bool `json:"is_write_order_consistent,omitempty"` + ExpirationTimestamp *string `json:"expiration_timestamp,omitempty"` +} + type VolumeGroupChangePolicy struct { ProtectionPolicyID string `json:"protection_policy_id"` }