quotas

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

quotas models represent and manipulate quotas within a Galaxy instance Relevant api endpoints are: `/api/quotas`

Index

Constants

View Source
const (
	UnregisteredUsers defaultQuotaAssociation = "unregistered"
	RegisteredUsers   defaultQuotaAssociation = "registered"
	NotDefault        defaultQuotaAssociation = "no"
	IncreaseBy        quotaOperation          = "+"
	DecreaseBy        quotaOperation          = "-"
	SetTo             quotaOperation          = "="
	Unlimited                                 = "unlimited"
)
View Source
const BasePath = "/api/quotas"

Variables

This section is empty.

Functions

This section is empty.

Types

type Quota

type Quota struct {
	Id                     blend4go.GalaxyID       `json:"id,omitempty"`
	Name                   string                  `json:"name,omitempty"`
	Bytes                  uint64                  `json:"bytes,omitempty"`
	Operation              quotaOperation          `json:"operation,omitempty"`
	Default                defaultQuotaAssociation `json:"-"`
	Description            string                  `json:"description,omitempty"`
	DisplayAmount          string                  `json:"display_amount,omitempty"`
	Users                  []*users.User           `json:"-"`
	Groups                 []*groups.Group         `json:"-"`
	UserQuotaAssociations  []userQuotaAssociation  `json:"users,omitempty"`
	GroupQuotaAssociations []groupQuotaAssociation `json:"groups,omitempty"`
	Deleted                bool                    `json:"-"`
	RawDefaults            []map[string]string     `json:"default,omitempty"`
	// contains filtered or unexported fields
}

func Get

func Get(ctx context.Context, g *blend4go.GalaxyInstance, id blend4go.GalaxyID, deleted bool) (*Quota, error)

Get quota

func GetName

func GetName(ctx context.Context, g *blend4go.GalaxyInstance, name string) (*Quota, error)

GetName get quota by name

func List

func List(ctx context.Context, g *blend4go.GalaxyInstance, deleted bool) ([]*Quota, error)

List quotas deleted - If true, show deleted quotas

func NewQuota

func NewQuota(ctx context.Context, g *blend4go.GalaxyInstance, name, amount, description string, operation quotaOperation, users, groups []blend4go.GalaxyID, default_for defaultQuotaAssociation) (*Quota, error)

NewQuota creates a new quota for groups or users operation - may be forced to SetTo depending on other parameters

func (*Quota) Delete

func (q *Quota) Delete(ctx context.Context, purge bool) error

Delete quota

func (*Quota) GetBasePath

func (q *Quota) GetBasePath() string

func (*Quota) GetID

func (q *Quota) GetID() blend4go.GalaxyID

func (*Quota) SetGalaxyInstance

func (q *Quota) SetGalaxyInstance(instance *blend4go.GalaxyInstance)

func (*Quota) SetID

func (q *Quota) SetID(id blend4go.GalaxyID)

func (*Quota) Undelete

func (q *Quota) Undelete(ctx context.Context) error

Undelete quota

func (*Quota) Update

func (q *Quota) Update(ctx context.Context, amount string) error

Update changes, sending to server amount - optional amount same as NewQuota, Quota.Bytes used if left empty

Jump to

Keyboard shortcuts

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