@daocloud-proto/skoala 0.14.0-4 → 0.14.0-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,6 +23,17 @@ export enum ControlBehavior {
|
|
|
23
23
|
WAITING_IN_QUEUE = "WAITING_IN_QUEUE",
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
export enum MachineType {
|
|
27
|
+
EMBEDDED = "EMBEDDED",
|
|
28
|
+
ALONE = "ALONE",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export enum ListClusterFlowClientStatus {
|
|
32
|
+
OFF = "OFF",
|
|
33
|
+
PENDING = "PENDING",
|
|
34
|
+
CONNECTED = "CONNECTED",
|
|
35
|
+
}
|
|
36
|
+
|
|
26
37
|
export enum DegradeRuleGrade {
|
|
27
38
|
SLOW_REQUEST_RATIO = "SLOW_REQUEST_RATIO",
|
|
28
39
|
ERROR_RATIO = "ERROR_RATIO",
|
|
@@ -103,6 +114,73 @@ export type ListResourceRes = {
|
|
|
103
114
|
pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
|
|
104
115
|
}
|
|
105
116
|
|
|
117
|
+
export type ListClusterFlowServer = {
|
|
118
|
+
serverId?: string
|
|
119
|
+
port?: number
|
|
120
|
+
machineType?: MachineType
|
|
121
|
+
clientCount?: number
|
|
122
|
+
currentQps?: number
|
|
123
|
+
maxQps?: number
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type ListClusterFlowClient = {
|
|
127
|
+
clientId?: string
|
|
128
|
+
connectStatus?: ListClusterFlowClientStatus
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type ListClusterFlow = {
|
|
132
|
+
server?: ListClusterFlowServer
|
|
133
|
+
client?: ListClusterFlowClient
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type ListClusterFlowReq = {
|
|
137
|
+
workspaceId?: string
|
|
138
|
+
clusterName?: string
|
|
139
|
+
namespaceName?: string
|
|
140
|
+
sentinelName?: string
|
|
141
|
+
appName?: string
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export type DeleteClusterFlowReq = {
|
|
145
|
+
workspaceId?: string
|
|
146
|
+
clusterName?: string
|
|
147
|
+
namespaceName?: string
|
|
148
|
+
sentinelName?: string
|
|
149
|
+
appName?: string
|
|
150
|
+
serverId?: string
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export type ListClusterFlowRes = {
|
|
154
|
+
items?: ListClusterFlow[]
|
|
155
|
+
pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export type ListTokenServerReq = {
|
|
159
|
+
workspaceId?: string
|
|
160
|
+
clusterName?: string
|
|
161
|
+
namespaceName?: string
|
|
162
|
+
sentinelName?: string
|
|
163
|
+
appName?: string
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export type ListTokenServerRes = {
|
|
167
|
+
items?: string[]
|
|
168
|
+
pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type TokenServerReq = {
|
|
172
|
+
workspaceId?: string
|
|
173
|
+
clusterName?: string
|
|
174
|
+
namespaceName?: string
|
|
175
|
+
sentinelName?: string
|
|
176
|
+
appName?: string
|
|
177
|
+
machineType?: MachineType
|
|
178
|
+
machineId?: string
|
|
179
|
+
port?: number
|
|
180
|
+
maxQps?: number
|
|
181
|
+
clients?: string[]
|
|
182
|
+
}
|
|
183
|
+
|
|
106
184
|
export type FlowRule = {
|
|
107
185
|
id?: string
|
|
108
186
|
app?: string
|
|
@@ -264,6 +264,18 @@ export class Sentinel {
|
|
|
264
264
|
static ListResource(req: SkoalaApiHostedV1alpha1Sentinel.ListResourceReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Sentinel.ListResourceRes> {
|
|
265
265
|
return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.ListResourceReq, SkoalaApiHostedV1alpha1Sentinel.ListResourceRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/sentinels/${req["sentinelName"]}/apps/${req["appName"]}/resources?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName", "namespaceName", "sentinelName", "appName"])}`, {...initReq, method: "GET"})
|
|
266
266
|
}
|
|
267
|
+
static ListClusterFlow(req: SkoalaApiHostedV1alpha1Sentinel.ListClusterFlowReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Sentinel.ListClusterFlowRes> {
|
|
268
|
+
return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.ListClusterFlowReq, SkoalaApiHostedV1alpha1Sentinel.ListClusterFlowRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/sentinels/${req["sentinelName"]}/apps/${req["appName"]}/cluster-flows?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName", "namespaceName", "sentinelName", "appName"])}`, {...initReq, method: "GET"})
|
|
269
|
+
}
|
|
270
|
+
static ListTokenServer(req: SkoalaApiHostedV1alpha1Sentinel.ListTokenServerReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Sentinel.ListTokenServerRes> {
|
|
271
|
+
return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.ListTokenServerReq, SkoalaApiHostedV1alpha1Sentinel.ListTokenServerRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/sentinels/${req["sentinelName"]}/apps/${req["appName"]}/token-servers?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName", "namespaceName", "sentinelName", "appName"])}`, {...initReq, method: "GET"})
|
|
272
|
+
}
|
|
273
|
+
static CreateOrUpdateTokenServer(req: SkoalaApiHostedV1alpha1Sentinel.TokenServerReq, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
274
|
+
return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.TokenServerReq, GoogleProtobufEmpty.Empty>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/sentinels/${req["sentinelName"]}/apps/${req["appName"]}/token-servers`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
275
|
+
}
|
|
276
|
+
static DeleteClusterFlow(req: SkoalaApiHostedV1alpha1Sentinel.DeleteClusterFlowReq, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
277
|
+
return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.DeleteClusterFlowReq, GoogleProtobufEmpty.Empty>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/sentinels/${req["sentinelName"]}/apps/${req["appName"]}/cluster-flows/${req["serverId"]}`, {...initReq, method: "DELETE"})
|
|
278
|
+
}
|
|
267
279
|
static CreateFlowRule(req: SkoalaApiHostedV1alpha1Sentinel.CreateFlowRuleReq, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
268
280
|
return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.CreateFlowRuleReq, GoogleProtobufEmpty.Empty>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/sentinels/${req["sentinelName"]}/apps/${req["appName"]}/flow-rules`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
269
281
|
}
|