Huawei/containerops

Add database support in pilotage

Closed this issue · 5 comments

Add database support in pilotage

pong !

Here is the data model draft of pilotage. Please take of look @genedna

type FlowV1 struct {
	ID         string
	Namespace  string
	Repository string
	Tag        string
	Version    int64
	Number     int64 # If flow run once, the number will be +1. So FlowV1 is master, other is data slave.
	Title      string
	Timeout    int64
	Content    string
	CreateAt   time.Time
	UpdateAt   time.Time
}

type FlowRecordV1 struct { # FlowDataV1 will be better.
	ID        string
	FlowID    string # int64 ?
	Number    int64
	Result    string # Bool ?
	StartTime time.Time # start and end?
	EndTime   time.Time
	CreateAt   time.Time
	UpdateAt   time.Time
}

type StageV1 struct {
	ID         string
	FlowID     string # int64?
	T          string # What's mean T ?
	Name       string
	Title      string
	Sequencing string
	CreateAt time.Time
	UpdateAt time.Time
}

type StageRecord struct { # StageDataV1
	ID      string
	StageID string # should be link to FlowDataV1 ?
	Number    int64
	Result    string # bool ?
	Status  string # What's mean ?
	CreateAt time.Time
	UpdateAt time.Time
}

type ActionV1 struct {
	ID       string
	StageID  string # int64?
	Name     string
	Title    string
	Status   string
	CreateAt time.Time
	UpdateAt time.Time
}

type ActionRecordV1 struct { # ActionDataV1
	ID        string
	ActionID  string # int64
	Number    int64
	Result    string
	StartTime time.Time
	EndTime   time.Time
}

type JobV1 struct {
	ID           string
	Endpoint     string
	Timeout      string
	Status       string
	Environments string
	CreateAt     time.Time
	UpdateAt     time.Time
}

type JobRecordV1 struct {
	ID            string
	JobID         string
	Number        int64
	Result        string
	Outputs       string
	Subscriptions string
	StartTime     time.Time
	EndTime       time.Time
}

type LogV1 struct {
	ID    string
	Level string
	//Phase must be one of 'flow','stage','action' or 'job'
	Phase   string
	PhaseID string
	Content  string
}

@wangkirin I made some comments in the codes.

@genedna I have already submit the PR and you can review in #559