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
|