Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Commit e9e1556

Browse files
committed
feat(endpoints): volume copy
1 parent 1202ad9 commit e9e1556

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

endpoints.go

+10-5
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (client *Client) DeleteVolume(name string) (*Response, *ResponseStatus, err
5959
return client.FormattedRequest("/delete/volumes/\"%s\"", name)
6060
}
6161

62-
// DeleteHost : deletes a hotst by its ID or nickname
62+
// DeleteHost : deletes a host by its ID or nickname
6363
func (client *Client) DeleteHost(name string) (*Response, *ResponseStatus, error) {
6464
return client.FormattedRequest("/delete/host/\"%s\"", name)
6565
}
@@ -93,20 +93,25 @@ func (client *Client) ShowHostMaps(host string) ([]Volume, *ResponseStatus, erro
9393
return mappings, status, err
9494
}
9595

96-
// ShowSnapshots : List snapshots
96+
// ShowSnapshots : list snapshots
9797
func (client *Client) ShowSnapshots(names ...string) (*Response, *ResponseStatus, error) {
9898
if len(names) == 0 {
9999
return client.FormattedRequest("/show/snapshots")
100100
}
101101
return client.FormattedRequest("/show/snapshots/%q", strings.Join(names, ","))
102102
}
103103

104-
// CreateSnapshot : Create a snapshot in a snap pool and the snap pool if it doesn't exsits
104+
// CreateSnapshot : create a snapshot in a snap pool and the snap pool if it doesn't exsits
105105
func (client *Client) CreateSnapshot(name string, snapshotName string) (*Response, *ResponseStatus, error) {
106-
return client.FormattedRequest("/create/snapshots/volumes/%q/%q/", name, snapshotName)
106+
return client.FormattedRequest("/create/snapshots/volumes/%q/%q", name, snapshotName)
107107
}
108108

109-
// DeleteSnapshot : Delete a snapshot from a snap pool
109+
// DeleteSnapshot : delete a snapshot
110110
func (client *Client) DeleteSnapshot(names ...string) (*Response, *ResponseStatus, error) {
111111
return client.FormattedRequest("/delete/snapshot/%q", strings.Join(names, ","))
112112
}
113+
114+
// CopyVolume : create an new volume by copying another one or a snapshot
115+
func (client *Client) CopyVolume(sourceName string, destinationName string, pool string) (*Response, *ResponseStatus, error) {
116+
return client.FormattedRequest("/copy/volume/destination-pool/%q/name/%q/%q", pool, destinationName, sourceName)
117+
}

0 commit comments

Comments
 (0)