File: doc.go

package info (click to toggle)
golang-github-gophercloud-gophercloud 0.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, bullseye-backports
  • size: 10,224 kB
  • sloc: sh: 125; makefile: 21
file content (59 lines) | stat: -rw-r--r-- 1,151 bytes parent folder | download | duplicates (3)
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
/*
Package domains manages and retrieves Domains in the OpenStack Identity Service.

Example to List Domains

	var iTrue bool = true
	listOpts := domains.ListOpts{
		Enabled: &iTrue,
	}

	allPages, err := domains.List(identityClient, listOpts).AllPages()
	if err != nil {
		panic(err)
	}

	allDomains, err := domains.ExtractDomains(allPages)
	if err != nil {
		panic(err)
	}

	for _, domain := range allDomains {
		fmt.Printf("%+v\n", domain)
	}

Example to Create a Domain

	createOpts := domains.CreateOpts{
		Name:             "domain name",
		Description:      "Test domain",
	}

	domain, err := domains.Create(identityClient, createOpts).Extract()
	if err != nil {
		panic(err)
	}

Example to Update a Domain

	domainID := "0fe36e73809d46aeae6705c39077b1b3"

	var iFalse bool = false
	updateOpts := domains.UpdateOpts{
		Enabled: &iFalse,
	}

	domain, err := domains.Update(identityClient, domainID, updateOpts).Extract()
	if err != nil {
		panic(err)
	}

Example to Delete a Domain

	domainID := "0fe36e73809d46aeae6705c39077b1b3"
	err := domains.Delete(identityClient, domainID).ExtractErr()
	if err != nil {
		panic(err)
	}
*/
package domains