-
Notifications
You must be signed in to change notification settings - Fork 7
/
doc.go
48 lines (38 loc) · 922 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
/*
Package zones provides information and interaction with the zone API
resource for the OpenStack DNS service.
Example to List Zones
listOpts := zones.ListOpts{
Email: "jdoe@example.com",
}
allPages, err := zones.List(dnsClient, listOpts).AllPages()
if err != nil {
panic(err)
}
allZones, err := zones.ExtractZones(allPages)
if err != nil {
panic(err)
}
for _, zone := range allZones {
fmt.Printf("%+v\n", zone)
}
Example to Create a Zone
createOpts := zones.CreateOpts{
Name: "example.com.",
Email: "jdoe@example.com",
Type: "PRIMARY",
TTL: 7200,
Description: "This is a zone.",
}
zone, err := zones.Create(dnsClient, createOpts).Extract()
if err != nil {
panic(err)
}
Example to Delete a Zone
zoneID := "99d10f68-5623-4491-91a0-6daafa32b60e"
err := zones.Delete(dnsClient, zoneID).ExtractErr()
if err != nil {
panic(err)
}
*/
package zones