/
doc.go
65 lines (51 loc) · 1.29 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
62
63
64
65
/*
Package aggregates manages information about the host aggregates in the
OpenStack cloud.
Example of Create Aggregate
opts := aggregates.CreateOpts{
Name: "name",
AvailabilityZone: "london",
}
aggregate, err := aggregates.Create(computeClient, opts).Extract()
if err != nil {
panic(err)
}
fmt.Printf("%+v\n", aggregate)
Example of Show Aggregate Details
aggregateID := 42
aggregate, err := aggregates.Get(computeClient, aggregateID).Extract()
if err != nil {
panic(err)
}
fmt.Printf("%+v\n", aggregate)
Example of Delete Aggregate
aggregateID := 32
err := aggregates.Delete(computeClient, aggregateID).ExtractErr()
if err != nil {
panic(err)
}
Example of Update Aggregate
aggregateID := 42
opts := aggregates.UpdateOpts{
Name: "new_name",
AvailabilityZone: "nova2",
}
aggregate, err := aggregates.Update(computeClient, aggregateID, opts).Extract()
if err != nil {
panic(err)
}
fmt.Printf("%+v\n", aggregate)
Example of Retrieving list of all aggregates
allPages, err := aggregates.List(computeClient).AllPages()
if err != nil {
panic(err)
}
allAggregates, err := aggregates.ExtractAggregates(allPages)
if err != nil {
panic(err)
}
for _, aggregate := range allAggregates {
fmt.Printf("%+v\n", aggregate)
}
*/
package aggregates