models

package
v1.8.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExecutionTable is the table name for replication executions
	ExecutionTable = "replication_execution"
	// TaskTable is table name for replication tasks
	TaskTable = "replication_task"
)
View Source
const (
	ExecutionStatusFailed     string = "Failed"
	ExecutionStatusSucceed    string = "Succeed"
	ExecutionStatusStopped    string = "Stopped"
	ExecutionStatusInProgress string = "InProgress"

	ExecutionTriggerManual   string = "Manual"
	ExecutionTriggerEvent    string = "Event"
	ExecutionTriggerSchedule string = "Schedule"

	// The task has been persisted in db but not submitted to Jobservice
	TaskStatusInitialized string = "Initialized"
	TaskStatusPending     string = "Pending"
	TaskStatusInProgress  string = "InProgress"
	TaskStatusSucceed     string = "Succeed"
	TaskStatusFailed      string = "Failed"
	TaskStatusStopped     string = "Stopped"
)

execution/task status/trigger const

View Source
const (
	// RegistryTable is the table name for registry
	RegistryTable = "registry"
)

Variables

View Source
var ExecutionPropsName = ExecutionFieldsName{
	ID:         "ID",
	PolicyID:   "PolicyID",
	Status:     "Status",
	StatusText: "StatusText",
	Total:      "Total",
	Failed:     "Failed",
	Succeed:    "Succeed",
	InProgress: "InProgress",
	Stopped:    "Stopped",
	Trigger:    "Trigger",
	StartTime:  "StartTime",
	EndTime:    "EndTime",
}

ExecutionPropsName defines the names of fields of Execution

View Source
var TaskPropsName = TaskFieldsName{
	ID:           "ID",
	ExecutionID:  "ExecutionID",
	ResourceType: "ResourceType",
	SrcResource:  "SrcResource",
	DstResource:  "DstResource",
	JobID:        "JobID",
	Status:       "Status",
	StartTime:    "StartTime",
	EndTime:      "EndTime",
}

TaskPropsName defines the names of fields of Task

Functions

This section is empty.

Types

type Execution

type Execution struct {
	ID         int64             `orm:"pk;auto;column(id)" json:"id"`
	PolicyID   int64             `orm:"column(policy_id)" json:"policy_id"`
	Status     string            `orm:"column(status)" json:"status"`
	StatusText string            `orm:"column(status_text)" json:"status_text"`
	Total      int               `orm:"column(total)" json:"total"`
	Failed     int               `orm:"column(failed)" json:"failed"`
	Succeed    int               `orm:"column(succeed)" json:"succeed"`
	InProgress int               `orm:"column(in_progress)" json:"in_progress"`
	Stopped    int               `orm:"column(stopped)" json:"stopped"`
	Trigger    model.TriggerType `orm:"column(trigger)" json:"trigger"`
	StartTime  time.Time         `orm:"column(start_time)" json:"start_time"`
	EndTime    time.Time         `orm:"column(end_time)" json:"end_time"`
}

Execution holds information about once replication execution.

func (*Execution) TableName

func (r *Execution) TableName() string

TableName is required by by beego orm to map Execution to table replication_execution

type ExecutionFieldsName

type ExecutionFieldsName struct {
	ID         string
	PolicyID   string
	Status     string
	StatusText string
	Total      string
	Failed     string
	Succeed    string
	InProgress string
	Stopped    string
	Trigger    string
	StartTime  string
	EndTime    string
}

ExecutionFieldsName defines the props of Execution

type ExecutionQuery

type ExecutionQuery struct {
	PolicyID int64
	Statuses []string
	Trigger  string
	Pagination
}

ExecutionQuery holds the query conditions for replication executions

type Pagination

type Pagination struct {
	Page int64
	Size int64
}

Pagination ...

type Registry

type Registry struct {
	ID             int64     `orm:"pk;auto;column(id)" json:"id"`
	URL            string    `orm:"column(url)" json:"endpoint"`
	Name           string    `orm:"column(name)" json:"name"`
	CredentialType string    `orm:"column(credential_type);default(basic)" json:"credential_type"`
	AccessKey      string    `orm:"column(access_key)" json:"access_key"`
	AccessSecret   string    `orm:"column(access_secret)" json:"access_secret"`
	Type           string    `orm:"column(type)" json:"type"`
	Insecure       bool      `orm:"column(insecure)" json:"insecure"`
	Description    string    `orm:"column(description)" json:"description"`
	Health         string    `orm:"column(health)" json:"health"`
	CreationTime   time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime     time.Time `orm:"column(update_time);auto_now" json:"update_time"`
}

