model

package
v1.0.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteUserAccessRequest

type DeleteUserAccessRequest struct {
	// swagger:strfmt email
	UserName string `json:"username"`
}

DeleteUserAccessRequest is a request object for deleting access to resource for user

swagger:model DeleteResourceAccessRequest

type Namespace

type Namespace struct {
	Resource

	RAM            int `sql:"ram,notnull" json:"ram"`
	CPU            int `sql:"cpu,notnull" json:"cpu"`
	MaxExtServices int `sql:"max_ext_services,notnull" json:"max_external_services"`
	MaxIntServices int `sql:"max_int_services,notnull" json:"max_internal_services"`
	MaxTraffic     int `sql:"max_traffic,notnull" json:"max_traffic"`
	// contains filtered or unexported fields
}

Namespace describes namespace

swagger:model

func (*Namespace) AfterInsert

func (ns *Namespace) AfterInsert(db orm.DB) error

func (*Namespace) BeforeInsert

func (ns *Namespace) BeforeInsert(db orm.DB) error

func (*Namespace) BeforeUpdate

func (ns *Namespace) BeforeUpdate(db orm.DB) error

type NamespaceAdminCreateRequest

type NamespaceAdminCreateRequest struct {
	Label          string `json:"label" binding:"required"`
	CPU            int    `json:"cpu" binding:"required"`
	Memory         int    `json:"memory" binding:"required"`
	MaxExtServices int    `json:"max_ext_services" binding:"required"`
	MaxIntServices int    `json:"max_int_services" binding:"required"`
	MaxTraffic     int    `json:"max_traffic" binding:"required"`
}

NamespaceAdminCreateRequest contains parameters for creating namespace without billing

swagger:model

type NamespaceAdminResizeRequest

type NamespaceAdminResizeRequest struct {
	CPU            *int `json:"cpu"`
	Memory         *int `json:"memory"`
	MaxExtServices *int `json:"max_ext_services"`
	MaxIntServices *int `json:"max_int_services"`
	MaxTraffic     *int `json:"max_traffic"`
}

NamespaceAdminResizeRequest contains parameter for resizing namespace without billing

swagger:model

type NamespaceCreateRequest

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

	Label string `json:"label" binding:"required"`
}

NamespaceCreateRequest contains parameters for creating namespace

swagger:model

type NamespaceRenameRequest

type NamespaceRenameRequest = model.ResourceUpdateName

NamespaceRenameRequest contains parameters for renaming namespace

swagger:model

type NamespaceResizeRequest

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

NamespaceResizeRequest contains parameters for changing namespace quota

swagger:model

type NamespaceWithPermissions

type NamespaceWithPermissions struct {
	Namespace `pg:",override"`

	Permission Permission `pg:"fk:resource_id" sql:"-" json:",inline"`

	Permissions []Permission `pg:"polymorphic:resource_" sql:"-" json:"users"`
}

NamespaceWithPermissions is a response object for get requests

swagger:model NamespaceWithPermissions

func (*NamespaceWithPermissions) ToKube

type Permission

type Permission struct {

	// swagger:strfmt uuid
	ID string `sql:"perm_id,pk,type:uuid,default:uuid_generate_v4()" json:"perm_id,omitempty"`

	ResourceType ResourceType `sql:"resource_type,notnull,unique:unique_user_access" json:"kind,omitempty"` // WARN: custom type here, do not forget create it

	// swagger:strfmt uuid
	ResourceID string `sql:"resource_id,type:uuid,notnull,unique:unique_user_access" json:"resource_id,omitempty"`

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

	// swagger:strfmt uuid
	UserID string `sql:"user_id,type:uuid,notnull,unique:unique_user_access" json:"user_id,omitempty"`

	// swagger:strfmt email
	UserLogin string `sql:"-" json:"user_login,omitempty"`

	InitialAccessLevel model.AccessLevel `sql:"initial_access_level,type:ACCESS_LEVEL,notnull" json:"access,omitempty"` // WARN: custom type here, do not forget create it

	CurrentAccessLevel model.AccessLevel `sql:"current_access_level,type:ACCESS_LEVEL,notnull" json:"new_access_level,omitempty"` // WARN: custom type here, do not forget create it

	AccessLevelChangeTime *time.Time `sql:"access_level_change_time,default:now(),notnull" json:"access_level_change_time,omitempty"`
	// contains filtered or unexported fields
}

