@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,32 @@
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 GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
10
+ import * as HydraManagement_apiWorkspaceV1alpha1Workspace from "../../../management-api/workspace/v1alpha1/workspace.pb"
11
+ export type ListClusterRequest = {
12
+ page?: HydraCommonCommon.Pagination
13
+ }
14
+
15
+ export type ListClusterResponse = {
16
+ items?: HydraManagement_apiWorkspaceV1alpha1Workspace.Cluster[]
17
+ page?: HydraCommonCommon.Pagination
18
+ }
19
+
20
+ export type ConstantsResponse = {
21
+ defaultFilesStorageCapacity?: string
22
+ defaultMountPath?: string
23
+ }
24
+
25
+ export class CoreService {
26
+ static AdminListCluster(req: ListClusterRequest, initReq?: fm.InitReq): Promise<ListClusterResponse> {
27
+ return fm.fetchReq<ListClusterRequest, ListClusterResponse>(`/apis/admin.hydra.io/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
28
+ }
29
+ static AdminListConstants(req: GoogleProtobufEmpty.Empty, initReq?: fm.InitReq): Promise<ConstantsResponse> {
30
+ return fm.fetchReq<GoogleProtobufEmpty.Empty, ConstantsResponse>(`/apis/admin.hydra.io/v1alpha1/constants?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
31
+ }
32
+ }
@@ -0,0 +1,131 @@
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 HydraAdmin_apiModelV1alpha1Model from "../../model/v1alpha1/model.pb"
11
+
12
+ export enum LoadBalanceStrategy {
13
+ LOAD_BALANCE_STRATEGY_UNSPECIFIED = "LOAD_BALANCE_STRATEGY_UNSPECIFIED",
14
+ LOAD_BALANCE_STRATEGY_ROUND_ROBIN = "LOAD_BALANCE_STRATEGY_ROUND_ROBIN",
15
+ LOAD_BALANCE_STRATEGY_RANDOM = "LOAD_BALANCE_STRATEGY_RANDOM",
16
+ LOAD_BALANCE_STRATEGY_WEIGHTED = "LOAD_BALANCE_STRATEGY_WEIGHTED",
17
+ }
18
+
19
+ export enum RateLimitBaseOn {
20
+ RATE_LIMIT_BASE_ON_UNSPECIFIED = "RATE_LIMIT_BASE_ON_UNSPECIFIED",
21
+ RATE_LIMIT_BASE_ON_API_KEY = "RATE_LIMIT_BASE_ON_API_KEY",
22
+ RATE_LIMIT_BASE_ON_WS = "RATE_LIMIT_BASE_ON_WS",
23
+ }
24
+
25
+ export enum MAASModelGatewayStatus {
26
+ GATEWAY_STATUS_UNSPECIFIED = "GATEWAY_STATUS_UNSPECIFIED",
27
+ GATEWAY_STATUS_HEALTHY = "GATEWAY_STATUS_HEALTHY",
28
+ GATEWAY_STATUS_FAILED = "GATEWAY_STATUS_FAILED",
29
+ }
30
+
31
+ export enum UpstreamModelStatus {
32
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
33
+ STATUS_HEALTHY = "STATUS_HEALTHY",
34
+ STATUS_FAILED = "STATUS_FAILED",
35
+ }
36
+
37
+ export type CreateMAASModelRequest = {
38
+ modelId?: string
39
+ upstreamModels?: UpstreamModel[]
40
+ cluster?: string
41
+ ratelimitConfig?: RatelimitConfig
42
+ loadBalanceConfig?: LoadBalanceConfig
43
+ }
44
+
45
+ export type MAASModel = {
46
+ model?: HydraAdmin_apiModelV1alpha1Model.Model
47
+ upstreamModels?: UpstreamModel[]
48
+ cluster?: string
49
+ ratelimitConfig?: RatelimitConfig
50
+ loadBalanceConfig?: LoadBalanceConfig
51
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
52
+ gatewayStatus?: MAASModelGatewayStatus
53
+ enabled?: boolean
54
+ }
55
+
56
+ export type LoadBalanceConfig = {
57
+ strategy?: LoadBalanceStrategy
58
+ weightedConfig?: WeightedLoadBalanceConfig
59
+ }
60
+
61
+ export type WeightedLoadBalanceConfig = {
62
+ endpoints?: WeightedEndpoint[]
63
+ }
64
+
65
+ export type WeightedEndpoint = {
66
+ modelId?: string
67
+ weight?: number
68
+ }
69
+
70
+ export type RatelimitConfig = {
71
+ enabled?: boolean
72
+ rules?: RateLimitRule[]
73
+ }
74
+
75
+ export type RateLimitRule = {
76
+ baseOn?: RateLimitBaseOn
77
+ limit?: number
78
+ duration?: number
79
+ workspace?: number
80
+ apiKey?: string
81
+ }
82
+
83
+ export type UpstreamModel = {
84
+ modelId?: string
85
+ apiKey?: string
86
+ endpoint?: string
87
+ status?: UpstreamModelStatus
88
+ }
89
+
90
+ export type ListMAASModelRequest = {
91
+ page?: HydraCommonCommon.Pagination
92
+ }
93
+
94
+ export type ListMAASModelResponse = {
95
+ items?: MAASModel[]
96
+ page?: HydraCommonCommon.Pagination
97
+ }
98
+
99
+ export type UpdateMAASModelRequest = {
100
+ modelId?: string
101
+ ratelimitConfig?: RatelimitConfig
102
+ loadBalanceConfig?: LoadBalanceConfig
103
+ upstreamModels?: UpstreamModel[]
104
+ }
105
+
106
+ export type UpdateMAASModelStatusRequest = {
107
+ modelId?: string
108
+ enable?: boolean
109
+ }
110
+
111
+ export type GetMAASModelRequest = {
112
+ modelId?: string
113
+ }
114
+
115
+ export class MAASService {
116
+ static GetMAASModel(req: GetMAASModelRequest, initReq?: fm.InitReq): Promise<MAASModel> {
117
+ return fm.fetchReq<GetMAASModelRequest, MAASModel>(`/apis/admin.hydra.io/v1alpha1/maas-models/${req["modelId"]}?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
118
+ }
119
+ static CreateMAASModel(req: CreateMAASModelRequest, initReq?: fm.InitReq): Promise<MAASModel> {
120
+ return fm.fetchReq<CreateMAASModelRequest, MAASModel>(`/apis/admin.hydra.io/v1alpha1/maas-models`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
121
+ }
122
+ static ListMAASModels(req: ListMAASModelRequest, initReq?: fm.InitReq): Promise<ListMAASModelResponse> {
123
+ return fm.fetchReq<ListMAASModelRequest, ListMAASModelResponse>(`/apis/admin.hydra.io/v1alpha1/maas-models?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
124
+ }
125
+ static UpdateMAASModel(req: UpdateMAASModelRequest, initReq?: fm.InitReq): Promise<MAASModel> {
126
+ return fm.fetchReq<UpdateMAASModelRequest, MAASModel>(`/apis/admin.hydra.io/v1alpha1/maas-models/${req["modelId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
127
+ }
128
+ static UpdateMAASModelStatus(req: UpdateMAASModelStatusRequest, initReq?: fm.InitReq): Promise<MAASModel> {
129
+ return fm.fetchReq<UpdateMAASModelStatusRequest, MAASModel>(`/apis/admin.hydra.io/v1alpha1/maas-models/${req["modelId"]}/status`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
130
+ }
131
+ }
@@ -0,0 +1,190 @@
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 GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
10
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
11
+ import * as HydraManagement_apiModelV1alpha1Model from "../../../management-api/model/v1alpha1/model.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 ListModelRequestModelListSelector {
23
+ ALL = "ALL",
24
+ HAS_DEPLOY_TEMPLATE = "HAS_DEPLOY_TEMPLATE",
25
+ NO_DEPLOY_TEMPLATE = "NO_DEPLOY_TEMPLATE",
26
+ }
27
+
28
+ export type CreateModelRequest = {
29
+ modelId?: string
30
+ modelAvatar?: string
31
+ modelName?: string
32
+ providerId?: string
33
+ modelDescription?: HydraCommonCommon.I18nName
34
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
35
+ publicEndpointEnabled?: boolean
36
+ publicEndpointBaseUrl?: string
37
+ publicAccessModelName?: string
38
+ readme?: HydraCommonCommon.I18nName
39
+ publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
40
+ servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
41
+ hidden?: boolean
42
+ providerName?: HydraCommonCommon.I18nName
43
+ }
44
+
45
+ export type Model = {
46
+ modelId?: string
47
+ modelAvatar?: string
48
+ modelName?: string
49
+ providerId?: string
50
+ providerName?: HydraCommonCommon.I18nName
51
+ modelDescription?: HydraCommonCommon.I18nName
52
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
53
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
54
+ updateTimestamp?: GoogleProtobufTimestamp.Timestamp
55
+ publicEndpointEnabled?: boolean
56
+ publicEndpointBaseUrl?: string
57
+ publicAccessModelName?: string
58
+ readme?: HydraCommonCommon.I18nName
59
+ publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
60
+ servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
61
+ hidden?: boolean
62
+ }
63
+
64
+ export type UpdateModelRequest = {
65
+ modelId?: string
66
+ modelAvatar?: string
67
+ modelName?: string
68
+ providerId?: string
69
+ modelDescription?: HydraCommonCommon.I18nName
70
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
71
+ publicEndpointEnabled?: boolean
72
+ publicEndpointBaseUrl?: string
73
+ publicAccessModelName?: string
74
+ readme?: HydraCommonCommon.I18nName
75
+ publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
76
+ servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
77
+ hidden?: boolean
78
+ }
79
+
80
+ export type ListModelRequest = {
81
+ page?: HydraCommonCommon.Pagination
82
+ showDeployTemplate?: boolean
83
+ selector?: ListModelRequestModelListSelector
84
+ }
85
+
86
+ export type ListModelResponse = {
87
+ items?: Model[]
88
+ page?: HydraCommonCommon.Pagination
89
+ }
90
+
91
+ export type SingleModelRequest = {
92
+ modelId?: string
93
+ }
94
+
95
+
96
+ type BaseParseModelSpecsRequest = {
97
+ }
98
+
99
+ export type ParseModelSpecsRequest = BaseParseModelSpecsRequest
100
+ & OneOf<{ yAML: string; uRL: string }>
101
+
102
+ export type ParsedModel = {
103
+ model?: Model
104
+ exist?: boolean
105
+ error?: string
106
+ }
107
+
108
+ export type ParseModelSpecsResponse = {
109
+ items?: ParsedModel[]
110
+ }
111
+
112
+ export type BatchCreateModelsRequest = {
113
+ models?: CreateModelRequest[]
114
+ }
115
+
116
+ export type BatchCreateModelsResponse = {
117
+ items?: Model[]
118
+ }
119
+
120
+ export type AddDeployTemplatesRequest = {
121
+ modelId?: string
122
+ deployTemplates?: HydraManagement_apiModelV1alpha1Model.DeployTemplate[]
123
+ }
124
+
125
+ export type ModelTemplate = {
126
+ templateId?: string
127
+ modelId?: string
128
+ workspace?: number
129
+ spec?: HydraManagement_apiModelV1alpha1Model.DeployTemplate
130
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
131
+ updateTimestamp?: GoogleProtobufTimestamp.Timestamp
132
+ }
133
+
134
+ export type UpdateDeployTemplatesRequest = {
135
+ modelId?: string
136
+ deployTemplates?: HydraManagement_apiModelV1alpha1Model.DeployTemplate[]
137
+ }
138
+
139
+ export class AdminModelManagement {
140
+ static CreateModel(req: CreateModelRequest, initReq?: fm.InitReq): Promise<Model> {
141
+ return fm.fetchReq<CreateModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
142
+ }
143
+ static GetModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
144
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
145
+ }
146
+ static ListModels(req: ListModelRequest, initReq?: fm.InitReq): Promise<ListModelResponse> {
147
+ return fm.fetchReq<ListModelRequest, ListModelResponse>(`/apis/admin.hydra.io/v1alpha1/models?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
148
+ }
149
+ static UpdateModel(req: UpdateModelRequest, initReq?: fm.InitReq): Promise<Model> {
150
+ return fm.fetchReq<UpdateModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
151
+ }
152
+ static DeleteModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
153
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}`, {...initReq, method: "DELETE"})
154
+ }
155
+ static ParseModelSpecs(req: ParseModelSpecsRequest, initReq?: fm.InitReq): Promise<ParseModelSpecsResponse> {
156
+ return fm.fetchReq<ParseModelSpecsRequest, ParseModelSpecsResponse>(`/apis/admin.hydra.io/v1alpha1/models:parse`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
157
+ }
158
+ static BatchCreateModels(req: BatchCreateModelsRequest, initReq?: fm.InitReq): Promise<BatchCreateModelsResponse> {
159
+ return fm.fetchReq<BatchCreateModelsRequest, BatchCreateModelsResponse>(`/apis/admin.hydra.io/v1alpha1/models:batch_create`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
160
+ }
161
+ static PublishModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
162
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}:publish`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
163
+ }
164
+ static UnpublishModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
165
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}:unpublish`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
166
+ }
167
+ static AddDeployTemplates(req: AddDeployTemplatesRequest, initReq?: fm.InitReq): Promise<Model> {
168
+ return fm.fetchReq<AddDeployTemplatesRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/deploy_templates`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
169
+ }
170
+ static UpdateDeployTemplates(req: UpdateDeployTemplatesRequest, initReq?: fm.InitReq): Promise<Model> {
171
+ return fm.fetchReq<UpdateDeployTemplatesRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/deploy_templates`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
172
+ }
173
+ }
174
+ export class AdminModelTemplateManagement {
175
+ static CreateModelTemplate(req: HydraManagement_apiModelV1alpha1Model.CreateModelTemplateRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiModelV1alpha1Model.ModelTemplate> {
176
+ return fm.fetchReq<HydraManagement_apiModelV1alpha1Model.CreateModelTemplateRequest, HydraManagement_apiModelV1alpha1Model.ModelTemplate>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/model-templates`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
177
+ }
178
+ static GetModelTemplate(req: HydraManagement_apiModelV1alpha1Model.GetModelTemplateRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiModelV1alpha1Model.ModelTemplate> {
179
+ return fm.fetchReq<HydraManagement_apiModelV1alpha1Model.GetModelTemplateRequest, HydraManagement_apiModelV1alpha1Model.ModelTemplate>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/model-templates/${req["templateId"]}?${fm.renderURLSearchParams(req, ["modelId", "templateId"])}`, {...initReq, method: "GET"})
180
+ }
181
+ static UpdateModelTemplate(req: HydraManagement_apiModelV1alpha1Model.UpdateModelTemplateRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiModelV1alpha1Model.ModelTemplate> {
182
+ return fm.fetchReq<HydraManagement_apiModelV1alpha1Model.UpdateModelTemplateRequest, HydraManagement_apiModelV1alpha1Model.ModelTemplate>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/model-templates/${req["templateId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
183
+ }
184
+ static DeleteModelTemplate(req: HydraManagement_apiModelV1alpha1Model.DeleteModelTemplateRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
185
+ return fm.fetchReq<HydraManagement_apiModelV1alpha1Model.DeleteModelTemplateRequest, GoogleProtobufEmpty.Empty>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/model-templates/${req["templateId"]}`, {...initReq, method: "DELETE"})
186
+ }
187
+ static ListModelTemplates(req: HydraManagement_apiModelV1alpha1Model.ListModelTemplatesRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiModelV1alpha1Model.ListModelTemplatesResponse> {
188
+ return fm.fetchReq<HydraManagement_apiModelV1alpha1Model.ListModelTemplatesRequest, HydraManagement_apiModelV1alpha1Model.ListModelTemplatesResponse>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/model-templates?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
189
+ }
190
+ }
@@ -0,0 +1,96 @@
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
+
11
+ export enum StorageSourceType {
12
+ STORAGE_SOURCE_TYPE_UNSPECIFIED = "STORAGE_SOURCE_TYPE_UNSPECIFIED",
13
+ FILES_STORAGE = "FILES_STORAGE",
14
+ PVC_STORAGE = "PVC_STORAGE",
15
+ }
16
+
17
+ export type ModelWeightsVolume = {
18
+ id?: string
19
+ modelId?: string
20
+ modelTag?: string
21
+ clusterName?: string
22
+ storageSource?: StorageSourceType
23
+ storageRef?: string
24
+ subPath?: string
25
+ mountPath?: string
26
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
27
+ updateTimestamp?: GoogleProtobufTimestamp.Timestamp
28
+ referenced?: boolean
29
+ }
30
+
31
+ export type CreateModelWeightsVolumeRequest = {
32
+ id?: string
33
+ modelId?: string
34
+ clusterName?: string
35
+ modelTag?: string
36
+ storageSource?: StorageSourceType
37
+ storageRef?: string
38
+ subPath?: string
39
+ mountPath?: string
40
+ }
41
+
42
+ export type UpdateModelWeightsVolumeRequest = {
43
+ id?: string
44
+ modelId?: string
45
+ clusterName?: string
46
+ modelTag?: string
47
+ storageSource?: StorageSourceType
48
+ storageRef?: string
49
+ subPath?: string
50
+ mountPath?: string
51
+ }
52
+
53
+ export type SingleModelWeightsVolumeRequest = {
54
+ id?: string
55
+ modelId?: string
56
+ }
57
+
58
+ export type ListModelWeightsVolumesRequest = {
59
+ modelId?: string
60
+ page?: HydraCommonCommon.Pagination
61
+ clusterName?: string
62
+ }
63
+
64
+ export type ListModelWeightsVolumesResponse = {
65
+ items?: ModelWeightsVolume[]
66
+ page?: HydraCommonCommon.Pagination
67
+ }
68
+
69
+ export type GetStorageSourceRequest = {
70
+ modelId?: string
71
+ }
72
+
73
+ export type GetStorageSourceResponse = {
74
+ sources?: {[key: string]: number}
75
+ }
76
+
77
+ export class AdminModelWeightsVolumeManagement {
78
+ static CreateModelWeightsVolume(req: CreateModelWeightsVolumeRequest, initReq?: fm.InitReq): Promise<ModelWeightsVolume> {
79
+ return fm.fetchReq<CreateModelWeightsVolumeRequest, ModelWeightsVolume>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/weights`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
80
+ }
81
+ static UpdateModelWeightsVolume(req: UpdateModelWeightsVolumeRequest, initReq?: fm.InitReq): Promise<ModelWeightsVolume> {
82
+ return fm.fetchReq<UpdateModelWeightsVolumeRequest, ModelWeightsVolume>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/weights/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
83
+ }
84
+ static DeleteModelWeightsVolume(req: SingleModelWeightsVolumeRequest, initReq?: fm.InitReq): Promise<ModelWeightsVolume> {
85
+ return fm.fetchReq<SingleModelWeightsVolumeRequest, ModelWeightsVolume>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/weights/${req["id"]}`, {...initReq, method: "DELETE"})
86
+ }
87
+ static GetModelWeightsVolume(req: SingleModelWeightsVolumeRequest, initReq?: fm.InitReq): Promise<ModelWeightsVolume> {
88
+ return fm.fetchReq<SingleModelWeightsVolumeRequest, ModelWeightsVolume>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/weights/${req["id"]}?${fm.renderURLSearchParams(req, ["modelId", "id"])}`, {...initReq, method: "GET"})
89
+ }
90
+ static ListModelWeightsVolumes(req: ListModelWeightsVolumesRequest, initReq?: fm.InitReq): Promise<ListModelWeightsVolumesResponse> {
91
+ return fm.fetchReq<ListModelWeightsVolumesRequest, ListModelWeightsVolumesResponse>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/weights?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
92
+ }
93
+ static GetStorageSource(req: GetStorageSourceRequest, initReq?: fm.InitReq): Promise<GetStorageSourceResponse> {
94
+ return fm.fetchReq<GetStorageSourceRequest, GetStorageSourceResponse>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/weights:storage-source?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
95
+ }
96
+ }
@@ -0,0 +1,59 @@
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
+ export type CreateProviderRequest = {
10
+ providerId?: string
11
+ providerName?: HydraCommonCommon.I18nName
12
+ providerDescription?: HydraCommonCommon.I18nName
13
+ providerAvatar?: string
14
+ }
15
+
16
+ export type Provider = {
17
+ providerId?: string
18
+ providerName?: HydraCommonCommon.I18nName
19
+ providerDescription?: HydraCommonCommon.I18nName
20
+ providerAvatar?: string
21
+ }
22
+
23
+ export type UpdateProviderRequest = {
24
+ providerId?: string
25
+ providerName?: HydraCommonCommon.I18nName
26
+ providerDescription?: HydraCommonCommon.I18nName
27
+ providerAvatar?: string
28
+ }
29
+
30
+ export type ListProviderRequest = {
31
+ page?: HydraCommonCommon.Pagination
32
+ }
33
+
34
+ export type ListProviderResponse = {
35
+ items?: Provider[]
36
+ page?: HydraCommonCommon.Pagination
37
+ }
38
+
39
+ export type SingleProviderRequest = {
40
+ providerId?: string
41
+ }
42
+
43
+ export class AdminProviderManagement {
44
+ static CreateProvider(req: CreateProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
45
+ return fm.fetchReq<CreateProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
46
+ }
47
+ static GetProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
48
+ return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}?${fm.renderURLSearchParams(req, ["providerId"])}`, {...initReq, method: "GET"})
49
+ }
50
+ static ListProviders(req: ListProviderRequest, initReq?: fm.InitReq): Promise<ListProviderResponse> {
51
+ return fm.fetchReq<ListProviderRequest, ListProviderResponse>(`/apis/admin.hydra.io/v1alpha1/providers?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
52
+ }
53
+ static UpdateProvider(req: UpdateProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
54
+ return fm.fetchReq<UpdateProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
55
+ }
56
+ static DeleteProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
57
+ return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}`, {...initReq, method: "DELETE"})
58
+ }
59
+ }