-
Notifications
You must be signed in to change notification settings - Fork 0
/
fleet.go
99 lines (81 loc) · 2.62 KB
/
fleet.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package types
import (
"time"
)
type Fleet struct {
ID string `json:"id" yaml:"id"`
ProjectID string `json:"projectID" yaml:"projectID"`
Name string `json:"name" yaml:"name"`
MinFluentBitVersion string `json:"minFluentBitVersion" yaml:"minFluentBitVersion"`
RawConfig string `json:"rawConfig" yaml:"rawConfig"`
ConfigFormat ConfigFormat `json:"configFormat" yaml:"configFormat"`
Tags []string `json:"tags" yaml:"tags"`
AgentsCount FleetAgentsCount `json:"agentsCount" yaml:"agentsCount"`
CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" yaml:"updatedAt"`
}
type FleetAgentsCount struct {
Active uint `json:"active" yaml:"active"`
Inactive uint `json:"inactive" yaml:"inactive"`
WithErrors uint `json:"errors" yaml:"withErrors"`
}
type CreateFleet struct {
ProjectID string `json:"-"`
Name string `json:"name"`
MinFluentBitVersion string `json:"minFluentBitVersion"`
RawConfig string `json:"rawConfig"`
ConfigFormat ConfigFormat `json:"configFormat"`
Tags []string `json:"tags"`
Files []CreateFleetFile
SkipConfigValidation bool `json:"skipConfigValidation"`
}
type FleetsParams struct {
ProjectID string
Name *string
TagsQuery *string
Last *uint
Before *string
ConfigFormat *ConfigFormat
tags *[]string
}
// FleetParams request payload for querying a single fleet.
type FleetParams struct {
FleetID string
ConfigFormat *ConfigFormat
}
func (p FleetsParams) Tags() ([]string, bool) {
if p.tags == nil {
return nil, false
}
return *p.tags, true
}
func (p *FleetsParams) SetTags(tt []string) {
p.tags = &tt
}
type Fleets struct {
Items []Fleet `json:"items" yaml:"items"`
EndCursor *string `json:"endCursor" yaml:"endCursor"`
}
type FleetsStatusParams struct {
ProjectID string
}
type FleetStatusParams struct {
FleetID string
}
type FleetsStatus struct {
Managed int `json:"managed"`
Healthy int `json:"healthy"`
InProgress int `json:"inProgress"`
Unhealthy int `json:"unhealthy"`
}
type UpdateFleet struct {
ID string `json:"-"`
Name *string `json:"name"`
RawConfig *string `json:"rawConfig"`
ConfigFormat *ConfigFormat `json:"configFormat"`
Tags *[]string `json:"tags"`
SkipConfigValidation bool `json:"skipConfigValidation"`
}
type FleetConfigParams struct {
ConfigFormat *ConfigFormat
}