/
doc.go
61 lines (46 loc) · 1.11 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
Package backups provides information and interaction with backups in the
OpenStack Block Storage service. A backup is a point in time copy of the
data contained in an external storage volume, and can be controlled
programmatically.
Example to List Backups
listOpts := backups.ListOpts{
VolumeID: "uuid",
}
allPages, err := backups.List(client, listOpts).AllPages()
if err != nil {
panic(err)
}
allBackups, err := backups.ExtractBackups(allPages)
if err != nil {
panic(err)
}
for _, backup := range allBackups {
fmt.Println(backup)
}
Example to Create a Backup
createOpts := backups.CreateOpts{
VolumeID: "uuid",
Name: "my-backup",
}
backup, err := backups.Create(client, createOpts).Extract()
if err != nil {
panic(err)
}
fmt.Println(backup)
Example to Update a Backup
updateOpts := backups.UpdateOpts{
Name: "new-name",
}
backup, err := backups.Update(client, "uuid", updateOpts).Extract()
if err != nil {
panic(err)
}
fmt.Println(backup)
Example to Delete a Backup
err := backups.Delete(client, "uuid").ExtractErr()
if err != nil {
panic(err)
}
*/
package backups