Skip to content

snapshot initial code#16

Open
meghnasiingh wants to merge 12 commits intomasterfrom
snapshot
Open

snapshot initial code#16
meghnasiingh wants to merge 12 commits intomasterfrom
snapshot

Conversation

@meghnasiingh
Copy link
Copy Markdown
Contributor

Signed-off-by: Meghna Singh meghna@Meghnas-MacBook-Pro.local

Meghna Singh added 7 commits December 21, 2021 09:05
Signed-off-by: Meghna Singh <meghna@Meghnas-MacBook-Pro.local>
Signed-off-by: Meghna Singh <meghna@Meghnas-MacBook-Pro.local>
Signed-off-by: Meghna Singh <meghna@Meghnas-MacBook-Pro.local>
Signed-off-by: Meghna Singh <meghna@Meghnas-MacBook-Pro.local>
Signed-off-by: Meghna Singh <meghna@Meghnas-MacBook-Pro.local>
Signed-off-by: Meghna Singh <meghna@Meghnas-MacBook-Pro.local>
ref
Signed-off-by: Meghna Singh <meghna@Meghnas-MacBook-Pro.local>
Comment thread lib/provider/default_volume_provider.go Outdated

// CreateSnapshot on the volume
func (volprov *DefaultVolumeProvider) CreateSnapshot(volume *Volume, tags map[string]string) (*Snapshot, error) {
func (volprov *DefaultVolumeProvider) CreateSnapshot(snapshotRequest SnapshotRequest) (*Snapshot, error) {
Copy link
Copy Markdown
Contributor Author

@meghnasiingh meghnasiingh Feb 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input parameter (mandatory, opts)
e.g, (vol-id, opts(name, tags, resource_group))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get the resource group from vpc session

Comment thread lib/provider/data_types.go Outdated
// Snapshot ...
type Snapshot struct {
Volume
VolumeID string `json:"volumeID,omitempty"`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

href is also required.

Comment thread lib/provider/data_types.go Outdated
SnapshotTags SnapshotTags `json:"tags,omitempty"`

// status of snapshot
ReadyToUse bool `json:"readyToUse,omitempty"`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check for omitempty. update whereever required

Comment thread lib/provider/data_types.go Outdated

// Source volume details
//SnapshotedVolume *Volume `json:"SnapshotedVolume"`
SnapshotSize int64 `json:"snapshotSize,omitempty"`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make comment it will be in Bytes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert to byte and return , not omitempty

Comment thread lib/provider/data_types.go Outdated
}

// SnapshotRequest ...
type SnapshotRequest struct {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snapshot request --> snapshot parameter


//GetSnapshotWithVolumeID gets the snapshot with volumeID
func (volprov *DefaultVolumeProvider) GetSnapshotWithVolumeID(volumeID string, snapshotID string) (*Snapshot, error) {
//GetSnapshotByName gets the snapshot
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider resource group also

Signed-off-by: Meghna Singh <Meghna.Singh1@ibm.com>
Signed-off-by: Meghna Singh <Meghna.Singh1@ibm.com>
Signed-off-by: Meghna Singh <Meghna.Singh1@ibm.com>
Comment thread lib/provider/data_types.go Outdated
ReadyToUse bool `json:"readyToUse"`

// VPC contains vpc fields
VPC *VPC `json:"vpc"`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make vpc field as volume

Comment thread lib/provider/data_types.go Outdated
// SnapshotParameters ...
type SnapshotParameters struct {
// Name of snapshot
Name *string `json:"name,omitempty"`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if we can remove string pointer

Signed-off-by: Meghna Singh <Meghna.Singh1@ibm.com>
Signed-off-by: Meghna Singh <Meghna.Singh1@ibm.com>
@ambiknai ambiknai mentioned this pull request Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant