Documentation
¶
Overview ¶
Package quotas provides the ability to retrieve and manage Trove quotas
Example to Get project quotas
projectID = "23d5d3f79dfa4f73b72b8b0b0063ec55"
quotasInfo, err := quotas.Get(networkClient, projectID).Extract()
if err != nil {
log.Fatal(err)
}
fmt.Printf("quotas: %#v\n", quotasInfo)
Example to Update project quotas
projectID = "23d5d3f79dfa4f73b72b8b0b0063ec55"
updateOpts := quotas.UpdateOpts{
Backups: gophercloud.IntToPointer(20),
Instances: gophercloud.IntToPointer(20),
Ram: gophercloud.IntToPointer(20),
Volumes: gophercloud.IntToPointer(20),
}
quotasInfo, err := quotas.Update(networkClient, projectID)
if err != nil {
log.Fatal(err)
}
fmt.Printf("quotas: %#v\n", quotasInfo)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a Quota.
func Get ¶
func Get(client *gophercloud.ServiceClient, projectID string) (r GetResult)
Get returns load balancer Quotas for a project.
type Quota ¶
type Quota struct {
Gigabytes int `json:"gigabytes,omitempty"`
Snapshots int `json:"snapshots,omitempty"`
SnapshotGigabytes int `json:"snapshot_gigabytes,omitempty"`
ShareGroups int `json:"share_groups,omitempty"`
ShareGroupSnapshots int `json:"share_group_snapshots,omitempty"`
ShareReplicas int `json:"share_replicas,omitempty"`
// version 2.53
ReplicaGigabytes int `json:"replica_gigabytes,omitempty"`
PerShareGigabytes int `json:"per_share_gigabytes,omitempty"`
}
Quota contains load balancer quotas for a project.
func (*Quota) UnmarshalJSON ¶
UnmarshalJSON provides backwards compatibility to OpenStack APIs which still return the deprecated `load_balancer` or `health_monitor` as quota values instead of `loadbalancer` and `healthmonitor`.
type UpdateOpts ¶
type UpdateOpts struct {
Force bool `json:"force,omitempty"`
Gigabytes int `json:"gigabytes,omitempty"`
Snapshots int `json:"snapshots,omitempty"`
SnapshotGigabytes int `json:"snapshot_gigabytes,omitempty"`
ShareGroups int `json:"share_groups,omitempty"`
ShareGroupSnapshots int `json:"share_group_snapshots,omitempty"`
ShareReplicas int `json:"share_replicas,omitempty"`
// version 2.53
ReplicaGigabytes int `json:"replica_gigabytes,omitempty"`
PerShareGigabytes int `json:"per_share_gigabytes,omitempty"`
}
UpdateOpts represents options used to update the load balancer Quotas.
func (UpdateOpts) ToQuotaUpdateMap ¶
func (opts UpdateOpts) ToQuotaUpdateMap() (map[string]interface{}, error)
ToQuotaUpdateMap builds a request body from UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Quota.
func Update ¶
func Update(c *gophercloud.ServiceClient, projectID string, opts UpdateOptsBuilder) (r UpdateResult)
Update accepts a UpdateOpts struct and updates an existing load balancer Quotas using the values provided.