forked from rancher/types
/
logging_types.go
133 lines (111 loc) · 4.62 KB
/
logging_types.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
package v3
import (
"github.com/rancher/norman/condition"
"github.com/rancher/norman/types"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type ClusterLogging struct {
types.Namespaced
metav1.TypeMeta `json:",inline"`
// Standard object’s metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the the cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
Spec ClusterLoggingSpec `json:"spec"`
// Most recent observed status of the cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
Status LoggingStatus `json:"status"`
}
type ProjectLogging struct {
types.Namespaced
metav1.TypeMeta `json:",inline"`
// Standard object’s metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the the cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
Spec ProjectLoggingSpec `json:"spec"`
// Most recent observed status of the cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
Status LoggingStatus `json:"status"`
}
type LoggingCommonSpec struct {
DisplayName string `json:"displayName,omitempty"`
OutputFlushInterval int `json:"outputFlushInterval"`
OutputTags map[string]string `json:"outputTags"`
ElasticsearchConfig *ElasticsearchConfig `json:"elasticsearchConfig,omitempty"`
SplunkConfig *SplunkConfig `json:"splunkConfig,omitempty"`
KafkaConfig *KafkaConfig `json:"kafkaConfig,omitempty"`
SyslogConfig *SyslogConfig `json:"syslogConfig,omitempty"`
}
type ClusterLoggingSpec struct {
LoggingCommonSpec
ClusterName string `json:"clusterName" norman:"type=reference[cluster]"`
EmbeddedConfig *EmbeddedConfig `json:"embeddedConfig,omitempty"`
}
type ProjectLoggingSpec struct {
LoggingCommonSpec
ProjectName string `json:"projectName" norman:"type=reference[project]"`
}
type LoggingStatus struct {
Conditions []LoggingCondition `json:"conditions,omitempty"`
}
var (
ClusterLoggingConditionInitialized condition.Cond = "Initialized"
ClusterLoggingConditionProvisioned condition.Cond = "Provisioned"
)
type LoggingCondition struct {
// Type of cluster condition.
Type condition.Cond `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status"`
// The last time this condition was updated.
LastUpdateTime string `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
LastTransitionTime string `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
Reason string `json:"reason,omitempty"`
// Human-readable message indicating details about last transition
Message string `json:"message,omitempty"`
}
type ElasticsearchConfig struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
IndexPrefix string `json:"indexPrefix,omitempty"`
DateFormat string `json:"dateFormat,omitempty"`
AuthUserName string `json:"authUsername,omitempty"` //secret
AuthPassword string `json:"authPassword,omitempty"` //secret
}
type SplunkConfig struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
Protocol string `json:"protocol,omitempty"`
Source string `json:"source,omitempty"`
Token string `json:"token,omitempty"` //secret
}
type EmbeddedConfig struct {
IndexPrefix string `json:"indexPrefix,omitempty"`
DateFormat string `json:"dateFormat,omitempty"`
}
type KafkaConfig struct {
Zookeeper *Zookeeper `json:"zookeeper,omitempty"`
Broker *BrokerList `json:"broker,omitempty"`
Topic string `json:"topic,omitempty"`
DataType string `json:"dataType,omitempty"`
MaxSendRetries int `json:"maxSendRetries,omitempty"`
}
type Zookeeper struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
}
type BrokerList struct {
BrokerList []string `json:"brokerList,omitempty"`
}
type SyslogConfig struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
Severity string `json:"severity,omitempty"`
Program string `json:"program,omitempty"`
}