/
doc.go
54 lines (40 loc) · 982 Bytes
/
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
/*
Package qos provides information and interaction with the QoS specifications
for the Openstack Blockstorage service.
Example to create a QoS specification
createOpts := qos.CreateOpts{
Name: "test",
Consumer: qos.ConsumerFront,
Specs: map[string]string{
"read_iops_sec": "20000",
},
}
test, err := qos.Create(client, createOpts).Extract()
if err != nil {
log.Fatal(err)
}
fmt.Printf("QoS: %+v\n", test)
Example to delete a QoS specification
qosID := "d6ae28ce-fcb5-4180-aa62-d260a27e09ae"
deleteOpts := qos.DeleteOpts{
Force: false,
}
err = qos.Delete(client, qosID, deleteOpts).ExtractErr()
if err != nil {
log.Fatal(err)
}
Example to list QoS specifications
listOpts := qos.ListOpts{}
allPages, err := qos.List(client, listOpts).AllPages()
if err != nil {
panic(err)
}
allQoS, err := qos.ExtractQoS(allPages)
if err != nil {
panic(err)
}
for _, qos := range allQoS {
fmt.Printf("List: %+v\n", qos)
}
*/
package qos