forked from goodrain/rainbond
/
api_interface.go
148 lines (134 loc) · 6.23 KB
/
api_interface.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// Copyright (C) 2014-2018 Goodrain Co., Ltd.
// RAINBOND, Application Management Platform
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. For any non-GPL usage of Rainbond,
// one or multiple Commercial Licenses authorized by Goodrain Co., Ltd.
// must be obtained first.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package apiFunc
import (
"net/http"
)
//TenantInterface interface
type TenantInterface interface {
TenantInterfaceWithV1
AllTenantResources(w http.ResponseWriter, r *http.Request)
TenantResources(w http.ResponseWriter, r *http.Request)
ServiceResources(w http.ResponseWriter, r *http.Request)
Tenant(w http.ResponseWriter, r *http.Request)
ServicesInfo(w http.ResponseWriter, r *http.Request)
TenantsWithResource(w http.ResponseWriter, r *http.Request)
TenantsQuery(w http.ResponseWriter, r *http.Request)
TenantsGetByName(w http.ResponseWriter, r *http.Request)
SumTenants(w http.ResponseWriter, r *http.Request)
SingleTenantResources(w http.ResponseWriter, r *http.Request)
GetSupportProtocols(w http.ResponseWriter, r *http.Request)
TransPlugins(w http.ResponseWriter, r *http.Request)
ServicesCount(w http.ResponseWriter, r *http.Request)
GetManyDeployVersion(w http.ResponseWriter, r *http.Request)
}
//ServiceInterface ServiceInterface
type ServiceInterface interface {
SetLanguage(w http.ResponseWriter, r *http.Request)
SingleServiceInfo(w http.ResponseWriter, r *http.Request)
CheckCode(w http.ResponseWriter, r *http.Request)
ShareCloud(w http.ResponseWriter, r *http.Request)
Event(w http.ResponseWriter, r *http.Request)
BuildList(w http.ResponseWriter, r *http.Request)
CreateService(w http.ResponseWriter, r *http.Request)
UpdateService(w http.ResponseWriter, r *http.Request)
Dependency(w http.ResponseWriter, r *http.Request)
Env(w http.ResponseWriter, r *http.Request)
Ports(w http.ResponseWriter, r *http.Request)
PutPorts(w http.ResponseWriter, r *http.Request)
PortOuterController(w http.ResponseWriter, r *http.Request)
PortInnerController(w http.ResponseWriter, r *http.Request)
ChangeLBPort(w http.ResponseWriter, r *http.Request)
RollBack(w http.ResponseWriter, r *http.Request)
AddVolume(w http.ResponseWriter, r *http.Request)
DeleteVolume(w http.ResponseWriter, r *http.Request)
Pods(w http.ResponseWriter, r *http.Request)
VolumeDependency(w http.ResponseWriter, r *http.Request)
Probe(w http.ResponseWriter, r *http.Request)
ServiceLabel(w http.ResponseWriter, r *http.Request)
NodeLabel(w http.ResponseWriter, r *http.Request)
Share(w http.ResponseWriter, r *http.Request)
ShareResult(w http.ResponseWriter, r *http.Request)
BuildVersionInfo(w http.ResponseWriter, r *http.Request)
GetDeployVersion(w http.ResponseWriter, r *http.Request)
}
//EntranceInterface EntranceInterface
type EntranceInterface interface {
DomainList(w http.ResponseWriter, r *http.Request)
Domain(w http.ResponseWriter, r *http.Request)
AllCerts(w http.ResponseWriter, r *http.Request)
Cert(w http.ResponseWriter, r *http.Request)
}
//TenantInterfaceWithV1 funcs for both v2 and v1
type TenantInterfaceWithV1 interface {
StartService(w http.ResponseWriter, r *http.Request)
StopService(w http.ResponseWriter, r *http.Request)
RestartService(w http.ResponseWriter, r *http.Request)
VerticalService(w http.ResponseWriter, r *http.Request)
HorizontalService(w http.ResponseWriter, r *http.Request)
BuildService(w http.ResponseWriter, r *http.Request)
DeployService(w http.ResponseWriter, r *http.Request)
UpgradeService(w http.ResponseWriter, r *http.Request)
StatusService(w http.ResponseWriter, r *http.Request)
StatusServiceList(w http.ResponseWriter, r *http.Request)
StatusContainerID(w http.ResponseWriter, r *http.Request)
}
//LogInterface log interface
type LogInterface interface {
Logs(w http.ResponseWriter, r *http.Request)
LogList(w http.ResponseWriter, r *http.Request)
LogFile(w http.ResponseWriter, r *http.Request)
LogSocket(w http.ResponseWriter, r *http.Request)
LogByAction(w http.ResponseWriter, r *http.Request)
TenantLogByAction(w http.ResponseWriter, r *http.Request)
}
//PluginInterface plugin interface
type PluginInterface interface {
PluginAction(w http.ResponseWriter, r *http.Request)
PluginDefaultENV(w http.ResponseWriter, r *http.Request)
PluginBuild(w http.ResponseWriter, r *http.Request)
GetAllPluginBuildVersons(w http.ResponseWriter, r *http.Request)
GetPluginBuildVersion(w http.ResponseWriter, r *http.Request)
DeletePluginBuildVersion(w http.ResponseWriter, r *http.Request)
//plugin
PluginSet(w http.ResponseWriter, r *http.Request)
DeletePluginRelation(w http.ResponseWriter, r *http.Request)
GePluginEnvWhichCanBeSet(w http.ResponseWriter, r *http.Request)
UpdateVersionEnv(w http.ResponseWriter, r *http.Request)
GetPluginDefaultEnvs(w http.ResponseWriter, r *http.Request)
SharePlugin(w http.ResponseWriter, r *http.Request)
SharePluginResult(w http.ResponseWriter, r *http.Request)
}
//RulesInterface RulesInterface
type RulesInterface interface {
SetDownStreamRule(w http.ResponseWriter, r *http.Request)
GetDownStreamRule(w http.ResponseWriter, r *http.Request)
DeleteDownStreamRule(w http.ResponseWriter, r *http.Request)
UpdateDownStreamRule(w http.ResponseWriter, r *http.Request)
}
//SourcesInterface SourcesInterface
type SourcesInterface interface {
SetDefineSource(w http.ResponseWriter, r *http.Request)
DeleteDefineSource(w http.ResponseWriter, r *http.Request)
GetDefineSource(w http.ResponseWriter, r *http.Request)
UpdateDefineSource(w http.ResponseWriter, r *http.Request)
}
type AppInterface interface {
ExportApp(w http.ResponseWriter, r *http.Request)
Download(w http.ResponseWriter, r *http.Request)
Upload(w http.ResponseWriter, r *http.Request)
ImportID(w http.ResponseWriter, r *http.Request)
ImportApp(w http.ResponseWriter, r *http.Request)
}