-
Notifications
You must be signed in to change notification settings - Fork 0
/
ingest_check.go
72 lines (59 loc) · 2.15 KB
/
ingest_check.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
68
69
70
71
72
package types
import (
"time"
)
const (
// IngestCheckDefaultTimeout default timeout for an ingest check.
IngestCheckDefaultTimeout = CoreInstanceNextPingTimeout
// IngestCheckMaxLogSize maximum size for the log attribute of an ingest check.
IngestCheckMaxLogSize = 10 << 20 // 10MiB
)
// IngestCheck type for core_instance ingestion checks.
type IngestCheck struct {
ID string `json:"id" yaml:"id"`
ConfigSectionID string `json:"-" yaml:"-"`
Config string `json:"config" yaml:"config"`
Status CheckStatus `json:"status" yaml:"status"`
CollectLogs bool `json:"collectLogs" yaml:"collectLogs"`
Logs []byte `json:"logs" yaml:"logs"`
Retries uint `json:"retries" yaml:"retries"`
CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" yaml:"updatedAt"`
}
// CreateIngestCheck request payload for creating a core_instance ingestion check.
type CreateIngestCheck struct {
Status CheckStatus `json:"status"`
Retries uint `json:"retries"`
ConfigSectionID string `json:"configSectionID"`
CollectLogs bool `json:"collectLogs"`
Logs []FluentBitLog `json:"logs"`
}
// IngestChecksParams request payload for querying the core_instance ingestion checks.
type IngestChecksParams struct {
Last *uint
Before *string
}
// IngestChecks paginated list.
type IngestChecks struct {
Items []IngestCheck `json:"items" yaml:"items"`
EndCursor *string `json:"endCursor" yaml:"endCursor"`
}
// UpdateIngestCheck request payload for updating a core_instance ingestion check.
type UpdateIngestCheck struct {
Status *CheckStatus `json:"status"`
Logs *[]byte `json:"logs"`
retries *uint
configSectionID *string
}
func (in *UpdateIngestCheck) SetRetries(retries uint) {
in.retries = &retries
}
func (in *UpdateIngestCheck) SetConfigSectionID(configSectionID string) {
in.configSectionID = &configSectionID
}
func (in UpdateIngestCheck) Retries() *uint {
return in.retries
}
func (in UpdateIngestCheck) ConfigSectionID() *string {
return in.configSectionID
}