/
connector.go
100 lines (97 loc) · 2.47 KB
/
connector.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
package logs
import (
"math"
"github.com/kubemq-hub/builder/connector/common"
)
func Connector() *common.Connector {
return common.NewConnector().
SetKind("aws.cloudwatch.logs").
SetDescription("AWS Cloudwatch Logs Target").
SetName("Cloudwatch Logs").
SetProvider("AWS").
SetCategory("Observability").
SetTags("logs", "cloud").
AddProperty(
common.NewProperty().
SetKind("string").
SetName("aws_key").
SetDescription("Set Cloudwatch-Logs aws key").
SetMust(true).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("aws_secret_key").
SetDescription("Set Cloudwatch-Logs aws secret key").
SetMust(true).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("region").
SetDescription("Set Cloudwatch-Logs aws region").
SetMust(true).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("token").
SetDescription("Set Cloudwatch-Logs aws token").
SetMust(false).
SetDefault(""),
).
AddMetadata(
common.NewMetadata().
SetName("method").
SetKind("string").
SetDescription("Set Cloudwatch-Logs execution method").
SetOptions([]string{"create_log_event_stream", "describe_log_event_stream", "delete_log_event_stream", "put_log_event", "get_log_event", "create_log_group", "delete_log_group", "describe_log_group"}).
SetDefault("put_log_event").
SetMust(true),
).
AddMetadata(
common.NewMetadata().
SetName("sequence_token").
SetKind("string").
SetDescription("Set Cloudwatch-Logs sequence token").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("log_group_name").
SetKind("string").
SetDescription("Set Cloudwatch-Logs log group name").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("log_stream_name").
SetKind("string").
SetDescription("Set Cloudwatch-Logs sequence log stream name").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetName("log_group_prefix").
SetKind("string").
SetDescription("Set Cloudwatch-Logs log group prefix").
SetDefault("").
SetMust(false),
).
AddMetadata(
common.NewMetadata().
SetKind("int").
SetName("limit").
SetDescription("Set Cloudwatch-Logs limit").
SetMust(false).
SetDefault("100").
SetMin(0).
SetMax(math.MaxInt32),
)
}