Skip to content

Commit 8ca5cbd

Browse files
fix(instance): make CreateSnapshotRequest.volume_id nullable (#1425)
Co-authored-by: Jules Casteran <[email protected]>
1 parent e4665d9 commit 8ca5cbd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/instance/v1/instance_sdk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2975,7 +2975,7 @@ type CreateSnapshotRequest struct {
29752975
// Name: name of the snapshot
29762976
Name string `json:"name,omitempty"`
29772977
// VolumeID: UUID of the volume
2978-
VolumeID string `json:"volume_id,omitempty"`
2978+
VolumeID *string `json:"volume_id,omitempty"`
29792979
// Tags: the tags of the snapshot
29802980
Tags []string `json:"tags,omitempty"`
29812981
// Deprecated: Organization: organization ID of the snapshot

api/instance/v1/snapshot_utils_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func createSnapshot(t *testing.T, instanceAPI *API, snapshotName string) (*Snaps
4242
// Backup will create a snapshot for each volume + an image base on all snapshots.
4343
snapshot, err := instanceAPI.CreateSnapshot(&CreateSnapshotRequest{
4444
Name: snapshotName,
45-
VolumeID: serverRes.Server.Volumes["0"].ID,
45+
VolumeID: &serverRes.Server.Volumes["0"].ID,
4646
})
4747
testhelpers.AssertNoError(t, err)
4848

@@ -88,7 +88,7 @@ func TestAPI_UpdateSnapshot(t *testing.T) {
8888

8989
createResponse, err := instanceAPI.CreateSnapshot(&CreateSnapshotRequest{
9090
Name: "name",
91-
VolumeID: createVolume.Volume.ID,
91+
VolumeID: &createVolume.Volume.ID,
9292
})
9393
testhelpers.AssertNoError(t, err)
9494

0 commit comments

Comments
 (0)