File: doc.go

package info (click to toggle)
golang-github-gophercloud-gophercloud 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,416 kB
  • sloc: sh: 99; makefile: 21
file content (60 lines) | stat: -rw-r--r-- 1,337 bytes parent folder | download
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
/*
Package quotasets enables retrieving and managing Block Storage quotas.

Example to Get a Quota Set

	quotaset, err := quotasets.Get(blockStorageClient, "project-id").Extract()
	if err != nil {
		panic(err)
	}

	fmt.Printf("%+v\n", quotaset)

Example to Get Quota Set Usage

	quotaset, err := quotasets.GetUsage(blockStorageClient, "project-id").Extract()
	if err != nil {
		panic(err)
	}

	fmt.Printf("%+v\n", quotaset)

Example to Update a Quota Set

	updateOpts := quotasets.UpdateOpts{
		Volumes: gophercloud.IntToPointer(100),
	}

	quotaset, err := quotasets.Update(blockStorageClient, "project-id", updateOpts).Extract()
	if err != nil {
		panic(err)
	}

	fmt.Printf("%+v\n", quotaset)

Example to Update a Quota set with volume_type quotas

	updateOpts := quotasets.UpdateOpts{
		Volumes: gophercloud.IntToPointer(100),
		Extra: map[string]interface{}{
			"gigabytes_foo": gophercloud.IntToPointer(100),
			"snapshots_foo": gophercloud.IntToPointer(10),
			"volumes_foo":   gophercloud.IntToPointer(10),
		},
	}

	quotaset, err := quotasets.Update(blockStorageClient, "project-id", updateOpts).Extract()
	if err != nil {
		panic(err)
	}

	fmt.Printf("%+v\n", quotaset)

Example to Delete a Quota Set

	err := quotasets.Delete(blockStorageClient, "project-id").ExtractErr()
	if err != nil {
		panic(err)
	}
*/
package quotasets