Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Ctl = NewController()
Ctl is a global replication controller instance
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { // PolicyCount returns the total count of policies according to the query PolicyCount(ctx context.Context, query *q.Query) (count int64, err error) // ListPolicies lists the policies according to the query ListPolicies(ctx context.Context, query *q.Query) (policies []*replicationmodel.Policy, err error) // GetPolicy gets the specific policy GetPolicy(ctx context.Context, id int64) (policy *replicationmodel.Policy, err error) // CreatePolicy creates a policy CreatePolicy(ctx context.Context, policy *replicationmodel.Policy) (id int64, err error) // UpdatePolicy updates the specific policy UpdatePolicy(ctx context.Context, policy *replicationmodel.Policy, props ...string) (err error) // DeletePolicy deletes the specific policy DeletePolicy(ctx context.Context, id int64) (err error) // Start the replication according to the policy Start(ctx context.Context, policy *replicationmodel.Policy, resource *model.Resource, trigger string) (executionID int64, err error) // Stop the replication specified by the execution ID Stop(ctx context.Context, executionID int64) (err error) // ExecutionCount returns the total count of executions according to the query ExecutionCount(ctx context.Context, query *q.Query) (count int64, err error) // ListExecutions lists the executions according to the query ListExecutions(ctx context.Context, query *q.Query) (executions []*Execution, err error) // GetExecution gets the specific execution GetExecution(ctx context.Context, executionID int64) (execution *Execution, err error) // TaskCount returns the total count of tasks according to the query TaskCount(ctx context.Context, query *q.Query) (count int64, err error) // ListTasks lists the tasks according to the query ListTasks(ctx context.Context, query *q.Query) (tasks []*Task, err error) // GetTask gets the specific task GetTask(ctx context.Context, taskID int64) (task *Task, err error) // GetTaskLog gets the log of the specific task GetTaskLog(ctx context.Context, taskID int64) (log []byte, err error) }
Controller defines the operations related with replication
func NewController ¶
func NewController() Controller
NewController creates a new instance of the replication controller
type Execution ¶
type Execution struct { ID int64 PolicyID int64 Status string StatusMessage string Metrics *dao.Metrics Trigger string Operator string StartTime time.Time EndTime time.Time }
Execution model for replication
type Task ¶
type Task struct { ID int64 ExecutionID int64 Status string StatusMessage string RunCount int32 ResourceType string SourceResource string DestinationResource string References string Operation string JobID string CreationTime time.Time StartTime time.Time UpdateTime time.Time EndTime time.Time }
Task model for replication
Click to show internal directories.
Click to hide internal directories.