-
Notifications
You must be signed in to change notification settings - Fork 7
/
data-source.go
60 lines (58 loc) · 1.35 KB
/
data-source.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
package resources
import (
"github.com/apibrew/apibrew/pkg/model"
"github.com/apibrew/apibrew/pkg/resources/special"
"github.com/apibrew/apibrew/pkg/service/annotations"
)
var DataSourceResource = &model.Resource{
Name: "DataSource",
Namespace: "system",
SourceConfig: &model.ResourceSourceConfig{
DataSource: "system",
Entity: "data_source",
},
Types: []*model.ResourceSubType{
special.AuditDataSubType,
},
Properties: []*model.ResourceProperty{
special.IdProperty,
special.VersionProperty,
special.AuditProperty,
{
Name: "name",
Length: 64,
Unique: true,
Type: model.ResourceProperty_STRING,
Required: true,
Annotations: map[string]string{
annotations.IsHclLabel: annotations.Enabled,
},
},
{
Name: "description",
Length: 64,
Type: model.ResourceProperty_STRING,
Required: false,
Annotations: map[string]string{
annotations.AllowEmptyPrimitive: annotations.Enabled,
},
},
{
Name: "backend",
Type: model.ResourceProperty_STRING,
Required: true,
},
{
Name: "options",
Required: true,
Type: model.ResourceProperty_MAP,
Item: &model.ResourceProperty{
Type: model.ResourceProperty_STRING,
},
},
},
Annotations: map[string]string{
annotations.EnableAudit: "true",
annotations.OpenApiGroup: OpenApiInternal,
},
}