model

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminVolumeResizeRequest

type AdminVolumeResizeRequest struct {
	Capacity int `json:"capacity" binding:"gt=0"`
}

AdminVolumeResizeRequest contains parameters for changing volume size as admin

swagger:model

type DirectVolumeCreateRequest

type DirectVolumeCreateRequest struct {
	Label    string `json:"label" binding:"required"`
	Capacity int    `json:"capacity" binding:"gt=0"`
	Storage  string `json:"storage" binding:"required"`
}

DirectVolumeCreateRequest is a request object for creating volume as admin (without billing)

swagger:model

type Resource

type Resource struct {
	// swagger:strfmt uuid
	ID string `sql:"id,pk,type:uuid,default:uuid_generate_v4()" json:"id,omitempty"`

	CreateTime *time.Time `sql:"create_time,default:now(),notnull" json:"create_time,omitempty"`

	Deleted bool `sql:"deleted,notnull" json:"deleted,omitempty"`

	DeleteTime *time.Time `sql:"delete_time" json:"delete_time,omitempty"`

	// swagger:strfmt uuid
	TariffID *string `sql:"tariff_id,type:uuid" json:"tariff_id,omitempty"`

	Label string `sql:"label,notnull" json:"label"`

	OwnerUserID string `sql:"owner_user_id,notnull,type:uuid" json:"owner_user_id,omitempty"`
}

Resource represents common resource information.

swagger:ignore

func (*Resource) BeforeDelete

func (r *Resource) BeforeDelete(db orm.DB) error

func (*Resource) Mask

func (r *Resource) Mask()

type Storage

type Storage struct {
	Name string `sql:"name,pk,notnull" json:"name" binding:"required"`

	Size int `sql:"size,notnull" json:"size" binding:"gt=0"`

	Used int `sql:"used,notnull" json:"used" binding:"gte=0,ltecsfield=Size"`

	Volumes []*Volume `pg:"fk:storage_id" sql:"-" json:"volumes"`

	Deleted bool `sql:"deleted,notnull" json:"deleted,omitempty"`

	DeleteTime *time.Time `sql:"delete_time" json:"delete_time,omitempty"`
	// contains filtered or unexported fields
}

Storage describes volumes storage

swagger:model

func (*Storage) BeforeInsert

func (s *Storage) BeforeInsert(db orm.DB) error

func (*Storage) BeforeUpdate

func (s *Storage) BeforeUpdate(db orm.DB) error

type UpdateStorageRequest

type UpdateStorageRequest struct {
	Name *string `json:"name,omitempty"`
	Size *int    `json:"size,omitempty" binding:"omitempty,gt=0,gtecsfield=Used"`
	Used *int    `json:"used,omitempty"`
}

UpdateStorageRequest represents request object for updating storage

swagger:model

type Volume

type Volume struct {
	Resource

	Capacity int `sql:"capacity,notnull" json:"capacity"`

	// swagger:strfmt uuid
	NamespaceID string `sql:"ns_id,type:text" json:"namespace_id,omitempty"`

	StorageName string `sql:"storage_name,notnull" json:"storage_name,omitempty"`

	AccessMode model.PersistentVolumeAccessMode `sql:"access_mode,notnull" json:"access_mode,omitempty"`
	// contains filtered or unexported fields
}

Volume describes volume

swagger:model

func (*Volume) BeforeInsert

func (v *Volume) BeforeInsert(db orm.DB) error

func (*Volume) BeforeUpdate

func (v *Volume) BeforeUpdate(db orm.DB) error

func (*Volume) Mask

func (v *Volume) Mask()

func (*Volume) ToKube

func (v *Volume) ToKube() model.Volume

type VolumeCreateRequest

type VolumeCreateRequest = model.CreateVolume

VolumeCreateRequest is a request object for creating volume

swagger:model

type VolumeRenameRequest

type VolumeRenameRequest = model.ResourceUpdateName

VolumeRenameRequest is a request object for renaming volume

swagger:model

type VolumeResizeRequest

type VolumeResizeRequest struct {
	// swagger:strfmt uuid
	TariffID string `json:"tariff_id" binding:"required,uuid"`
}

VolumeResizeRequest contains parameters for changing volume size

swagger:model

Jump to

Keyboard shortcuts

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