@daocloud-proto/hydra 0.2.0 → 0.5.0
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.
- package/common/common.pb.ts +8 -1
- package/common/errorcode.ts +3 -0
- package/management-api/agent/v1alpha1/event.pb.ts +16 -0
- package/management-api/apikey/v1alpha1/apikey.pb.ts +77 -0
- package/management-api/core/v1alpha1/permissions.pb.ts +30 -0
- package/management-api/model/v1alpha1/model.pb.ts +59 -0
- package/management-api/model_serving/v1alpha1/model_serving.pb.ts +92 -0
- package/management-api/workspace/v1alpha1/workspace.pb.ts +74 -0
- package/package.json +1 -1
package/common/common.pb.ts
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
/*
|
|
4
4
|
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
5
|
*/
|
|
6
|
+
|
|
7
|
+
export enum Mode {
|
|
8
|
+
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
9
|
+
CSP = "CSP",
|
|
10
|
+
WS = "WS",
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
export type NoParamsQuery = {
|
|
7
14
|
}
|
|
8
15
|
|
|
@@ -34,7 +41,7 @@ export type AuthResourceAction = {
|
|
|
34
41
|
|
|
35
42
|
export type Auth = {
|
|
36
43
|
skipAuth?: boolean
|
|
37
|
-
|
|
44
|
+
user?: AuthResourceAction
|
|
38
45
|
operator?: AuthResourceAction
|
|
39
46
|
}
|
|
40
47
|
|
package/common/errorcode.ts
CHANGED
|
@@ -21,6 +21,9 @@ export enum ErrorCode {
|
|
|
21
21
|
// EN: request params error: %v
|
|
22
22
|
// ZH: 请求参数错误:%v
|
|
23
23
|
SYSTEM_PARAMS_ERROR = "SYSTEM-PARAMS_ERROR",
|
|
24
|
+
// EN: Request mode not match
|
|
25
|
+
// ZH: 请求模式不匹配。
|
|
26
|
+
SYSTEM_REQUEST_MODE_ERROR = "SYSTEM-REQUEST_MODE_ERROR",
|
|
24
27
|
// EN: Requested resource conflicted error: %v
|
|
25
28
|
// ZH: 请求的资源冲突错误:%v
|
|
26
29
|
USER_CONFLICT_ERROR = "USER-CONFLICT_ERROR",
|
|
@@ -17,6 +17,11 @@ export enum APIKeyEventType {
|
|
|
17
17
|
UPDATE = "UPDATE",
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export enum UsageReportRequestMode {
|
|
21
|
+
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
22
|
+
MODE_PER_REQUEST = "MODE_PER_REQUEST",
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
export type FetchAPIKeyRequest = {
|
|
21
26
|
key?: string
|
|
22
27
|
}
|
|
@@ -27,9 +32,19 @@ export type APIKeyEvent = {
|
|
|
27
32
|
type?: APIKeyEventType
|
|
28
33
|
}
|
|
29
34
|
|
|
35
|
+
export type UsageReportRequestUsageImage = {
|
|
36
|
+
width?: string
|
|
37
|
+
height?: string
|
|
38
|
+
numbers?: string
|
|
39
|
+
quality?: string
|
|
40
|
+
style?: string
|
|
41
|
+
}
|
|
42
|
+
|
|
30
43
|
export type UsageReportRequestUsage = {
|
|
31
44
|
inputTokens?: string
|
|
32
45
|
outputTokens?: string
|
|
46
|
+
inputImages?: UsageReportRequestUsageImage
|
|
47
|
+
outputImages?: UsageReportRequestUsageImage
|
|
33
48
|
requests?: number
|
|
34
49
|
}
|
|
35
50
|
|
|
@@ -40,6 +55,7 @@ export type UsageReportRequest = {
|
|
|
40
55
|
usage?: UsageReportRequestUsage
|
|
41
56
|
firstRequestTime?: GoogleProtobufTimestamp.Timestamp
|
|
42
57
|
lastRequestTime?: GoogleProtobufTimestamp.Timestamp
|
|
58
|
+
mode?: UsageReportRequestMode
|
|
43
59
|
}
|
|
44
60
|
|
|
45
61
|
export type UsageReportResponse = {
|
|
@@ -7,6 +7,20 @@
|
|
|
7
7
|
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
8
|
import * as fm from "../../../fetch.pb"
|
|
9
9
|
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
10
|
+
|
|
11
|
+
export enum TimePeriod {
|
|
12
|
+
TIME_PERIOD_UNSPECIFIED = "TIME_PERIOD_UNSPECIFIED",
|
|
13
|
+
TIME_PERIOD_HOUR = "TIME_PERIOD_HOUR",
|
|
14
|
+
TIME_PERIOD_DAY = "TIME_PERIOD_DAY",
|
|
15
|
+
TIME_PERIOD_WEEK = "TIME_PERIOD_WEEK",
|
|
16
|
+
TIME_PERIOD_MONTH = "TIME_PERIOD_MONTH",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type CreateWSAPIKeyRequest = {
|
|
20
|
+
name?: string
|
|
21
|
+
workspace?: number
|
|
22
|
+
}
|
|
23
|
+
|
|
10
24
|
export type CreateAPIKeyRequest = {
|
|
11
25
|
name?: string
|
|
12
26
|
}
|
|
@@ -19,6 +33,13 @@ export type APIKey = {
|
|
|
19
33
|
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
20
34
|
name?: string
|
|
21
35
|
denyModels?: string[]
|
|
36
|
+
workspace?: number
|
|
37
|
+
createBy?: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type ListWSAPIKeyRequest = {
|
|
41
|
+
workspace?: number
|
|
42
|
+
page?: HydraCommonCommon.Pagination
|
|
22
43
|
}
|
|
23
44
|
|
|
24
45
|
export type ListAPIKeyRequest = {
|
|
@@ -30,10 +51,49 @@ export type ListAPIKeyResponse = {
|
|
|
30
51
|
page?: HydraCommonCommon.Pagination
|
|
31
52
|
}
|
|
32
53
|
|
|
54
|
+
export type DeleteWSAPIKeyRequest = {
|
|
55
|
+
id?: string
|
|
56
|
+
workspace?: number
|
|
57
|
+
}
|
|
58
|
+
|
|
33
59
|
export type DeleteAPIKeyRequest = {
|
|
34
60
|
id?: string
|
|
35
61
|
}
|
|
36
62
|
|
|
63
|
+
export type WSAPIKeyUsageStatisticsRequest = {
|
|
64
|
+
startTime?: GoogleProtobufTimestamp.Timestamp
|
|
65
|
+
endTime?: GoogleProtobufTimestamp.Timestamp
|
|
66
|
+
ids?: string[]
|
|
67
|
+
models?: string[]
|
|
68
|
+
period?: TimePeriod
|
|
69
|
+
workspace?: number
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type APIKeyUsageStatisticsRequest = {
|
|
73
|
+
startTime?: GoogleProtobufTimestamp.Timestamp
|
|
74
|
+
endTime?: GoogleProtobufTimestamp.Timestamp
|
|
75
|
+
ids?: string[]
|
|
76
|
+
models?: string[]
|
|
77
|
+
period?: TimePeriod
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type APIKeyUsageStatisticsResponse = {
|
|
81
|
+
dataPoints?: DataPoint[]
|
|
82
|
+
totalUsage?: Usage
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type Usage = {
|
|
86
|
+
total?: string
|
|
87
|
+
input?: string
|
|
88
|
+
output?: string
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type DataPoint = {
|
|
92
|
+
timestamp?: GoogleProtobufTimestamp.Timestamp
|
|
93
|
+
usage?: Usage
|
|
94
|
+
model?: string
|
|
95
|
+
}
|
|
96
|
+
|
|
37
97
|
export class APIKeyManagement {
|
|
38
98
|
static CreateAPIKey(req: CreateAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
39
99
|
return fm.fetchReq<CreateAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/apikeys`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
@@ -44,4 +104,21 @@ export class APIKeyManagement {
|
|
|
44
104
|
static DeleteAPIKey(req: DeleteAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
45
105
|
return fm.fetchReq<DeleteAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/apikeys/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
|
|
46
106
|
}
|
|
107
|
+
static GetAPIKeyUsageStatistics(req: APIKeyUsageStatisticsRequest, initReq?: fm.InitReq): Promise<APIKeyUsageStatisticsResponse> {
|
|
108
|
+
return fm.fetchReq<APIKeyUsageStatisticsRequest, APIKeyUsageStatisticsResponse>(`/apis/hydra.io/v1alpha1/apikeys-stats?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export class WSAPIKeyManagement {
|
|
112
|
+
static CreateWSAPIKey(req: CreateWSAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
113
|
+
return fm.fetchReq<CreateWSAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
114
|
+
}
|
|
115
|
+
static ListWSAPIKey(req: ListWSAPIKeyRequest, initReq?: fm.InitReq): Promise<ListAPIKeyResponse> {
|
|
116
|
+
return fm.fetchReq<ListWSAPIKeyRequest, ListAPIKeyResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
117
|
+
}
|
|
118
|
+
static DeleteWSAPIKey(req: DeleteWSAPIKeyRequest, initReq?: fm.InitReq): Promise<APIKey> {
|
|
119
|
+
return fm.fetchReq<DeleteWSAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
|
|
120
|
+
}
|
|
121
|
+
static GetAPIKeyUsageStatistics(req: WSAPIKeyUsageStatisticsRequest, initReq?: fm.InitReq): Promise<APIKeyUsageStatisticsResponse> {
|
|
122
|
+
return fm.fetchReq<WSAPIKeyUsageStatisticsRequest, APIKeyUsageStatisticsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys-stats?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
123
|
+
}
|
|
47
124
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 fm from "../../../fetch.pb"
|
|
8
|
+
export type ListRolePermissionsByWorkspaceForCurrentUserRequest = {
|
|
9
|
+
workspace?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type ListRolePermissionsByWorkspaceForCurrentUserResponse = {
|
|
13
|
+
permissions?: string[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type ListPlatformRolePermissionsForCurrentUserRequest = {
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type ListPlatformRolePermissionsForCurrentUserResponse = {
|
|
20
|
+
permissions?: string[]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class Core {
|
|
24
|
+
static ListRolePermissionsByWorkspaceForCurrentUser(req: ListRolePermissionsByWorkspaceForCurrentUserRequest, initReq?: fm.InitReq): Promise<ListRolePermissionsByWorkspaceForCurrentUserResponse> {
|
|
25
|
+
return fm.fetchReq<ListRolePermissionsByWorkspaceForCurrentUserRequest, ListRolePermissionsByWorkspaceForCurrentUserResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/permissions?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
26
|
+
}
|
|
27
|
+
static ListPlatformRolePermissionsForCurrentUser(req: ListPlatformRolePermissionsForCurrentUserRequest, initReq?: fm.InitReq): Promise<ListPlatformRolePermissionsForCurrentUserResponse> {
|
|
28
|
+
return fm.fetchReq<ListPlatformRolePermissionsForCurrentUserRequest, ListPlatformRolePermissionsForCurrentUserResponse>(`/apis/hydra.io/v1alpha1/permissions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -22,9 +22,16 @@ export enum ModelSupportFeature {
|
|
|
22
22
|
AUDIO_TO_TEXT = "AUDIO_TO_TEXT",
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export enum PublicModelConfigRateLimitLimitedBy {
|
|
26
|
+
LIMITED_BY_UNSPECIFIED = "LIMITED_BY_UNSPECIFIED",
|
|
27
|
+
USER_ID = "USER_ID",
|
|
28
|
+
API_KEY = "API_KEY",
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
export type ModelPrice = {
|
|
26
32
|
inputPerKTokens?: string
|
|
27
33
|
outputPerKTokens?: string
|
|
34
|
+
perImage?: string
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
export type Model = {
|
|
@@ -43,6 +50,7 @@ export type Model = {
|
|
|
43
50
|
publicAccessModelName?: string
|
|
44
51
|
publicModelPrice?: ModelPrice
|
|
45
52
|
readme?: HydraCommonCommon.I18nName
|
|
53
|
+
publicModelConfig?: PublicModelConfig
|
|
46
54
|
}
|
|
47
55
|
|
|
48
56
|
export type ListModelRequest = {
|
|
@@ -59,6 +67,49 @@ export type SingleModelRequest = {
|
|
|
59
67
|
modelId?: string
|
|
60
68
|
}
|
|
61
69
|
|
|
70
|
+
export type PublicModelConfigRateLimit = {
|
|
71
|
+
limitedBy?: PublicModelConfigRateLimitLimitedBy
|
|
72
|
+
limit?: string
|
|
73
|
+
duration?: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type PublicModelConfig = {
|
|
77
|
+
rateLimit?: PublicModelConfigRateLimit
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type ListWSModelRequest = {
|
|
81
|
+
workspace?: number
|
|
82
|
+
page?: HydraCommonCommon.Pagination
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type ListWSModelResponse = {
|
|
86
|
+
items?: WSModel[]
|
|
87
|
+
page?: HydraCommonCommon.Pagination
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type SingleWSModelRequest = {
|
|
91
|
+
workspace?: number
|
|
92
|
+
modelId?: string
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type WSModel = {
|
|
96
|
+
modelId?: string
|
|
97
|
+
modelAvatar?: string
|
|
98
|
+
modelName?: string
|
|
99
|
+
providerId?: string
|
|
100
|
+
providerName?: HydraCommonCommon.I18nName
|
|
101
|
+
modelDescription?: HydraCommonCommon.I18nName
|
|
102
|
+
finetune?: boolean
|
|
103
|
+
modelSupportFeature?: ModelSupportFeature[]
|
|
104
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
105
|
+
updateTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
106
|
+
publicEndpointEnabled?: boolean
|
|
107
|
+
publicEndpointBaseUrl?: string
|
|
108
|
+
publicAccessModelName?: string
|
|
109
|
+
readme?: HydraCommonCommon.I18nName
|
|
110
|
+
publicModelConfig?: PublicModelConfig
|
|
111
|
+
}
|
|
112
|
+
|
|
62
113
|
export class ModelManagement {
|
|
63
114
|
static GetModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
|
|
64
115
|
return fm.fetchReq<SingleModelRequest, Model>(`/apis/hydra.io/v1alpha1/models/${req["modelId"]}?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
|
|
@@ -66,4 +117,12 @@ export class ModelManagement {
|
|
|
66
117
|
static ListModels(req: ListModelRequest, initReq?: fm.InitReq): Promise<ListModelResponse> {
|
|
67
118
|
return fm.fetchReq<ListModelRequest, ListModelResponse>(`/apis/hydra.io/v1alpha1/models?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
68
119
|
}
|
|
120
|
+
}
|
|
121
|
+
export class WSModelManagement {
|
|
122
|
+
static GetWSModel(req: SingleWSModelRequest, initReq?: fm.InitReq): Promise<WSModel> {
|
|
123
|
+
return fm.fetchReq<SingleWSModelRequest, WSModel>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/models/${req["modelId"]}?${fm.renderURLSearchParams(req, ["workspace", "modelId"])}`, {...initReq, method: "GET"})
|
|
124
|
+
}
|
|
125
|
+
static ListWSModels(req: ListWSModelRequest, initReq?: fm.InitReq): Promise<ListWSModelResponse> {
|
|
126
|
+
return fm.fetchReq<ListWSModelRequest, ListWSModelResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/models?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
127
|
+
}
|
|
69
128
|
}
|
|
@@ -29,6 +29,11 @@ export enum ModelServingActionRequestAction {
|
|
|
29
29
|
START = "START",
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
export enum WSModelServingActionRequestAction {
|
|
33
|
+
MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
|
|
34
|
+
START = "START",
|
|
35
|
+
}
|
|
36
|
+
|
|
32
37
|
export type CreateModelServingRequest = {
|
|
33
38
|
name?: string
|
|
34
39
|
modelId?: string
|
|
@@ -38,6 +43,15 @@ export type CreateModelServingRequest = {
|
|
|
38
43
|
paymentMethods?: PaymentMethod
|
|
39
44
|
}
|
|
40
45
|
|
|
46
|
+
export type CreateWSModelServingRequest = {
|
|
47
|
+
name?: string
|
|
48
|
+
modelId?: string
|
|
49
|
+
workspace?: number
|
|
50
|
+
cluster?: string
|
|
51
|
+
namespace?: string
|
|
52
|
+
replicas?: number
|
|
53
|
+
}
|
|
54
|
+
|
|
41
55
|
export type ModelServing = {
|
|
42
56
|
id?: string
|
|
43
57
|
name?: string
|
|
@@ -60,6 +74,22 @@ export type ModelServing = {
|
|
|
60
74
|
modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
|
|
61
75
|
}
|
|
62
76
|
|
|
77
|
+
export type WSModelServing = {
|
|
78
|
+
id?: string
|
|
79
|
+
name?: string
|
|
80
|
+
modelId?: string
|
|
81
|
+
modelName?: string
|
|
82
|
+
cluster?: string
|
|
83
|
+
replicas?: number
|
|
84
|
+
status?: ModelServingStatus
|
|
85
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
86
|
+
accessModelName?: string
|
|
87
|
+
namespace?: string
|
|
88
|
+
address?: string
|
|
89
|
+
modelAvatar?: string
|
|
90
|
+
modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
|
|
91
|
+
}
|
|
92
|
+
|
|
63
93
|
export type ListModelServingRequest = {
|
|
64
94
|
page?: HydraCommonCommon.Pagination
|
|
65
95
|
}
|
|
@@ -69,6 +99,25 @@ export type ListModelServingResponse = {
|
|
|
69
99
|
page?: HydraCommonCommon.Pagination
|
|
70
100
|
}
|
|
71
101
|
|
|
102
|
+
export type ListWSModelServingRequest = {
|
|
103
|
+
workspace?: number
|
|
104
|
+
cluster?: string
|
|
105
|
+
namespace?: string
|
|
106
|
+
page?: HydraCommonCommon.Pagination
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type ListWSModelServingResponse = {
|
|
110
|
+
items?: WSModelServing[]
|
|
111
|
+
page?: HydraCommonCommon.Pagination
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type GetWSModelServingRequest = {
|
|
115
|
+
workspace?: number
|
|
116
|
+
cluster?: string
|
|
117
|
+
namespace?: string
|
|
118
|
+
id?: string
|
|
119
|
+
}
|
|
120
|
+
|
|
72
121
|
export type GetModelServingRequest = {
|
|
73
122
|
id?: string
|
|
74
123
|
}
|
|
@@ -77,16 +126,39 @@ export type DeleteModelServingRequest = {
|
|
|
77
126
|
id?: string
|
|
78
127
|
}
|
|
79
128
|
|
|
129
|
+
export type DeleteWSModelServingRequest = {
|
|
130
|
+
workspace?: number
|
|
131
|
+
cluster?: string
|
|
132
|
+
namespace?: string
|
|
133
|
+
id?: string
|
|
134
|
+
}
|
|
135
|
+
|
|
80
136
|
export type UpdateModelServingReplicasRequest = {
|
|
81
137
|
id?: string
|
|
82
138
|
replicas?: number
|
|
83
139
|
}
|
|
84
140
|
|
|
141
|
+
export type UpdateWSModelServingReplicasRequest = {
|
|
142
|
+
workspace?: number
|
|
143
|
+
cluster?: string
|
|
144
|
+
namespace?: string
|
|
145
|
+
id?: string
|
|
146
|
+
replicas?: number
|
|
147
|
+
}
|
|
148
|
+
|
|
85
149
|
export type ModelServingActionRequest = {
|
|
86
150
|
id?: string
|
|
87
151
|
action?: ModelServingActionRequestAction
|
|
88
152
|
}
|
|
89
153
|
|
|
154
|
+
export type WSModelServingActionRequest = {
|
|
155
|
+
workspace?: number
|
|
156
|
+
cluster?: string
|
|
157
|
+
namespace?: string
|
|
158
|
+
id?: string
|
|
159
|
+
action?: WSModelServingActionRequestAction
|
|
160
|
+
}
|
|
161
|
+
|
|
90
162
|
export class ModelServingManagement {
|
|
91
163
|
static CreateModelServing(req: CreateModelServingRequest, initReq?: fm.InitReq): Promise<ModelServing> {
|
|
92
164
|
return fm.fetchReq<CreateModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
@@ -106,4 +178,24 @@ export class ModelServingManagement {
|
|
|
106
178
|
static DoModelServingAction(req: ModelServingActionRequest, initReq?: fm.InitReq): Promise<ModelServing> {
|
|
107
179
|
return fm.fetchReq<ModelServingActionRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
108
180
|
}
|
|
181
|
+
}
|
|
182
|
+
export class WSModelServingManagement {
|
|
183
|
+
static CreateWSModelServing(req: CreateWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
|
|
184
|
+
return fm.fetchReq<CreateWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
185
|
+
}
|
|
186
|
+
static ListWSModelServing(req: ListWSModelServingRequest, initReq?: fm.InitReq): Promise<ListWSModelServingResponse> {
|
|
187
|
+
return fm.fetchReq<ListWSModelServingRequest, ListWSModelServingResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
188
|
+
}
|
|
189
|
+
static GetWSModelServing(req: GetWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
|
|
190
|
+
return fm.fetchReq<GetWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
|
|
191
|
+
}
|
|
192
|
+
static DeleteWSModelServing(req: DeleteWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
|
|
193
|
+
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)})
|
|
194
|
+
}
|
|
195
|
+
static UpdateWSModelServingReplicas(req: UpdateWSModelServingReplicasRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
|
|
196
|
+
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)})
|
|
197
|
+
}
|
|
198
|
+
static DoModelWSServingAction(req: WSModelServingActionRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
|
|
199
|
+
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)})
|
|
200
|
+
}
|
|
109
201
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 ClusterStatus {
|
|
11
|
+
STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
|
|
12
|
+
STATUS_READY = "STATUS_READY",
|
|
13
|
+
STATUS_NOT_READY = "STATUS_NOT_READY",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type ListWorkspaceRequest = {
|
|
17
|
+
page?: HydraCommonCommon.Pagination
|
|
18
|
+
cluster?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type Workspace = {
|
|
22
|
+
workspaceId?: number
|
|
23
|
+
alias?: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type ListWorkspacesResponse = {
|
|
27
|
+
items?: Workspace[]
|
|
28
|
+
page?: HydraCommonCommon.Pagination
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type ListClusterRequest = {
|
|
32
|
+
workspace?: number
|
|
33
|
+
page?: HydraCommonCommon.Pagination
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type Cluster = {
|
|
37
|
+
name?: string
|
|
38
|
+
status?: ClusterStatus
|
|
39
|
+
agentInstalled?: boolean
|
|
40
|
+
baseUrl?: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type ListClustersResponse = {
|
|
44
|
+
items?: Cluster[]
|
|
45
|
+
page?: HydraCommonCommon.Pagination
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type ClusterNamespace = {
|
|
49
|
+
cluster?: string
|
|
50
|
+
namespace?: string
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type ListClusterNamespacesRequest = {
|
|
54
|
+
workspace?: number
|
|
55
|
+
cluster?: string
|
|
56
|
+
page?: HydraCommonCommon.Pagination
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type ListClusterNamespaceResponse = {
|
|
60
|
+
items?: ClusterNamespace[]
|
|
61
|
+
page?: HydraCommonCommon.Pagination
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export class WorkspaceService {
|
|
65
|
+
static ListWorkspaces(req: ListWorkspaceRequest, initReq?: fm.InitReq): Promise<ListWorkspacesResponse> {
|
|
66
|
+
return fm.fetchReq<ListWorkspaceRequest, ListWorkspacesResponse>(`/apis/hydra.io/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
67
|
+
}
|
|
68
|
+
static ListClusters(req: ListClusterRequest, initReq?: fm.InitReq): Promise<ListClustersResponse> {
|
|
69
|
+
return fm.fetchReq<ListClusterRequest, ListClustersResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/clusters?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
70
|
+
}
|
|
71
|
+
static ListClusterNamespaces(req: ListClusterNamespacesRequest, initReq?: fm.InitReq): Promise<ListClusterNamespaceResponse> {
|
|
72
|
+
return fm.fetchReq<ListClusterNamespacesRequest, ListClusterNamespaceResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/cluster-namespaces?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
73
|
+
}
|
|
74
|
+
}
|