model

package
v1.0.5 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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddMemberToProjectRequest added in v1.0.2

type AddMemberToProjectRequest struct {
	//swagger:strfmt email
	Username    string            `json:"username" binding:"required,email"`
	AccessLevel model.AccessLevel `json:"access" binding:"required"`
}

AddMemberToProjectRequest contains parameters for adding user to project

swagger:model

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

	// swagger:strfmt uuid
	TariffID       *string `sql:"tariff_id,type:uuid" json:"tariff_id,omitempty"`
	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"`
	KubeName       string  `sql:"kube_name,unique:kube_name,notnull" json:"kube_name"`
	// swagger:strfmt uuid
	ProjectID *string `sql:"project_id,type:uuid" json:"project_id,omitempty"`
	// 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

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

	GroupID *string `sql:"group_id,type:uuid" json:"group_id,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 Project added in v1.0.2

type Project struct {
	Resource

	Namespaces []Namespace `sql:"-" pg:"fk:project_id" json:"namespaces,omitempty"`
	// contains filtered or unexported fields
}

func (*Project) BeforeInsert added in v1.0.2

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

type ProjectAddGroupRequest added in v1.0.2

type ProjectAddGroupRequest struct {
	GroupID string `json:"group" binding:"required"`
}

ProjectAddGroupRequest contains parameters for adding permissions for group

swagger:model

type ProjectCreateRequest added in v1.0.2

type ProjectCreateRequest struct {
	Label string `json:"label" binding:"required"`
}

ProjectCreateRequest contains parameters for creating project

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
	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 SetGroupMemberAccessRequest added in v1.0.2

type SetGroupMemberAccessRequest struct {
	//swagger:strfmt email
	Username    string            `json:"username" binding:"required,email"`
	AccessLevel model.AccessLevel `json:"access" binding:"required"`
}

SetGroupMemberAccessRequest contains parameters for setting access to member of group

swagger:model

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

Jump to

Keyboard shortcuts

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