@daocloud-proto/hydra 0.0.0-dev-65873840

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.
Files changed (29) hide show
  1. package/admin-api/core/v1alpha1/core.pb.ts +32 -0
  2. package/admin-api/maas/v1alpha1/maas.pb.ts +131 -0
  3. package/admin-api/model/v1alpha1/model.pb.ts +190 -0
  4. package/admin-api/model/v1alpha1/model_weights_volume.pb.ts +96 -0
  5. package/admin-api/model/v1alpha1/provider.pb.ts +59 -0
  6. package/admin-api/storage/v1alpha1/filesstorage.pb.ts +261 -0
  7. package/common/common.pb.ts +159 -0
  8. package/common/error.pb.ts +10 -0
  9. package/common/errorcode.ts +48 -0
  10. package/fetch.pb.ts +341 -0
  11. package/management-api/agent/v1alpha1/event.pb.ts +75 -0
  12. package/management-api/agent/v1alpha1/server_registration.pb.ts +33 -0
  13. package/management-api/agent/v1alpha1/sftp_user.pb.ts +39 -0
  14. package/management-api/apikey/v1alpha1/apikey.pb.ts +135 -0
  15. package/management-api/core/v1alpha1/image.pb.ts +174 -0
  16. package/management-api/core/v1alpha1/management.pb.ts +55 -0
  17. package/management-api/core/v1alpha1/permissions.pb.ts +30 -0
  18. package/management-api/event/v1alpha1/event.pb.ts +38 -0
  19. package/management-api/model/v1alpha1/model.pb.ts +275 -0
  20. package/management-api/model/v1alpha1/model_weights_volume.pb.ts +101 -0
  21. package/management-api/model/v1alpha1/provider.pb.ts +68 -0
  22. package/management-api/model_serving/v1alpha1/model_serving.pb.ts +317 -0
  23. package/management-api/product/v1alpha1/product.pb.ts +77 -0
  24. package/management-api/queue/v1alpha1/queue.pb.ts +121 -0
  25. package/management-api/storage/v1alpha1/filesstorage.pb.ts +495 -0
  26. package/management-api/user/v1alpha1/user.pb.ts +24 -0
  27. package/management-api/web_search_agent/v1alpha1/agent.pb.ts +19 -0
  28. package/management-api/workspace/v1alpha1/workspace.pb.ts +82 -0
  29. package/package.json +7 -0
