Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/provider/data_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@ type ExpandVolumeRequest struct {
Capacity int64 `json:"capacity"`
}

type ModifyVolumeRequest struct {
// VolumeID id for the volume
VolumeID string `json:"volumeID"`

// changed Volume name
Name *string `json:"name,omitempty"`

// The new IOPS of the volume
Iops int64 `json:"iops,omitempty"`

// The new Bandwidth (throughput) of the volume
Bandwidth int32 `json:"bandwidth,omitempty"`
}

// SnapshotParameters ...
type SnapshotParameters struct {
// Name of snapshot
Expand Down
5 changes: 5 additions & 0 deletions lib/provider/default_volume_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ func (volprov *DefaultVolumeProvider) AttachVolume(attachRequest VolumeAttachmen
return nil, nil
}

// ModifyVolume modify the volume with authorization by passing required information in the volume object
func (volprov *DefaultVolumeProvider) ModifyVolume(modifyVolumeRequest ModifyVolumeRequest) (int64, int32, error) {
return 0, 0, nil
}

// CreateVolumeFromSnapshot creates a volume from snapshot
func (volprov *DefaultVolumeProvider) CreateVolumeFromSnapshot(snapshot Snapshot, tags map[string]string) (*Volume, error) {
return nil, nil
Expand Down
10 changes: 10 additions & 0 deletions lib/provider/default_volume_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ func TestCreateVolumeFromSnapshot(t *testing.T) {
assert.Nil(t, volume)
}

func TestModifyVolume(t *testing.T) {
ccf := &DefaultVolumeProvider{sess: nil}

iops, bandwidth, err := ccf.ModifyVolume(ModifyVolumeRequest{})

assert.NoError(t, err)
assert.Equal(t, int64(0), iops)
assert.Equal(t, int32(0), bandwidth)
}

func TestOrderSnapshot(t *testing.T) {
ccf := &DefaultVolumeProvider{sess: nil}

Expand Down
82 changes: 82 additions & 0 deletions lib/provider/fake/fake_session.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions lib/provider/fakes/context.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/provider/volume_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,6 @@ type VolumeManager interface {
// Volume operations
// Expand the volume with authorization by passing required information in the volume object
ExpandVolume(expandVolumeRequest ExpandVolumeRequest) (int64, error)

ModifyVolume(modifyVolumeRequest ModifyVolumeRequest) (int64, int32, error)
}