limits

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MPL-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Sentinel = -1

Variables

This section is empty.

Functions

func ExtractLimitResultsInto

func ExtractLimitResultsInto(r pagination.Page, v interface{}) error

func ToRequestMap

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

Types

type CreateOpts

type CreateOpts struct {
	Description     string `json:"description" required:"true" validate:"required"`
	RequestedQuotas Limit  `json:"requested_limits" required:"true" validate:"required"`
}

func NewCreateOpts

func NewCreateOpts(description string) CreateOpts

func (CreateOpts) ToLimitCreateMap

func (opts CreateOpts) ToLimitCreateMap() (map[string]interface{}, error)

ToLimitCreateMap builds a request body from ReplaceOpts.

func (CreateOpts) Validate

func (opts CreateOpts) Validate() error

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToLimitCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a LimitResponse.

func Create

Create accepts a CreateOptsBuilder struct and creates a new quota using the values provided.

func (CreateResult) Extract

func (r CreateResult) Extract() (*LimitResponse, error)

Extract is a function that accepts a result and extracts a limit response resource.

type DeleteResult

type DeleteResult struct {
	gcorecloud.ErrResult
}

DeleteResult represents the result of an delete operation. Call its ExtractErr to get operation error.

func Delete

func Delete(c *gcorecloud.ServiceClient, id int) (r DeleteResult)

Delete deleted limit request

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 LimitResponse.

func Get

func Get(c *gcorecloud.ServiceClient, id int) (r GetResult)

Get retrieves a specific quota based on its unique ID.

func (GetResult) Extract

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

Extract is a function that accepts a result and extracts a limit response resource.

type GlobalLimits

type GlobalLimits struct {
	KeypairCountLimit int `json:"keypair_count_limit" validate:"gte=-1"`
	ProjectCountLimit int `json:"project_count_limit" validate:"gte=-1"`
}

Limit represents a GlobalLimits structure.

func (*GlobalLimits) Update

func (g *GlobalLimits) Update(source interface{}) error

type Limit

type Limit struct {
	GlobalLimits   GlobalLimits     `json:"global_limits"`
	RegionalLimits []RegionalLimits `json:"regional_limits"`
}

func NewLimit

func NewLimit() Limit

func (Limit) ToRequestMap

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

type LimitResponse

type LimitResponse struct {
	ID              int                       `json:"id"`
	ClientID        int                       `json:"client_id"`
	RequestedLimits Limit                     `json:"requested_limits"`
	Status          types.LimitRequestStatus  `json:"status"`
	CreatedAt       gcorecloud.JSONRFC3339NoZ `json:"created_at"`
}

func ExtractLimitResults

func ExtractLimitResults(r pagination.Page) ([]LimitResponse, error)

ExtractLimitResult accepts a Page struct, specifically a LimitResultPage struct, and extracts the elements into a slice of LimitResponse structs. In other words, a generic collection is mapped into a relevant slice.

func ListAll

type LimitResultPage

type LimitResultPage struct {
	pagination.LinkedPageBase
}

LimitResultPage is the page returned by a pager when traversing over a collection of limit requests.

func (LimitResultPage) IsEmpty

func (r LimitResultPage) IsEmpty() (bool, error)

IsEmpty checks whether a LimitResultPage struct is empty.

func (LimitResultPage) NextPageURL

func (r LimitResultPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of limit requests has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type RegionalLimits

type RegionalLimits struct {
	RegionID                          int `json:"region_id" validate:"gte=0"`
	BaremetalBasicCountLimit          int `json:"baremetal_basic_count_limit" validate:"gte=-1"`
	BaremetalHFCountLimit             int `json:"baremetal_hf_count_limit" validate:"gte=-1"`
	BaremetalInfrastructureCountLimit int `json:"baremetal_infrastructure_count_limit" validate:"gte=-1"`
	BaremetalNetworkCountLimit        int `json:"baremetal_network_count_limit" validate:"gte=-1"`
	BaremetalStorageCountLimit        int `json:"baremetal_storage_count_limit" validate:"gte=-1"`
	ClusterCountLimit                 int `json:"cluster_count_limit" validate:"gte=-1"`
	CPUCountLimit                     int `json:"cpu_count_limit" validate:"gte=-1"`
	ExternalIPCountLimit              int `json:"external_ip_count_limit" validate:"gte=-1"`
	FirewallCountLimit                int `json:"firewall_count_limit" validate:"gte=-1"`
	FloatingCountLimit                int `json:"floating_count_limit" validate:"gte=-1"`
	GPUCountLimit                     int `json:"gpu_count_limit" validate:"gte=-1"`
	ImageCountLimit                   int `json:"image_count_limit" validate:"gte=-1"`
	ImageSizeLimit                    int `json:"image_size_limit" validate:"gte=-1"`
	LoadbalancerCountLimit            int `json:"loadbalancer_count_limit" validate:"gte=-1"`
	NetworkCountLimit                 int `json:"network_count_limit" validate:"gte=-1"`
	RAMLimit                          int `json:"ram_limit" validate:"gte=-1"`
	RouterCountLimit                  int `json:"router_count_limit" validate:"gte=-1"`
	SecretCountLimit                  int `json:"secret_count_limit" validate:"gte=-1"`
	ServergroupCountLimit             int `json:"servergroup_count_limit" validate:"gte=-1"`
	SharedVMCountLimit                int `json:"shared_vm_count_limit" validate:"gte=-1"`
	SnapshotScheduleCountLimit        int `json:"snapshot_schedule_count_limit" validate:"gte=-1"`
	SubnetCountLimit                  int `json:"subnet_count_limit" validate:"gte=-1"`
	VMCountLimit                      int `json:"vm_count_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"`
}

func (*RegionalLimits) Update

func (r *RegionalLimits) Update(source interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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