@@ -59,7 +59,7 @@ func (client *Client) DeleteVolume(name string) (*Response, *ResponseStatus, err
59
59
return client .FormattedRequest ("/delete/volumes/\" %s\" " , name )
60
60
}
61
61
62
- // DeleteHost : deletes a hotst by its ID or nickname
62
+ // DeleteHost : deletes a host by its ID or nickname
63
63
func (client * Client ) DeleteHost (name string ) (* Response , * ResponseStatus , error ) {
64
64
return client .FormattedRequest ("/delete/host/\" %s\" " , name )
65
65
}
@@ -92,3 +92,26 @@ func (client *Client) ShowHostMaps(host string) ([]Volume, *ResponseStatus, erro
92
92
93
93
return mappings , status , err
94
94
}
95
+
96
+ // ShowSnapshots : list snapshots
97
+ func (client * Client ) ShowSnapshots (names ... string ) (* Response , * ResponseStatus , error ) {
98
+ if len (names ) == 0 {
99
+ return client .FormattedRequest ("/show/snapshots" )
100
+ }
101
+ return client .FormattedRequest ("/show/snapshots/%q" , strings .Join (names , "," ))
102
+ }
103
+
104
+ // CreateSnapshot : create a snapshot in a snap pool and the snap pool if it doesn't exsits
105
+ func (client * Client ) CreateSnapshot (name string , snapshotName string ) (* Response , * ResponseStatus , error ) {
106
+ return client .FormattedRequest ("/create/snapshots/volumes/%q/%q" , name , snapshotName )
107
+ }
108
+
109
+ // DeleteSnapshot : delete a snapshot
110
+ func (client * Client ) DeleteSnapshot (names ... string ) (* Response , * ResponseStatus , error ) {
111
+ return client .FormattedRequest ("/delete/snapshot/%q" , strings .Join (names , "," ))
112
+ }
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