quotas

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Overview

Package quotas contains functionality for working with Magnum Quota API.

Example to Create a Quota

createOpts := quotas.CreateOpts{
	ProjectID: "aa5436ab58144c768ca4e9d2e9f5c3b2",
	Resource:  "Cluster",
	HardLimit: 10,
}

quota, err := quotas.Create(serviceClient, createOpts).Extract()
if err != nil {
	panic(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	ProjectID string `json:"project_id"`
	Resource  string `json:"resource"`
	HardLimit int    `json:"hard_limit"`
}

CreateOpts params

func (CreateOpts) ToQuotaCreateMap

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

ToQuotaCreateMap constructs a request body from CreateOpts.

type CreateOptsBuilder

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

CreateOptsBuilder Builder.

type CreateResult

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

CreateResult is the response of a Create operations.

func Create

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create requests the creation of a new quota.

func (CreateResult) Extract

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

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

type Quotas

type Quotas struct {
	Resource  string    `json:"resource"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	HardLimit int       `json:"hard_limit"`
	ProjectID string    `json:"project_id"`
	ID        string    `json:"-"`
}

func (*Quotas) UnmarshalJSON

func (r *Quotas) UnmarshalJSON(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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