quotas

package
v0.3.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2020 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Sentinel = -1

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(c *gcorecloud.ServiceClient, id int) (r GetResult)

Get retrieves a specific quota based on its unique ID.

func OwnQuota

func OwnQuota(c *gcorecloud.ServiceClient) (r GetResult)

OwnQuota returns quota for current user

func (GetResult) Extract

func (r GetResult) Extract() (*Quota, error)

Extract is a function that accepts a result and extracts a quota resource.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type Quota

type Quota struct {
	ProjectCountLimit         int `json:"project_count_limit" validate:"gte=-1"`
	VMCountLimit              int `json:"vm_count_limit" validate:"gte=-1"`
	CPUCountLimit             int `json:"cpu_count_limit" validate:"gte=-1"`
	RAMLimit                  int `json:"ram_limit" validate:"gte=-1"`
	VolumeCountLimit          int `json:"volume_count_limit" validate:"gte=-1"`
	VolumeSizeLimit           int `json:"volume_size_limit" validate:"gte=-1"`
	VolumeSnapshotsCountLimit int `json:"volume_snapshots_count_limit" validate:"gte=-1"`
	VolumeSnapshotsSizeLimit  int `json:"volume_snapshots_size_limit" validate:"gte=-1"`
	ImageCountLimit           int `json:"image_count_limit" validate:"gte=-1"`
	ImageSizeLimit            int `json:"image_size_limit" validate:"gte=-1"`
	NetworkCountLimit         int `json:"network_count_limit" validate:"gte=-1"`
	SubnetCountLimit          int `json:"subnet_count_limit" validate:"gte=-1"`
	FloatingCountLimit        int `json:"floating_count_limit" validate:"gte=-1"`
	RouterCountLimit          int `json:"router_count_limit" validate:"gte=-1"`
	FirewallCountLimit        int `json:"firewall_count_limit" validate:"gte=-1"`
	LoadbalancerCountLimit    int `json:"loadbalancer_count_limit" validate:"gte=-1"`
	ExternalIPCountLimit      int `json:"external_ip_count_limit" validate:"gte=-1"`
	ClusterCountLimit         int `json:"cluster_count_limit" validate:"gte=-1"`
	ProjectCountUsage         int `json:"project_count_usage" validate:"gte=-1"`
	VMCountUsage              int `json:"vm_count_usage" validate:"gte=-1"`
	CPUCountUsage             int `json:"cpu_count_usage" validate:"gte=-1"`
	RAMUsage                  int `json:"ram_usage" validate:"gte=-1"`
	VolumeCountUsage          int `json:"volume_count_usage" validate:"gte=-1"`
	VolumeSizeUsage           int `json:"volume_size_usage" validate:"gte=-1"`
	VolumeSnapshotsCountUsage int `json:"volume_snapshots_count_usage" validate:"gte=-1"`
	VolumeSnapshotsSizeUsage  int `json:"volume_snapshots_size_usage" validate:"gte=-1"`
	ImageCountUsage           int `json:"image_count_usage" validate:"gte=-1"`
	ImageSizeUsage            int `json:"image_size_usage" validate:"gte=-1"`
	NetworkCountUsage         int `json:"network_count_usage" validate:"gte=-1"`
	SubnetCountUsage          int `json:"subnet_count_usage" validate:"gte=-1"`
	FloatingCountUsage        int `json:"floating_count_usage" validate:"gte=-1"`
	RouterCountUsage          int `json:"router_count_usage" validate:"gte=-1"`
	FirewallCountUsage        int `json:"firewall_count_usage" validate:"gte=-1"`
	LoadbalancerCountUsage    int `json:"loadbalancer_count_usage" validate:"gte=-1"`
	ExternalIPCountUsage      int `json:"external_ip_count_usage" validate:"gte=-1"`
	ClusterCountUsage         int `json:"cluster_count_usage" validate:"gte=-1"`
}

Quota represents a quota structure.

func NewQuota

func NewQuota() Quota

func (Quota) ToRequestMap

func (opts Quota) ToRequestMap() map[string]interface{}

func (Quota) Validate

func (opts Quota) Validate() error

Validate

type ReplaceOpts

type ReplaceOpts struct {
	Quota
}

ReplaceOpts represents options used to create or replace quotas.

func (ReplaceOpts) ToQuotaReplaceMap

func (opts ReplaceOpts) ToQuotaReplaceMap() (map[string]interface{}, error)

ToQuotaReplaceMap builds a request body from ReplaceOpts.

type ReplaceOptsBuilder

type ReplaceOptsBuilder interface {
	ToQuotaReplaceMap() (map[string]interface{}, error)
}

ReplaceOptsBuilder allows extensions to add additional parameters to the Replace request.

type UpdateOpts

type UpdateOpts struct {
	Quota
}

UpdateOpts represents options used to update a quota.

func (UpdateOpts) ToQuotaUpdateMap

func (opts UpdateOpts) ToQuotaUpdateMap() (map[string]interface{}, error)

ToQuotaUpdateMap builds a request body from UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToQuotaUpdateMap() (map[string]interface{}, error)
}

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 Replace

Replace accepts a ReplaceOpts struct and creates a new quota using the values provided.

func Update

Update accepts a UpdateOpts struct and updates an existing quota using the values provided.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Quota, error)

Extract is a function that accepts a result and extracts a quota resource.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL