snapshot initial code#16
Conversation
Signed-off-by: Meghna Singh <meghna@Meghnas-MacBook-Pro.local>
|
|
||
| // CreateSnapshot on the volume | ||
| func (volprov *DefaultVolumeProvider) CreateSnapshot(volume *Volume, tags map[string]string) (*Snapshot, error) { | ||
| func (volprov *DefaultVolumeProvider) CreateSnapshot(snapshotRequest SnapshotRequest) (*Snapshot, error) { |
There was a problem hiding this comment.
input parameter (mandatory, opts)
e.g, (vol-id, opts(name, tags, resource_group))
There was a problem hiding this comment.
get the resource group from vpc session
| // Snapshot ... | ||
| type Snapshot struct { | ||
| Volume | ||
| VolumeID string `json:"volumeID,omitempty"` |
There was a problem hiding this comment.
href is also required.
| SnapshotTags SnapshotTags `json:"tags,omitempty"` | ||
|
|
||
| // status of snapshot | ||
| ReadyToUse bool `json:"readyToUse,omitempty"` |
There was a problem hiding this comment.
Check for omitempty. update whereever required
|
|
||
| // Source volume details | ||
| //SnapshotedVolume *Volume `json:"SnapshotedVolume"` | ||
| SnapshotSize int64 `json:"snapshotSize,omitempty"` |
There was a problem hiding this comment.
make comment it will be in Bytes
There was a problem hiding this comment.
convert to byte and return , not omitempty
| } | ||
|
|
||
| // SnapshotRequest ... | ||
| type SnapshotRequest struct { |
There was a problem hiding this comment.
snapshot request --> snapshot parameter
|
|
||
| //GetSnapshotWithVolumeID gets the snapshot with volumeID | ||
| func (volprov *DefaultVolumeProvider) GetSnapshotWithVolumeID(volumeID string, snapshotID string) (*Snapshot, error) { | ||
| //GetSnapshotByName gets the snapshot |
There was a problem hiding this comment.
consider resource group also
ee72140 to
20728b8
Compare
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>
| ReadyToUse bool `json:"readyToUse"` | ||
|
|
||
| // VPC contains vpc fields | ||
| VPC *VPC `json:"vpc"` |
There was a problem hiding this comment.
Make vpc field as volume
| // SnapshotParameters ... | ||
| type SnapshotParameters struct { | ||
| // Name of snapshot | ||
| Name *string `json:"name,omitempty"` |
There was a problem hiding this comment.
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>
Signed-off-by: Meghna Singh meghna@Meghnas-MacBook-Pro.local