Registry is the model for a registry, which wraps the endpoint URL and credential of a remote registry.

func (*Registry) TableName

func (r *Registry) TableName() string

TableName is required by by beego orm to map Registry to table registry

func (*Registry) Valid

func (r *Registry) Valid(v *validation.Validation)

Valid ...

type RepPolicy

type RepPolicy struct {
	ID                int64     `orm:"pk;auto;column(id)" json:"id"`
	Name              string    `orm:"column(name)" json:"name"`
	Description       string    `orm:"column(description)" json:"description"`
	Creator           string    `orm:"column(creator)" json:"creator"`
	SrcRegistryID     int64     `orm:"column(src_registry_id)" json:"src_registry_id"`
	DestRegistryID    int64     `orm:"column(dest_registry_id)" json:"dest_registry_id"`
	DestNamespace     string    `orm:"column(dest_namespace)" json:"dest_namespace"`
	Override          bool      `orm:"column(override)" json:"override"`
	Enabled           bool      `orm:"column(enabled)" json:"enabled"`
	Trigger           string    `orm:"column(trigger)" json:"trigger"`
	Filters           string    `orm:"column(filters)" json:"filters"`
	ReplicateDeletion bool      `orm:"column(replicate_deletion)" json:"replicate_deletion"`
	CreationTime      time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime        time.Time `orm:"column(update_time);auto_now" json:"update_time"`
}

RepPolicy is the model for a ng replication policy.

func (*RepPolicy) TableName

func (r *RepPolicy) TableName() string

TableName set table name for ORM.

type ScheduleJob

type ScheduleJob struct {
	ID           int64     `orm:"pk;auto;column(id)" json:"id"`
	PolicyID     int64     `orm:"column(policy_id)" json:"policy_id"`
	JobID        string    `orm:"column(job_id)" json:"job_id"`
	Status       string    `orm:"column(status)" json:"status"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now" json:"update_time"`
}

ScheduleJob is the persistent model for the schedule job which is used as a scheduler

func (*ScheduleJob) TableName

func (s *ScheduleJob) TableName() string

TableName is required by by beego orm to map the object to the database table

type ScheduleJobQuery

type ScheduleJobQuery struct {
	PolicyID int64
}

ScheduleJobQuery is the query used to list schedule jobs

type Task

type Task struct {
	ID           int64      `orm:"pk;auto;column(id)" json:"id"`
	ExecutionID  int64      `orm:"column(execution_id)" json:"execution_id"`
	ResourceType string     `orm:"column(resource_type)" json:"resource_type"`
	SrcResource  string     `orm:"column(src_resource)" json:"src_resource"`
	DstResource  string     `orm:"column(dst_resource)" json:"dst_resource"`
	Operation    string     `orm:"column(operation)" json:"operation"`
	JobID        string     `orm:"column(job_id)" json:"job_id"`
	Status       string     `orm:"column(status)" json:"status"`
	StartTime    *time.Time `orm:"column(start_time)" json:"start_time"`
	EndTime      *time.Time `orm:"column(end_time)" json:"end_time,omitempty"`
}

Task represent the tasks in one execution.

func (*Task) TableName

func (r *Task) TableName() string

TableName is required by by beego orm to map Task to table replication_task

type TaskFieldsName

type TaskFieldsName struct {
	ID           string
	ExecutionID  string
	ResourceType string
	SrcResource  string
	DstResource  string
	JobID        string
	Status       string
	StartTime    string
	EndTime      string
}

TaskFieldsName defines the props of Task

type TaskQuery

type TaskQuery struct {
	ExecutionID  int64
	JobID        string
	Statuses     []string
	ResourceType string
	Pagination
}

TaskQuery holds the query conditions for replication task

type TaskStat

type TaskStat struct {
	Status string `orm:"column(status)"`
	C      int    `orm:"column(c)"`
}

TaskStat holds statistics of task by status

Jump to

Keyboard shortcuts

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