@daocloud-proto/hydra 0.11.0-dev-6 → 0.11.0-dev-9
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.
|
@@ -0,0 +1,230 @@
|
|
|
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 EventV1alpha1Event from "../../../management-api/event/v1alpha1/event.pb"
|
|
12
|
+
import * as HydraManagement_apiStorageV1alpha1Filesstorage from "../../../management-api/storage/v1alpha1/filesstorage.pb"
|
|
13
|
+
|
|
14
|
+
type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
|
|
15
|
+
type OneOf<T> =
|
|
16
|
+
| { [k in keyof T]?: undefined }
|
|
17
|
+
| (
|
|
18
|
+
keyof T extends infer K ?
|
|
19
|
+
(K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
|
|
20
|
+
: never)
|
|
21
|
+
: never);
|
|
22
|
+
|
|
23
|
+
export enum PrePullActionRequestAction {
|
|
24
|
+
ACTION_UNSPECIFIED = "ACTION_UNSPECIFIED",
|
|
25
|
+
RERUN = "RERUN",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type FilesStorageStatus = {
|
|
29
|
+
phase?: string
|
|
30
|
+
reason?: string
|
|
31
|
+
pvcName?: string
|
|
32
|
+
pvcNamespace?: string
|
|
33
|
+
storageServer?: StorageServerStatus
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type FilesStorage = {
|
|
37
|
+
name?: string
|
|
38
|
+
cluster?: string
|
|
39
|
+
pvcNamespace?: string
|
|
40
|
+
storageClassName?: string
|
|
41
|
+
capacity?: string
|
|
42
|
+
status?: FilesStorageStatus
|
|
43
|
+
createTime?: GoogleProtobufTimestamp.Timestamp
|
|
44
|
+
description?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type StorageServerStatus = {
|
|
48
|
+
phase?: string
|
|
49
|
+
name?: string
|
|
50
|
+
namespace?: string
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type ListFilesStoragesRequest = {
|
|
54
|
+
page?: HydraCommonCommon.Pagination
|
|
55
|
+
cluster?: string
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type ListFilesStoragesResponse = {
|
|
59
|
+
items?: FilesStorage[]
|
|
60
|
+
page?: HydraCommonCommon.Pagination
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type GetFilesStorageRequest = {
|
|
64
|
+
name?: string
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type CreateFilesStorageRequest = {
|
|
68
|
+
cluster?: string
|
|
69
|
+
description?: string
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type UpdateFilesStorageRequest = {
|
|
73
|
+
name?: string
|
|
74
|
+
description?: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type DeleteFilesStorageRequest = {
|
|
78
|
+
name?: string
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type FileInfo = {
|
|
82
|
+
name?: string
|
|
83
|
+
isDir?: boolean
|
|
84
|
+
size?: string
|
|
85
|
+
modTime?: GoogleProtobufTimestamp.Timestamp
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type ListFilesRequest = {
|
|
89
|
+
name?: string
|
|
90
|
+
path?: string
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type ListFilesResponse = {
|
|
94
|
+
items?: FileInfo[]
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type CreateFolderRequest = {
|
|
98
|
+
name?: string
|
|
99
|
+
folderName?: string
|
|
100
|
+
path?: string
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type ListPrePullsRequest = {
|
|
104
|
+
storageName?: string
|
|
105
|
+
cluster?: string
|
|
106
|
+
page?: HydraCommonCommon.Pagination
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type ListPrePullsResponse = {
|
|
110
|
+
items?: HydraManagement_apiStorageV1alpha1Filesstorage.PrePull[]
|
|
111
|
+
page?: HydraCommonCommon.Pagination
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type CreatePrePullRequest = {
|
|
115
|
+
prepullName?: string
|
|
116
|
+
cluster?: string
|
|
117
|
+
path?: string
|
|
118
|
+
storageName?: string
|
|
119
|
+
description?: string
|
|
120
|
+
labels?: {[key: string]: string}
|
|
121
|
+
annotations?: {[key: string]: string}
|
|
122
|
+
source?: HydraManagement_apiStorageV1alpha1Filesstorage.DataSource
|
|
123
|
+
secretOptions?: HydraManagement_apiStorageV1alpha1Filesstorage.SecretOptions
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
type BaseUpdatePrePullRequest = {
|
|
128
|
+
cluster?: string
|
|
129
|
+
storageName?: string
|
|
130
|
+
prepullName?: string
|
|
131
|
+
description?: string
|
|
132
|
+
labels?: {[key: string]: string}
|
|
133
|
+
annotations?: {[key: string]: string}
|
|
134
|
+
secretOptions?: HydraManagement_apiStorageV1alpha1Filesstorage.SecretOptions
|
|
135
|
+
path?: string
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export type UpdatePrePullRequest = BaseUpdatePrePullRequest
|
|
139
|
+
& OneOf<{ git: HydraManagement_apiStorageV1alpha1Filesstorage.DataSourceOptionsGit; s3: HydraManagement_apiStorageV1alpha1Filesstorage.DataSourceOptionsS3; http: HydraManagement_apiStorageV1alpha1Filesstorage.DataSourceOptionsHttp; huggingFace: HydraManagement_apiStorageV1alpha1Filesstorage.DataSourceOptionsHuggingFace; modelScope: HydraManagement_apiStorageV1alpha1Filesstorage.DataSourceOptionsModelScope }>
|
|
140
|
+
|
|
141
|
+
export type DeletePrePullRequest = {
|
|
142
|
+
storageName?: string
|
|
143
|
+
prepullName?: string
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export type PrePullActionRequest = {
|
|
147
|
+
cluster?: string
|
|
148
|
+
storageName?: string
|
|
149
|
+
prepullName?: string
|
|
150
|
+
action?: PrePullActionRequestAction
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export type RestartPrePullRequest = {
|
|
154
|
+
storageName?: string
|
|
155
|
+
prepullName?: string
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export type ValidateDataSourceSecretsRequest = {
|
|
159
|
+
source?: HydraManagement_apiStorageV1alpha1Filesstorage.DataSource
|
|
160
|
+
secretOptions?: HydraManagement_apiStorageV1alpha1Filesstorage.SecretOptions
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type ValidateDataSourceSecretsResponse = {
|
|
164
|
+
valid?: boolean
|
|
165
|
+
message?: string
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export type ListDatasetEventsRequest = {
|
|
169
|
+
cluster?: string
|
|
170
|
+
storageName?: string
|
|
171
|
+
prepullName?: string
|
|
172
|
+
page?: HydraCommonCommon.Pagination
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export type SinglePrePullRequest = {
|
|
176
|
+
cluster?: string
|
|
177
|
+
storageName?: string
|
|
178
|
+
prepullName?: string
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export class AdminFilesStorageService {
|
|
182
|
+
static ListFilesStorages(req: ListFilesStoragesRequest, initReq?: fm.InitReq): Promise<ListFilesStoragesResponse> {
|
|
183
|
+
return fm.fetchReq<ListFilesStoragesRequest, ListFilesStoragesResponse>(`/apis/admin.hydra.io/v1alpha1/filesstorages?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
184
|
+
}
|
|
185
|
+
static GetFilesStorage(req: GetFilesStorageRequest, initReq?: fm.InitReq): Promise<FilesStorage> {
|
|
186
|
+
return fm.fetchReq<GetFilesStorageRequest, FilesStorage>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["name"]}?${fm.renderURLSearchParams(req, ["name"])}`, {...initReq, method: "GET"})
|
|
187
|
+
}
|
|
188
|
+
static CreateFilesStorage(req: CreateFilesStorageRequest, initReq?: fm.InitReq): Promise<FilesStorage> {
|
|
189
|
+
return fm.fetchReq<CreateFilesStorageRequest, FilesStorage>(`/apis/admin.hydra.io/v1alpha1/filesstorages`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
190
|
+
}
|
|
191
|
+
static UpdateFilesStorage(req: UpdateFilesStorageRequest, initReq?: fm.InitReq): Promise<FilesStorage> {
|
|
192
|
+
return fm.fetchReq<UpdateFilesStorageRequest, FilesStorage>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
193
|
+
}
|
|
194
|
+
static DeleteFilesStorage(req: DeleteFilesStorageRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
195
|
+
return fm.fetchReq<DeleteFilesStorageRequest, GoogleProtobufEmpty.Empty>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
196
|
+
}
|
|
197
|
+
static ListFiles(req: ListFilesRequest, initReq?: fm.InitReq): Promise<ListFilesResponse> {
|
|
198
|
+
return fm.fetchReq<ListFilesRequest, ListFilesResponse>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["name"]}/files?${fm.renderURLSearchParams(req, ["name"])}`, {...initReq, method: "GET"})
|
|
199
|
+
}
|
|
200
|
+
static CreateFolder(req: CreateFolderRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
201
|
+
return fm.fetchReq<CreateFolderRequest, GoogleProtobufEmpty.Empty>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["name"]}/folders/${req["folderName"]}`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
202
|
+
}
|
|
203
|
+
static ListPrePulls(req: ListPrePullsRequest, initReq?: fm.InitReq): Promise<ListPrePullsResponse> {
|
|
204
|
+
return fm.fetchReq<ListPrePullsRequest, ListPrePullsResponse>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["storageName"]}/prepulls?${fm.renderURLSearchParams(req, ["storageName"])}`, {...initReq, method: "GET"})
|
|
205
|
+
}
|
|
206
|
+
static CreatePrePull(req: CreatePrePullRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiStorageV1alpha1Filesstorage.PrePull> {
|
|
207
|
+
return fm.fetchReq<CreatePrePullRequest, HydraManagement_apiStorageV1alpha1Filesstorage.PrePull>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["storageName"]}/prepulls`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
208
|
+
}
|
|
209
|
+
static UpdatePrePull(req: UpdatePrePullRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiStorageV1alpha1Filesstorage.PrePull> {
|
|
210
|
+
return fm.fetchReq<UpdatePrePullRequest, HydraManagement_apiStorageV1alpha1Filesstorage.PrePull>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
211
|
+
}
|
|
212
|
+
static DeletePrePull(req: DeletePrePullRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
213
|
+
return fm.fetchReq<DeletePrePullRequest, GoogleProtobufEmpty.Empty>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}`, {...initReq, method: "DELETE"})
|
|
214
|
+
}
|
|
215
|
+
static DatasetDoAction(req: PrePullActionRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiStorageV1alpha1Filesstorage.PrePull> {
|
|
216
|
+
return fm.fetchReq<PrePullActionRequest, HydraManagement_apiStorageV1alpha1Filesstorage.PrePull>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
217
|
+
}
|
|
218
|
+
static ListPrePullEvents(req: ListDatasetEventsRequest, initReq?: fm.InitReq): Promise<EventV1alpha1Event.ListEventsResponse> {
|
|
219
|
+
return fm.fetchReq<ListDatasetEventsRequest, EventV1alpha1Event.ListEventsResponse>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}/events?${fm.renderURLSearchParams(req, ["storageName", "prepullName"])}`, {...initReq, method: "GET"})
|
|
220
|
+
}
|
|
221
|
+
static GetPrePullSyncProcess(req: SinglePrePullRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiStorageV1alpha1Filesstorage.PrePullSyncProcess> {
|
|
222
|
+
return fm.fetchReq<SinglePrePullRequest, HydraManagement_apiStorageV1alpha1Filesstorage.PrePullSyncProcess>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}/sync-process?${fm.renderURLSearchParams(req, ["storageName", "prepullName"])}`, {...initReq, method: "GET"})
|
|
223
|
+
}
|
|
224
|
+
static ValidateDataSourceSecrets(req: ValidateDataSourceSecretsRequest, initReq?: fm.InitReq): Promise<ValidateDataSourceSecretsResponse> {
|
|
225
|
+
return fm.fetchReq<ValidateDataSourceSecretsRequest, ValidateDataSourceSecretsResponse>(`/apis/admin.hydra.io/v1alpha1/filesstorages/validate-secrets`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
226
|
+
}
|
|
227
|
+
static GetPodInstanceList(req: HydraManagement_apiStorageV1alpha1Filesstorage.PodRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiStorageV1alpha1Filesstorage.PodInstanceListResponse> {
|
|
228
|
+
return fm.fetchReq<HydraManagement_apiStorageV1alpha1Filesstorage.PodRequest, HydraManagement_apiStorageV1alpha1Filesstorage.PodInstanceListResponse>(`/apis/admin.hydra.io/v1alpha1/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}/pods?${fm.renderURLSearchParams(req, ["storageName", "prepullName"])}`, {...initReq, method: "GET"})
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
9
|
+
|
|
10
|
+
export enum EventObjKind {
|
|
11
|
+
KIND_UNSPECIFIED = "KIND_UNSPECIFIED",
|
|
12
|
+
DATASET = "DATASET",
|
|
13
|
+
POD = "POD",
|
|
14
|
+
UNKNOWN = "UNKNOWN",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum EventType {
|
|
18
|
+
TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
|
|
19
|
+
NORMAL = "NORMAL",
|
|
20
|
+
WARNING = "WARNING",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type Event = {
|
|
24
|
+
objKind?: EventObjKind
|
|
25
|
+
objName?: string
|
|
26
|
+
objNamespace?: string
|
|
27
|
+
type?: EventType
|
|
28
|
+
message?: string
|
|
29
|
+
reason?: string
|
|
30
|
+
firstTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
31
|
+
lastTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
32
|
+
count?: number
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ListEventsResponse = {
|
|
36
|
+
items?: Event[]
|
|
37
|
+
page?: HydraCommonCommon.Pagination
|
|
38
|
+
}
|
|
@@ -0,0 +1,404 @@
|
|
|
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 EventV1alpha1Event from "../../event/v1alpha1/event.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 DataSourceType {
|
|
23
|
+
DATA_SOURCE_TYPE_UNSPECIFIED = "DATA_SOURCE_TYPE_UNSPECIFIED",
|
|
24
|
+
GIT = "GIT",
|
|
25
|
+
S3 = "S3",
|
|
26
|
+
HTTP = "HTTP",
|
|
27
|
+
HUGGING_FACE = "HUGGING_FACE",
|
|
28
|
+
MODEL_SCOPE = "MODEL_SCOPE",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export enum SecretOptionsAuthType {
|
|
32
|
+
AUTH_TYPE_UNSPECIFIED = "AUTH_TYPE_UNSPECIFIED",
|
|
33
|
+
BASIC = "BASIC",
|
|
34
|
+
SSH = "SSH",
|
|
35
|
+
TOKEN = "TOKEN",
|
|
36
|
+
AK_SK = "AK_SK",
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export enum DataSourceOptionsSyncMode {
|
|
40
|
+
SYNC_MODE_UNSPECIFIED = "SYNC_MODE_UNSPECIFIED",
|
|
41
|
+
copy = "copy",
|
|
42
|
+
sync = "sync",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export enum DataSourceOptionsS3Provider {
|
|
46
|
+
PROVIDER_UNSPECIFIED = "PROVIDER_UNSPECIFIED",
|
|
47
|
+
AWS = "AWS",
|
|
48
|
+
MINIO = "MINIO",
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export enum DatasetStatusPhase {
|
|
52
|
+
DATA_SET_PHASE_UNSPECIFIED = "DATA_SET_PHASE_UNSPECIFIED",
|
|
53
|
+
PENDING = "PENDING",
|
|
54
|
+
READY = "READY",
|
|
55
|
+
PROCESSING = "PROCESSING",
|
|
56
|
+
FAILED = "FAILED",
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export enum PrePullActionRequestAction {
|
|
60
|
+
ACTION_UNSPECIFIED = "ACTION_UNSPECIFIED",
|
|
61
|
+
RERUN = "RERUN",
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type FilesStorageStatus = {
|
|
65
|
+
phase?: string
|
|
66
|
+
reason?: string
|
|
67
|
+
pvcName?: string
|
|
68
|
+
pvcNamespace?: string
|
|
69
|
+
storageServer?: StorageServerStatus
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type FilesStorage = {
|
|
73
|
+
name?: string
|
|
74
|
+
cluster?: string
|
|
75
|
+
pvcNamespace?: string
|
|
76
|
+
storageClassName?: string
|
|
77
|
+
capacity?: string
|
|
78
|
+
status?: FilesStorageStatus
|
|
79
|
+
createTime?: GoogleProtobufTimestamp.Timestamp
|
|
80
|
+
workspace?: number
|
|
81
|
+
description?: string
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type StorageServerStatus = {
|
|
85
|
+
phase?: string
|
|
86
|
+
name?: string
|
|
87
|
+
namespace?: string
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type ListFilesStoragesRequest = {
|
|
91
|
+
workspace?: number
|
|
92
|
+
page?: HydraCommonCommon.Pagination
|
|
93
|
+
cluster?: string
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type ListFilesStoragesResponse = {
|
|
97
|
+
items?: FilesStorage[]
|
|
98
|
+
page?: HydraCommonCommon.Pagination
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type GetFilesStorageRequest = {
|
|
102
|
+
workspace?: number
|
|
103
|
+
name?: string
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type CreateFilesStorageRequest = {
|
|
107
|
+
workspace?: number
|
|
108
|
+
cluster?: string
|
|
109
|
+
description?: string
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type UpdateFilesStorageRequest = {
|
|
113
|
+
workspace?: number
|
|
114
|
+
name?: string
|
|
115
|
+
description?: string
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type DeleteFilesStorageRequest = {
|
|
119
|
+
workspace?: number
|
|
120
|
+
name?: string
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type FileInfo = {
|
|
124
|
+
name?: string
|
|
125
|
+
isDir?: boolean
|
|
126
|
+
size?: string
|
|
127
|
+
modTime?: GoogleProtobufTimestamp.Timestamp
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export type ListFilesRequest = {
|
|
131
|
+
workspace?: number
|
|
132
|
+
name?: string
|
|
133
|
+
path?: string
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type ListFilesResponse = {
|
|
137
|
+
items?: FileInfo[]
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export type CreateFolderRequest = {
|
|
141
|
+
workspace?: number
|
|
142
|
+
name?: string
|
|
143
|
+
folderName?: string
|
|
144
|
+
path?: string
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type DataSource = {
|
|
148
|
+
type?: DataSourceType
|
|
149
|
+
uri?: string
|
|
150
|
+
options?: DataSourceOptions
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export type SecretOptionsBasicAuth = {
|
|
154
|
+
username?: string
|
|
155
|
+
password?: string
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export type SecretOptionsSSHAuth = {
|
|
159
|
+
privateKey?: string
|
|
160
|
+
passphrase?: string
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type SecretOptionsTokenAuth = {
|
|
164
|
+
token?: string
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export type SecretOptionsAkSkAuth = {
|
|
168
|
+
accessKey?: string
|
|
169
|
+
secretKey?: string
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
/* hydra modified */ export type BaseSecretOptions = {
|
|
174
|
+
authType?: SecretOptionsAuthType
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export type SecretOptions = BaseSecretOptions
|
|
178
|
+
& OneOf<{ basic: SecretOptionsBasicAuth; ssh: SecretOptionsSSHAuth; token: SecretOptionsTokenAuth; akSk: SecretOptionsAkSkAuth }>
|
|
179
|
+
|
|
180
|
+
export type DataSourceOptionsGit = {
|
|
181
|
+
branch?: string
|
|
182
|
+
commit?: string
|
|
183
|
+
depth?: number
|
|
184
|
+
submodules?: boolean
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export type DataSourceOptionsS3 = {
|
|
188
|
+
region?: string
|
|
189
|
+
endpoint?: string
|
|
190
|
+
provider?: DataSourceOptionsS3Provider
|
|
191
|
+
syncMode?: DataSourceOptionsSyncMode
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export type DataSourceOptionsHttp = {
|
|
195
|
+
headers?: {[key: string]: string}
|
|
196
|
+
syncMode?: DataSourceOptionsSyncMode
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
/* hydra modified */ export type BaseDataSourceOptions = {
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export type DataSourceOptions = BaseDataSourceOptions
|
|
204
|
+
& OneOf<{ git: DataSourceOptionsGit; s3: DataSourceOptionsS3; http: DataSourceOptionsHttp; huggingFace: DataSourceOptionsHuggingFace; modelScope: DataSourceOptionsModelScope }>
|
|
205
|
+
|
|
206
|
+
export type DataSourceOptionsHuggingFace = {
|
|
207
|
+
endpoint?: string
|
|
208
|
+
include?: string
|
|
209
|
+
exclude?: string
|
|
210
|
+
revision?: string
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export type DataSourceOptionsModelScope = {
|
|
214
|
+
include?: string
|
|
215
|
+
exclude?: string
|
|
216
|
+
revision?: string
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export type DatasetStatus = {
|
|
220
|
+
phase?: DatasetStatusPhase
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export type PrePull = {
|
|
224
|
+
name?: string
|
|
225
|
+
cluster?: string
|
|
226
|
+
namespace?: string
|
|
227
|
+
path?: string
|
|
228
|
+
storageName?: string
|
|
229
|
+
description?: string
|
|
230
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
231
|
+
labels?: {[key: string]: string}
|
|
232
|
+
annotations?: {[key: string]: string}
|
|
233
|
+
source?: DataSource
|
|
234
|
+
status?: DatasetStatus
|
|
235
|
+
lastSync?: GoogleProtobufTimestamp.Timestamp
|
|
236
|
+
secretRef?: string
|
|
237
|
+
workspace?: number
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export type ListPrePullsRequest = {
|
|
241
|
+
storageName?: string
|
|
242
|
+
workspace?: number
|
|
243
|
+
cluster?: string
|
|
244
|
+
page?: HydraCommonCommon.Pagination
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export type ListPrePullsResponse = {
|
|
248
|
+
items?: PrePull[]
|
|
249
|
+
page?: HydraCommonCommon.Pagination
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export type CreatePrePullRequest = {
|
|
253
|
+
prepullName?: string
|
|
254
|
+
cluster?: string
|
|
255
|
+
path?: string
|
|
256
|
+
storageName?: string
|
|
257
|
+
description?: string
|
|
258
|
+
labels?: {[key: string]: string}
|
|
259
|
+
annotations?: {[key: string]: string}
|
|
260
|
+
source?: DataSource
|
|
261
|
+
secretOptions?: SecretOptions
|
|
262
|
+
workspace?: number
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
/* hydra modified */ export type BaseUpdatePrePullRequest = {
|
|
267
|
+
cluster?: string
|
|
268
|
+
storageName?: string
|
|
269
|
+
prepullName?: string
|
|
270
|
+
description?: string
|
|
271
|
+
labels?: {[key: string]: string}
|
|
272
|
+
annotations?: {[key: string]: string}
|
|
273
|
+
secretOptions?: SecretOptions
|
|
274
|
+
workspace?: number
|
|
275
|
+
path?: string
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export type UpdatePrePullRequest = BaseUpdatePrePullRequest
|
|
279
|
+
& OneOf<{ git: DataSourceOptionsGit; s3: DataSourceOptionsS3; http: DataSourceOptionsHttp; huggingFace: DataSourceOptionsHuggingFace; modelScope: DataSourceOptionsModelScope }>
|
|
280
|
+
|
|
281
|
+
export type DeletePrePullRequest = {
|
|
282
|
+
storageName?: string
|
|
283
|
+
prepullName?: string
|
|
284
|
+
workspace?: number
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export type PrePullActionRequest = {
|
|
288
|
+
cluster?: string
|
|
289
|
+
storageName?: string
|
|
290
|
+
prepullName?: string
|
|
291
|
+
action?: PrePullActionRequestAction
|
|
292
|
+
workspace?: number
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export type ValidateDataSourceSecretsRequest = {
|
|
296
|
+
source?: DataSource
|
|
297
|
+
secretOptions?: SecretOptions
|
|
298
|
+
workspace?: number
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export type ValidateDataSourceSecretsResponse = {
|
|
302
|
+
valid?: boolean
|
|
303
|
+
message?: string
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export type ListDatasetEventsRequest = {
|
|
307
|
+
cluster?: string
|
|
308
|
+
storageName?: string
|
|
309
|
+
prepullName?: string
|
|
310
|
+
page?: HydraCommonCommon.Pagination
|
|
311
|
+
workspace?: number
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export type SinglePrePullRequest = {
|
|
315
|
+
cluster?: string
|
|
316
|
+
storageName?: string
|
|
317
|
+
prepullName?: string
|
|
318
|
+
workspace?: number
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export type PrePullSyncProcess = {
|
|
322
|
+
status?: DatasetStatus
|
|
323
|
+
syncProcess?: number
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export type PodRequest = {
|
|
327
|
+
workspace?: number
|
|
328
|
+
storageName?: string
|
|
329
|
+
prepullName?: string
|
|
330
|
+
page?: HydraCommonCommon.Pagination
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export type PodInstance = {
|
|
334
|
+
cluster?: string
|
|
335
|
+
namespace?: string
|
|
336
|
+
name?: string
|
|
337
|
+
phase?: string
|
|
338
|
+
containerReadyCount?: number
|
|
339
|
+
containerTotalCount?: number
|
|
340
|
+
podIp?: string
|
|
341
|
+
nodeName?: string
|
|
342
|
+
containers?: Container[]
|
|
343
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export type Container = {
|
|
347
|
+
name?: string
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export type PodInstanceListResponse = {
|
|
351
|
+
items?: PodInstance[]
|
|
352
|
+
page?: HydraCommonCommon.Pagination
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export class WSFilesStorageService {
|
|
356
|
+
static ListWSFilesStorages(req: ListFilesStoragesRequest, initReq?: fm.InitReq): Promise<ListFilesStoragesResponse> {
|
|
357
|
+
return fm.fetchReq<ListFilesStoragesRequest, ListFilesStoragesResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
358
|
+
}
|
|
359
|
+
static GetWSFilesStorage(req: GetFilesStorageRequest, initReq?: fm.InitReq): Promise<FilesStorage> {
|
|
360
|
+
return fm.fetchReq<GetFilesStorageRequest, FilesStorage>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "name"])}`, {...initReq, method: "GET"})
|
|
361
|
+
}
|
|
362
|
+
static CreateWSFilesStorage(req: CreateFilesStorageRequest, initReq?: fm.InitReq): Promise<FilesStorage> {
|
|
363
|
+
return fm.fetchReq<CreateFilesStorageRequest, FilesStorage>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
364
|
+
}
|
|
365
|
+
static UpdateWSFilesStorage(req: UpdateFilesStorageRequest, initReq?: fm.InitReq): Promise<FilesStorage> {
|
|
366
|
+
return fm.fetchReq<UpdateFilesStorageRequest, FilesStorage>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
367
|
+
}
|
|
368
|
+
static DeleteWSFilesStorage(req: DeleteFilesStorageRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
369
|
+
return fm.fetchReq<DeleteFilesStorageRequest, GoogleProtobufEmpty.Empty>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
370
|
+
}
|
|
371
|
+
static ListWSFiles(req: ListFilesRequest, initReq?: fm.InitReq): Promise<ListFilesResponse> {
|
|
372
|
+
return fm.fetchReq<ListFilesRequest, ListFilesResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["name"]}/files?${fm.renderURLSearchParams(req, ["workspace", "name"])}`, {...initReq, method: "GET"})
|
|
373
|
+
}
|
|
374
|
+
static CreateWSFolder(req: CreateFolderRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
375
|
+
return fm.fetchReq<CreateFolderRequest, GoogleProtobufEmpty.Empty>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["name"]}/folders/${req["folderName"]}`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
376
|
+
}
|
|
377
|
+
static WSListPrePulls(req: ListPrePullsRequest, initReq?: fm.InitReq): Promise<ListPrePullsResponse> {
|
|
378
|
+
return fm.fetchReq<ListPrePullsRequest, ListPrePullsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["storageName"]}/prepulls?${fm.renderURLSearchParams(req, ["workspace", "storageName"])}`, {...initReq, method: "GET"})
|
|
379
|
+
}
|
|
380
|
+
static WSCreatePrePull(req: CreatePrePullRequest, initReq?: fm.InitReq): Promise<PrePull> {
|
|
381
|
+
return fm.fetchReq<CreatePrePullRequest, PrePull>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["storageName"]}/prepulls`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
382
|
+
}
|
|
383
|
+
static WSUpdatePrePull(req: UpdatePrePullRequest, initReq?: fm.InitReq): Promise<PrePull> {
|
|
384
|
+
return fm.fetchReq<UpdatePrePullRequest, PrePull>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
385
|
+
}
|
|
386
|
+
static WSDeletePrePull(req: DeletePrePullRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
387
|
+
return fm.fetchReq<DeletePrePullRequest, GoogleProtobufEmpty.Empty>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}`, {...initReq, method: "DELETE"})
|
|
388
|
+
}
|
|
389
|
+
static WSDatasetDoAction(req: PrePullActionRequest, initReq?: fm.InitReq): Promise<PrePull> {
|
|
390
|
+
return fm.fetchReq<PrePullActionRequest, PrePull>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
391
|
+
}
|
|
392
|
+
static WSListPrePullEvents(req: ListDatasetEventsRequest, initReq?: fm.InitReq): Promise<EventV1alpha1Event.ListEventsResponse> {
|
|
393
|
+
return fm.fetchReq<ListDatasetEventsRequest, EventV1alpha1Event.ListEventsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}/events?${fm.renderURLSearchParams(req, ["workspace", "storageName", "prepullName"])}`, {...initReq, method: "GET"})
|
|
394
|
+
}
|
|
395
|
+
static WSGetPrePullSyncProcess(req: SinglePrePullRequest, initReq?: fm.InitReq): Promise<PrePullSyncProcess> {
|
|
396
|
+
return fm.fetchReq<SinglePrePullRequest, PrePullSyncProcess>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}/sync-process?${fm.renderURLSearchParams(req, ["workspace", "storageName", "prepullName"])}`, {...initReq, method: "GET"})
|
|
397
|
+
}
|
|
398
|
+
static WSValidateDataSourceSecrets(req: ValidateDataSourceSecretsRequest, initReq?: fm.InitReq): Promise<ValidateDataSourceSecretsResponse> {
|
|
399
|
+
return fm.fetchReq<ValidateDataSourceSecretsRequest, ValidateDataSourceSecretsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/validate-secrets`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
400
|
+
}
|
|
401
|
+
static WSGetPodInstanceList(req: PodRequest, initReq?: fm.InitReq): Promise<PodInstanceListResponse> {
|
|
402
|
+
return fm.fetchReq<PodRequest, PodInstanceListResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/filesstorages/${req["storageName"]}/prepulls/${req["prepullName"]}/pods?${fm.renderURLSearchParams(req, ["workspace", "storageName", "prepullName"])}`, {...initReq, method: "GET"})
|
|
403
|
+
}
|
|
404
|
+
}
|