-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline_status.go
67 lines (57 loc) · 2.39 KB
/
pipeline_status.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package types
import "time"
type PipelineEventSource string
const (
PipelineEventSourceDeployment PipelineEventSource = "k8s:deployment"
PipelineEventSourcePod PipelineEventSource = "k8s:pod"
)
// PipelineStatus model.
type PipelineStatus struct {
ID string `json:"id" yaml:"id"`
Config PipelineConfig `json:"config" yaml:"config"`
Status PipelineStatusKind `json:"status" yaml:"status"`
Events []PipelineEvent `json:"events" yaml:"events"`
CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
}
// PipelineStatusKind enum.
type PipelineStatusKind string
const (
// PipelineStatusNew is the default status right after a pipeline is created.
PipelineStatusNew PipelineStatusKind = "NEW"
// PipelineStatusFailed is the status when a pipeline fails.
PipelineStatusFailed PipelineStatusKind = "FAILED"
// PipelineStatusStarting is the status of a starting pipeline.
PipelineStatusStarting PipelineStatusKind = "STARTING"
// PipelineStatusStarted is the status of a started pipeline.
PipelineStatusStarted PipelineStatusKind = "STARTED"
// PipelineStatusScaling is the status of a pipeline while scaling up/down.
PipelineStatusScaling PipelineStatusKind = "SCALING"
// PipelineStatusChecksOK is the status marked when all the checks associated
// with a pipeline are OK. Must be a temporary status before deployment.
PipelineStatusChecksOK PipelineStatusKind = "CHECKS_OK"
// PipelineStatusChecksFailed PipelineStatusCheckFailed is the status marked when any of the checks associated
// with a pipeline FAIL. Must be a temporary status before deployment.
PipelineStatusChecksFailed PipelineStatusKind = "CHECKS_FAILED"
)
// PipelineEvent model.
type PipelineEvent struct {
Source PipelineEventSource `json:"source" yaml:"source"`
Reason string `json:"reason" yaml:"reason"`
Message string `json:"message" yaml:"message"`
LoggedAt time.Time `json:"loggedAt" yaml:"loggedAt"`
}
type CreatePipelineStatus struct {
Status PipelineStatusKind `json:"status"`
}
// PipelineStatusHistoryParams request payload for querying the pipeline status history.
type PipelineStatusHistoryParams struct {
Last *uint
Before *string
Status *PipelineStatusKind
ConfigFormat *ConfigFormat
}
// PipelineStatusHistory paginated list.
type PipelineStatusHistory struct {
Items []PipelineStatus
EndCursor *string
}