@@ -0,0 +1,68 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as HydraCommonCommon from "../../../common/common.pb"
8
+ import * as fm from "../../../fetch.pb"
9
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
+ export type Provider = {
11
+ providerId?: string
12
+ providerName?: HydraCommonCommon.I18nName
13
+ providerAvatar?: string
14
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
15
+ }
16
+
17
+ export type ListProviderRequest = {
18
+ page?: HydraCommonCommon.Pagination
19
+ }
20
+
21
+ export type ListProviderResponse = {
22
+ items?: Provider[]
23
+ page?: HydraCommonCommon.Pagination
24
+ }
25
+
26
+ export type SingleProviderRequest = {
27
+ id?: string
28
+ }
29
+
30
+ export type ListWSProviderRequest = {
31
+ page?: HydraCommonCommon.Pagination
32
+ workspace?: number
33
+ }
34
+
35
+ export type ListWSProviderResponse = {
36
+ items?: WSProvider[]
37
+ page?: HydraCommonCommon.Pagination
38
+ }
39
+
40
+ export type WSProvider = {
41
+ providerId?: string
42
+ providerName?: HydraCommonCommon.I18nName
43
+ providerAvatar?: string
44
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
45
+ workspace?: number
46
+ }
47
+
48
+ export type SingleWSProviderRequest = {
49
+ id?: string
50
+ workspace?: number
51
+ }
52
+
53
+ export class ProviderManagement {
54
+ static GetProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
55
+ return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/hydra.io/v1alpha1/providers/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
56
+ }
57
+ static ListProvider(req: ListProviderRequest, initReq?: fm.InitReq): Promise<ListProviderResponse> {
58
+ return fm.fetchReq<ListProviderRequest, ListProviderResponse>(`/apis/hydra.io/v1alpha1/providers?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
59
+ }
60
+ }
61
+ export class WSProviderManagement {
62
+ static GetWSProvider(req: SingleWSProviderRequest, initReq?: fm.InitReq): Promise<WSProvider> {
63
+ return fm.fetchReq<SingleWSProviderRequest, WSProvider>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/providers/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
64
+ }
65
+ static ListWSProvider(req: ListWSProviderRequest, initReq?: fm.InitReq): Promise<ListWSProviderResponse> {
66
+ return fm.fetchReq<ListWSProviderRequest, ListWSProviderResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/providers?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
67
+ }
68
+ }
@@ -0,0 +1,317 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as HydraCommonCommon from "../../../common/common.pb"
8
+ import * as fm from "../../../fetch.pb"
9
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
+ import * as HydraManagement_apiModelV1alpha1Model from "../../model/v1alpha1/model.pb"
11
+ import * as HydraManagement_apiModelV1alpha1Model_weights_volume from "../../model/v1alpha1/model_weights_volume.pb"
12
+
13
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
14
+ type OneOf<T> =
15
+ | { [k in keyof T]?: undefined }
16
+ | (
17
+ keyof T extends infer K ?
18
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
19
+ : never)
20
+ : never);
21
+
22
+ export enum PaymentMethod {
23
+ PAYMENT_METHOD_UNSPECIFIED = "PAYMENT_METHOD_UNSPECIFIED",
24
+ PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
25
+ }
26
+
27
+ export enum PlacementPolicy {
28
+ PLACEMENT_POLICY_UNSPECIFIED = "PLACEMENT_POLICY_UNSPECIFIED",
29
+ BALANCED = "BALANCED",
30
+ GROUPED = "GROUPED",
31
+ }
32
+
33
+ export enum ModelServingStatus {
34
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
35
+ DEPLOYING = "DEPLOYING",
36
+ FAILED = "FAILED",
37
+ RUNNING = "RUNNING",
38
+ SCALING = "SCALING",
39
+ DELETING = "DELETING",
40
+ STOPPED = "STOPPED",
41
+ }
42
+
43
+ export enum ModelVisible {
44
+ MODEL_VISIBLE_UNSPECIFIED = "MODEL_VISIBLE_UNSPECIFIED",
45
+ MODEL_VISIBLE_PUBLIC = "MODEL_VISIBLE_PUBLIC",
46
+ MODEL_VISIBLE_PRIVATE = "MODEL_VISIBLE_PRIVATE",
47
+ }
48
+
49
+ export enum DeployDetectConditionType {
50
+ DEPLOY_DETECT_CONDITION_TYPE_UNSPECIFIED = "DEPLOY_DETECT_CONDITION_TYPE_UNSPECIFIED",
51
+ CLUSTER_RESOURCE_AVAILABLE = "CLUSTER_RESOURCE_AVAILABLE",
52
+ MODEL_IMAGE_DOWNLOADED = "MODEL_IMAGE_DOWNLOADED",
53
+ }
54
+
55
+ export enum ModelServingActionRequestAction {
56
+ MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
57
+ START = "START",
58
+ }
59
+
60
+ export enum WSModelServingActionRequestAction {
61
+ MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
62
+ START = "START",
63
+ STOP = "STOP",
64
+ }
65
+
66
+ export type SchedulingConfig = {
67
+ queueName?: string
68
+ priorityClass?: string
69
+ placementPolicy?: PlacementPolicy
70
+ }
71
+
72
+ export type WeightVolumeConfig = {
73
+ modelId?: string
74
+ modelTag?: string
75
+ storageSource?: HydraManagement_apiModelV1alpha1Model_weights_volume.StorageSourceType
76
+ storageRef?: string
77
+ subPath?: string
78
+ mountPath?: string
79
+ }
80
+
81
+
82
+ /* hydra modified */ export type BaseResourceConfig = {
83
+ cpu?: number
84
+ memory?: number
85
+ gpuType?: string
86
+ gpuCount?: number
87
+ perGpuMemory?: number
88
+ }
89
+
90
+ export type ResourceConfig = BaseResourceConfig
91
+ & OneOf<{ gpuCores: number }>
92
+
93
+ export type EnvVar = {
94
+ name?: string
95
+ value?: string
96
+ }
97
+
98
+ export type RuntimeConfig = {
99
+ runtimeType?: string
100
+ runtimeImage?: string
101
+ versionRequired?: string
102
+ imagePullSecretName?: string[]
103
+ runtimeCommand?: string
104
+ env?: EnvVar[]
105
+ }
106
+
107
+ export type CreateModelServingRequest = {
108
+ name?: string
109
+ modelId?: string
110
+ region?: string
111
+ replicas?: number
112
+ skuId?: string
113
+ paymentMethods?: PaymentMethod
114
+ }
115
+
116
+
117
+ /* hydra modified */ export type BaseCreateWSModelServingRequest = {
118
+ name?: string
119
+ modelId?: string
120
+ workspace?: number
121
+ cluster?: string
122
+ namespace?: string
123
+ replicas?: number
124
+ nodeSize?: number
125
+ weightVolumeId?: string
126
+ resourceConfig?: ResourceConfig
127
+ runtimeConfig?: RuntimeConfig
128
+ }
129
+
130
+ export type CreateWSModelServingRequest = BaseCreateWSModelServingRequest
131
+ & OneOf<{ weightVolumeConfig: WeightVolumeConfig }>
132
+ & OneOf<{ schedulingConfig: SchedulingConfig }>
133
+
134
+ export type ModelServing = {
135
+ id?: string
136
+ name?: string
137
+ modelId?: string
138
+ modelName?: string
139
+ region?: string
140
+ replicas?: number
141
+ skuId?: string
142
+ paymentMethods?: PaymentMethod
143
+ status?: ModelServingStatus
144
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
145
+ outBill?: boolean
146
+ accessModelName?: string
147
+ namespace?: string
148
+ stop?: string[]
149
+ stopTokenIds?: number[]
150
+ address?: string
151
+ modelAvatar?: string
152
+ regionName?: HydraCommonCommon.I18nName
153
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
154
+ }
155
+
156
+
157
+ /* hydra modified */ export type BaseWSModelServing = {
158
+ id?: string
159
+ name?: string
160
+ modelId?: string
161
+ modelName?: string
162
+ cluster?: string
163
+ replicas?: number
164
+ nodeSize?: number
165
+ status?: ModelServingStatus
166
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
167
+ accessModelName?: string
168
+ namespace?: string
169
+ address?: string
170
+ modelAvatar?: string
171
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
172
+ resourceConfig?: ResourceConfig
173
+ runtimeConfig?: RuntimeConfig
174
+ weightVolumeConfig?: WeightVolumeConfig
175
+ modelVisible?: ModelVisible
176
+ }
177
+
178
+ export type WSModelServing = BaseWSModelServing
179
+ & OneOf<{ schedulingConfig: SchedulingConfig }>
180
+
181
+ export type ListModelServingRequest = {
182
+ page?: HydraCommonCommon.Pagination
183
+ }
184
+
185
+ export type ListModelServingResponse = {
186
+ items?: ModelServing[]
187
+ page?: HydraCommonCommon.Pagination
188
+ }
189
+
190
+ export type ListWSModelServingRequest = {
191
+ workspace?: number
192
+ cluster?: string
193
+ namespace?: string
194
+ page?: HydraCommonCommon.Pagination
195
+ }
196
+
197
+ export type ListWSModelServingResponse = {
198
+ items?: WSModelServing[]
199
+ page?: HydraCommonCommon.Pagination
200
+ }
201
+
202
+ export type GetWSModelServingRequest = {
203
+ workspace?: number
204
+ id?: string
205
+ }
206
+
207
+ export type GetModelServingRequest = {
208
+ id?: string
209
+ }
210
+
211
+ export type DeleteModelServingRequest = {
212
+ id?: string
213
+ }
214
+
215
+ export type DeleteWSModelServingRequest = {
216
+ workspace?: number
217
+ cluster?: string
218
+ namespace?: string
219
+ id?: string
220
+ }
221
+
222
+ export type UpdateModelServingReplicasRequest = {
223
+ id?: string
224
+ replicas?: number
225
+ }
226
+
227
+ export type UpdateWSModelServingReplicasRequest = {
228
+ workspace?: number
229
+ cluster?: string
230
+ namespace?: string
231
+ id?: string
232
+ replicas?: number
233
+ }
234
+
235
+ export type ModelServingActionRequest = {
236
+ id?: string
237
+ action?: ModelServingActionRequestAction
238
+ }
239
+
240
+ export type WSModelServingActionRequest = {
241
+ workspace?: number
242
+ cluster?: string
243
+ namespace?: string
244
+ id?: string
245
+ action?: WSModelServingActionRequestAction
246
+ }
247
+
248
+
249
+ /* hydra modified */ export type BaseWSModelServingDeployDetectionRequest = {
250
+ workspace?: number
251
+ modelId?: string
252
+ cluster?: string
253
+ namespace?: string
254
+ nodeSize?: number
255
+ weightVolumeId?: string
256
+ resourceConfig?: ResourceConfig
257
+ runtimeConfig?: RuntimeConfig
258
+ }
259
+
260
+ export type WSModelServingDeployDetectionRequest = BaseWSModelServingDeployDetectionRequest
261
+ & OneOf<{ weightVolumeConfig: WeightVolumeConfig }>
262
+ & OneOf<{ schedulingConfig: SchedulingConfig }>
263
+
264
+ export type ModelServingDeployDetectionResponse = {
265
+ ready?: boolean
266
+ conditions?: DeployDetectCondition[]
267
+ }
268
+
269
+ export type DeployDetectCondition = {
270
+ type?: DeployDetectConditionType
271
+ ready?: boolean
272
+ message?: string
273
+ }
274
+
275
+ export class ModelServingManagement {
276
+ static CreateModelServing(req: CreateModelServingRequest, initReq?: fm.InitReq): Promise<ModelServing> {
277
+ return fm.fetchReq<CreateModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
278
+ }
279
+ static ListModelServing(req: ListModelServingRequest, initReq?: fm.InitReq): Promise<ListModelServingResponse> {
280
+ return fm.fetchReq<ListModelServingRequest, ListModelServingResponse>(`/apis/hydra.io/v1alpha1/model-serving?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
281
+ }
282
+ static GetModelServing(req: GetModelServingRequest, initReq?: fm.InitReq): Promise<ModelServing> {
283
+ return fm.fetchReq<GetModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
284
+ }
285
+ static DeleteModelServing(req: DeleteModelServingRequest, initReq?: fm.InitReq): Promise<ModelServing> {
286
+ return fm.fetchReq<DeleteModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
287
+ }
288
+ static UpdateModelServingReplicas(req: UpdateModelServingReplicasRequest, initReq?: fm.InitReq): Promise<ModelServing> {
289
+ return fm.fetchReq<UpdateModelServingReplicasRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}/replicas`, {...initReq, method: "PATCH", body: JSON.stringify(req, fm.replacer)})
290
+ }
291
+ static DoModelServingAction(req: ModelServingActionRequest, initReq?: fm.InitReq): Promise<ModelServing> {
292
+ return fm.fetchReq<ModelServingActionRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
293
+ }
294
+ }
295
+ export class WSModelServingManagement {
296
+ static DetectWSModelServing(req: WSModelServingDeployDetectionRequest, initReq?: fm.InitReq): Promise<ModelServingDeployDetectionResponse> {
297
+ return fm.fetchReq<WSModelServingDeployDetectionRequest, ModelServingDeployDetectionResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/detect`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
298
+ }
299
+ static CreateWSModelServing(req: CreateWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
300
+ return fm.fetchReq<CreateWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
301
+ }
302
+ static ListWSModelServing(req: ListWSModelServingRequest, initReq?: fm.InitReq): Promise<ListWSModelServingResponse> {
303
+ return fm.fetchReq<ListWSModelServingRequest, ListWSModelServingResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
304
+ }
305
+ static GetWSModelServing(req: GetWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
306
+ return fm.fetchReq<GetWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
307
+ }
308
+ static DeleteWSModelServing(req: DeleteWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
309
+ return fm.fetchReq<DeleteWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
310
+ }
311
+ static UpdateWSModelServingReplicas(req: UpdateWSModelServingReplicasRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
312
+ return fm.fetchReq<UpdateWSModelServingReplicasRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["id"]}/replicas`, {...initReq, method: "PATCH", body: JSON.stringify(req, fm.replacer)})
313
+ }
314
+ static DoModelWSServingAction(req: WSModelServingActionRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
315
+ return fm.fetchReq<WSModelServingActionRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["id"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
316
+ }
317
+ }
@@ -0,0 +1,77 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as HydraCommonCommon from "../../../common/common.pb"
8
+ import * as fm from "../../../fetch.pb"
9
+
10
+ export enum SKUPaymentMethod {
11
+ PAYMENT_METHOD_UNSPECIFIED = "PAYMENT_METHOD_UNSPECIFIED",
12
+ PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
13
+ }
14
+
15
+ export enum SKUPriceCurrency {
16
+ PRICE_UNIT_UNSPECIFIED = "PRICE_UNIT_UNSPECIFIED",
17
+ CNY = "CNY",
18
+ USD = "USD",
19
+ }
20
+
21
+ export enum ListSKURequestResourceType {
22
+ RESOURCE_TYPE_UNSPECIFIED = "RESOURCE_TYPE_UNSPECIFIED",
23
+ MODEL = "MODEL",
24
+ }
25
+
26
+ export type Region = {
27
+ region?: string
28
+ name?: HydraCommonCommon.I18nName
29
+ baseUrl?: string
30
+ }
31
+
32
+ export type ListRegionRequest = {
33
+ page?: HydraCommonCommon.Pagination
34
+ }
35
+
36
+ export type ListRegionResponse = {
37
+ items?: Region[]
38
+ page?: HydraCommonCommon.Pagination
39
+ }
40
+
41
+ export type GetRegionRequest = {
42
+ region?: string
43
+ }
44
+
45
+ export type SKU = {
46
+ id?: string
47
+ description?: string
48
+ region?: string
49
+ paymentMethod?: SKUPaymentMethod
50
+ pricePerUnit?: string
51
+ priceCurrency?: SKUPriceCurrency
52
+ available?: boolean
53
+ }
54
+
55
+ export type ListSKURequest = {
56
+ region?: string
57
+ resourceType?: ListSKURequestResourceType
58
+ resourceId?: string
59
+ page?: HydraCommonCommon.Pagination
60
+ }
61
+
62
+ export type ListSKUResponse = {
63
+ items?: SKU[]
64
+ page?: HydraCommonCommon.Pagination
65
+ }
66
+
67
+ export class SKUManagement {
68
+ static ListRegions(req: ListRegionRequest, initReq?: fm.InitReq): Promise<ListRegionResponse> {
69
+ return fm.fetchReq<ListRegionRequest, ListRegionResponse>(`/apis/hydra.io/v1alpha1/regions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
70
+ }
71
+ static GetRegion(req: GetRegionRequest, initReq?: fm.InitReq): Promise<Region> {
72
+ return fm.fetchReq<GetRegionRequest, Region>(`/apis/hydra.io/v1alpha1/regions/${req["region"]}?${fm.renderURLSearchParams(req, ["region"])}`, {...initReq, method: "GET"})
73
+ }
74
+ static ListSKUs(req: ListSKURequest, initReq?: fm.InitReq): Promise<ListSKUResponse> {
75
+ return fm.fetchReq<ListSKURequest, ListSKUResponse>(`/apis/hydra.io/v1alpha1/skus?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
76
+ }
77
+ }
@@ -0,0 +1,121 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as HydraCommonCommon from "../../../common/common.pb"
8
+ import * as fm from "../../../fetch.pb"
9
+
10
+ export enum QueueType {
11
+ QUEUE_TYPE_UNSPECIFIED = "QUEUE_TYPE_UNSPECIFIED",
12
+ KUEUE = "KUEUE",
13
+ }
14
+
15
+ export enum QueuePhase {
16
+ QUEUE_PHASE_UNSPECIFIED = "QUEUE_PHASE_UNSPECIFIED",
17
+ READY = "READY",
18
+ }
19
+
20
+ export enum QueueStrategy {
21
+ QUEUE_STRATEGY_UNSPECIFIED = "QUEUE_STRATEGY_UNSPECIFIED",
22
+ STRICT_FIFO = "STRICT_FIFO",
23
+ BEST_EFFORT_FIFO = "BEST_EFFORT_FIFO",
24
+ }
25
+
26
+ export enum QueuePreemptionWithinClusterQueuePolicy {
27
+ QUEUE_PREEMPTION_WITHIN_CLUSTER_QUEUE_POLICY_UNSPECIFIED = "QUEUE_PREEMPTION_WITHIN_CLUSTER_QUEUE_POLICY_UNSPECIFIED",
28
+ QUEUE_PREEMPTION_WITHIN_CLUSTER_QUEUE_POLICY_NEVER = "QUEUE_PREEMPTION_WITHIN_CLUSTER_QUEUE_POLICY_NEVER",
29
+ QUEUE_PREEMPTION_WITHIN_CLUSTER_QUEUE_POLICY_LOWER_PRIORITY = "QUEUE_PREEMPTION_WITHIN_CLUSTER_QUEUE_POLICY_LOWER_PRIORITY",
30
+ QUEUE_PREEMPTION_WITHIN_CLUSTER_QUEUE_POLICY_LOWER_OR_NEWER_EQUALPRIORITY = "QUEUE_PREEMPTION_WITHIN_CLUSTER_QUEUE_POLICY_LOWER_OR_NEWER_EQUALPRIORITY",
31
+ QUEUE_PREEMPTION_WITHIN_CLUSTER_QUEUE_POLICY_ANY = "QUEUE_PREEMPTION_WITHIN_CLUSTER_QUEUE_POLICY_ANY",
32
+ }
33
+
34
+ export type CheckQueueRequest = {
35
+ type?: QueueType
36
+ workspace?: number
37
+ cluster?: string
38
+ namespace?: string
39
+ name?: string
40
+ }
41
+
42
+ export type CheckQueueResponse = {
43
+ type?: QueueType
44
+ exist?: boolean
45
+ }
46
+
47
+ export type CreateLocalQueueRequest = {
48
+ type?: QueueType
49
+ workspace?: number
50
+ cluster?: string
51
+ namespace?: string
52
+ name?: string
53
+ }
54
+
55
+ export type QueueStatus = {
56
+ phase?: QueuePhase
57
+ }
58
+
59
+ export type CreateLocalQueueResponse = {
60
+ type?: QueueType
61
+ workspace?: number
62
+ cluster?: string
63
+ namespace?: string
64
+ name?: string
65
+ status?: QueueStatus
66
+ }
67
+
68
+ export type ListQueueRequest = {
69
+ workspace?: number
70
+ cluster?: string
71
+ type?: QueueType
72
+ page?: HydraCommonCommon.Pagination
73
+ }
74
+
75
+ export type ListQueueResponse = {
76
+ items?: Queue[]
77
+ page?: HydraCommonCommon.Pagination
78
+ }
79
+
80
+ export type QueueResource = {
81
+ name?: string
82
+ value?: string
83
+ borrowingLimit?: string
84
+ }
85
+
86
+ export type QueueFlavor = {
87
+ name?: string
88
+ resources?: QueueResource[]
89
+ resourcesAvailable?: QueueResource[]
90
+ nodes?: HydraCommonCommon.Node[]
91
+ }
92
+
93
+ export type Queue = {
94
+ type?: QueueType
95
+ cluster?: string
96
+ name?: string
97
+ workspace?: number
98
+ description?: string
99
+ resources?: QueueResource[]
100
+ resourcesAvailable?: QueueResource[]
101
+ labels?: {[key: string]: string}
102
+ annotations?: {[key: string]: string}
103
+ status?: QueueStatus
104
+ strategy?: QueueStrategy
105
+ workspaceAlias?: string
106
+ preemptionWithinClusterQueue?: QueuePreemptionWithinClusterQueuePolicy
107
+ flavors?: QueueFlavor[]
108
+ tasEnabled?: boolean
109
+ }
110
+
111
+ export class QueueManagement {
112
+ static CheckQueue(req: CheckQueueRequest, initReq?: fm.InitReq): Promise<CheckQueueResponse> {
113
+ return fm.fetchReq<CheckQueueRequest, CheckQueueResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/queues/${req["name"]}/capacites?${fm.renderURLSearchParams(req, ["workspace", "cluster", "name"])}`, {...initReq, method: "GET"})
114
+ }
115
+ static CreateLocalQueue(req: CreateLocalQueueRequest, initReq?: fm.InitReq): Promise<CreateLocalQueueResponse> {
116
+ return fm.fetchReq<CreateLocalQueueRequest, CreateLocalQueueResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/localqueues`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
117
+ }
118
+ static ListQueues(req: ListQueueRequest, initReq?: fm.InitReq): Promise<ListQueueResponse> {
119
+ return fm.fetchReq<ListQueueRequest, ListQueueResponse>(`/apis/hydra.io/v1alpha1/queues?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
120
+ }
121
+ }