-
Notifications
You must be signed in to change notification settings - Fork 43
/
node.go
81 lines (66 loc) · 2.61 KB
/
node.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
package models
import (
specV1 "github.com/baetyl/baetyl-go/v2/spec/v1"
)
// NodeViewList node view list
type NodeViewList struct {
Total int `json:"total"`
*ListOptions `json:",inline"`
Items []specV1.NodeView `json:"items"`
}
// NodeList node list
type NodeList struct {
Total int `json:"total"`
*ListOptions `json:",inline"`
Items []specV1.Node `json:"items"`
}
type NodeNames struct {
Names []string `json:"names,"validate:"maxLength=20"`
}
type NodeProperties struct {
State NodePropertiesState `yaml:"state,omitempty" json:"state,omitempty"`
Meta NodePropertiesMetadata `yaml:"metadata,omitempty" json:"metadata,omitempty"`
}
type NodePropertiesState struct {
Report map[string]interface{} `yaml:"report,omitempty" json:"report,omitempty"`
Desire map[string]interface{} `yaml:"desire,omitempty" json:"desire,omitempty"`
}
type NodeProperty struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Type string `yaml:"type,omitempty" json:"type,omitempty"`
Current PropertyValue `yaml:"current,omitempty" json:"current,omitempty"`
Expect PropertyValue `yaml:"expect,omitempty" json:"expect,omitempty"`
}
type PropertyValue struct {
Value string `yaml:"value,omitempty" json:"value,omitempty"`
UpdateTime string `yaml:"updateTime,omitempty" json:"updateTime,omitempty"`
}
type NodeMode struct {
Mode string `yaml:"mode,omitempty" json:"mode,omitempty"`
}
type NodePropertiesMetadata struct {
ReportMeta map[string]interface{} `yaml:"report,omitempty" json:"report,omitempty"`
DesireMeta map[string]interface{} `yaml:"desire,omitempty" json:"desire,omitempty"`
}
type NodeCoreConfigs struct {
Version string `yaml:"version,omitempty" json:"version,omitempty"`
// unit: seconds
Frequency int `yaml:"frequency,omitempty" json:"frequency,omitempty"`
APIPort int `yaml:"apiport,omitempty" json:"apiport,omitempty"`
}
type NodeCoreVersions struct {
Versions []string `yaml:"versions,omitempty" json:"versions,omitempty"`
}
type NodeSysAppView struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
}
type NodeOptionalSysApps struct {
Apps []NodeSysAppView `yaml:"apps,omitempty" json:"apps,omitempty"`
}
type NodeSysAppInfo struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Image string `yaml:"image,omitempty" json:"image,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Programs map[string]string `yaml:"programs,omitempty" json:"programs,omitempty"`
}