Permission represents information about user permission to resource

swagger:model

func (*Permission) BeforeInsert

func (p *Permission) BeforeInsert(db orm.DB) error

func (*Permission) BeforeUpdate

func (p *Permission) BeforeUpdate(db orm.DB) error

func (*Permission) Mask

func (p *Permission) Mask()

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"`

	// swagger:strfmt uuid
	OwnerUserID string `sql:"owner_user_id,type:uuid,notnull" json:"owner_user_id,omitempty"`

	// swagger:strfmt email
	OwnerUserLogin string `sql:"-" json:"owner_user_login,omitempty"`

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

Resource represents common resource information.

swagger:ignore

func (*Resource) AfterUpdate

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

func (*Resource) BeforeDelete

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

func (*Resource) Mask

func (r *Resource) Mask()

type ResourceType

type ResourceType string
const (
	ResourceNamespace ResourceType = "Namespace"
	ResourceVolume    ResourceType = "Volume"
)

type SetUserAccessRequest

type SetUserAccessRequest = model.ResourceUpdateUserAccess

SetUserAccessRequest is a request object for setting access to resource for user

swagger:model SetResourceAccessRequest

type SetUserAccessesRequest

type SetUserAccessesRequest struct {
	Access model.AccessLevel `json:"access"`
}

SetUserAccessRequest is a request object for setting user accesses

swagger:model SetResourcesAccessesRequest

type Storage

type Storage struct {

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

	Name string `sql:"name,notnull,unique" json:"name"`

	Size int `sql:"size,notnull" json:"size"`

	Used int `sql:"used,notnull" json:"used"`

	Replicas int `sql:"replicas,notnull" json:"replicas"`

	IPs []string `sql:"ips,notnull,type:inet[],array" json:"ips"`

	Volumes []*Volume `pg:"fk:storage_id" sql:"-" json:"volumes"`
	// contains filtered or unexported fields
}

Storage describes volumes storage

swagger:ignore

func (*Storage) BeforeDelete

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

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"`
	Replicas *int     `json:"replicas,omitempty"`
	IPs      []string `json:"ips,omitempty"`
}

UpdateStorageRequest represents request object for updating storage

swagger:ignore

type Volume

type Volume struct {
	Resource

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

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

	GlusterName string `sql:"gluster_name,notnull" json:"gluster_name,omitempty"`

	// swagger:strfmt uuid
	StorageID string `sql:"storage_id,type:uuid,notnull" json:"storage_id,omitempty"`

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

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

Volume describes volume

swagger:ignore

func (*Volume) AfterInsert

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

func (*Volume) AfterSelect

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

func (*Volume) AfterUpdate

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

func (*Volume) BeforeInsert

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

func (*Volume) Mask

func (v *Volume) Mask()

type VolumeCreateRequest

type VolumeCreateRequest = model.CreateVolume

VolumeCreateRequest is a request object for creating volume

swagger:ignore

type VolumeRenameRequest

type VolumeRenameRequest = model.ResourceUpdateName

VolumeRenameRequest is a request object for renaming volume

swagger:ignore

type VolumeResizeRequest

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

VolumeResizeRequest contains parameters for changing volume size

swagger:ignore

type VolumeWithPermissions

type VolumeWithPermissions struct {
	Volume `pg:",override"`

	Permission Permission `pg:"fk:resource_id" sql:"-" json:",inline"`

	Permissions []Permission `pg:"polymorphic:resource_" sql:"-" json:"users"`
}

VolumeWithPermissions is a response object for get requests

swagger:ignore

func (*VolumeWithPermissions) Mask

func (vp *VolumeWithPermissions) Mask()

func (*VolumeWithPermissions) ToKube

func (vp *VolumeWithPermissions) ToKube() model.Volume

Jump to

Keyboard shortcuts

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