@daocloud-proto/hydra 0.1.0 → 0.1.1-dev-1
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/management-api/agent/v1alpha1/event.pb.ts +2 -2
- package/management-api/apikey/v1alpha1/apikey.pb.ts +1 -1
- package/management-api/model/v1alpha1/model.pb.ts +0 -1
- package/management-api/model_serving/v1alpha1/model_serving.pb.ts +22 -4
- package/management-api/product/v1alpha1/product.pb.ts +4 -5
- package/package.json +1 -1
|
@@ -8,7 +8,6 @@ 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
10
|
export type CreateAPIKeyRequest = {
|
|
11
|
-
allowModels?: string[]
|
|
12
11
|
name?: string
|
|
13
12
|
}
|
|
14
13
|
|
|
@@ -19,6 +18,7 @@ export type APIKey = {
|
|
|
19
18
|
allowModels?: string[]
|
|
20
19
|
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
21
20
|
name?: string
|
|
21
|
+
denyModels?: string[]
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export type ListAPIKeyRequest = {
|
|
@@ -16,13 +16,18 @@ export enum PaymentMethod {
|
|
|
16
16
|
export enum ModelServingStatus {
|
|
17
17
|
STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
|
|
18
18
|
DEPLOYING = "DEPLOYING",
|
|
19
|
-
|
|
19
|
+
FAILED = "FAILED",
|
|
20
20
|
RUNNING = "RUNNING",
|
|
21
|
-
|
|
21
|
+
SCALING = "SCALING",
|
|
22
22
|
DELETING = "DELETING",
|
|
23
23
|
STOPPED = "STOPPED",
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
export enum ModelServingActionRequestAction {
|
|
27
|
+
MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
|
|
28
|
+
START = "START",
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
export type CreateModelServingRequest = {
|
|
27
32
|
name?: string
|
|
28
33
|
modelId?: string
|
|
@@ -43,7 +48,12 @@ export type ModelServing = {
|
|
|
43
48
|
paymentMethods?: PaymentMethod
|
|
44
49
|
status?: ModelServingStatus
|
|
45
50
|
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
51
|
+
outBill?: boolean
|
|
46
52
|
accessModelName?: string
|
|
53
|
+
namespace?: string
|
|
54
|
+
stop?: string[]
|
|
55
|
+
stopTokenIds?: number[]
|
|
56
|
+
address?: string
|
|
47
57
|
}
|
|
48
58
|
|
|
49
59
|
export type ListModelServingRequest = {
|
|
@@ -51,8 +61,8 @@ export type ListModelServingRequest = {
|
|
|
51
61
|
}
|
|
52
62
|
|
|
53
63
|
export type ListModelServingResponse = {
|
|
54
|
-
page?: HydraCommonCommon.Pagination
|
|
55
64
|
items?: ModelServing[]
|
|
65
|
+
page?: HydraCommonCommon.Pagination
|
|
56
66
|
}
|
|
57
67
|
|
|
58
68
|
export type GetModelServingRequest = {
|
|
@@ -68,6 +78,11 @@ export type UpdateModelServingReplicasRequest = {
|
|
|
68
78
|
replicas?: number
|
|
69
79
|
}
|
|
70
80
|
|
|
81
|
+
export type ModelServingActionRequest = {
|
|
82
|
+
id?: string
|
|
83
|
+
action?: ModelServingActionRequestAction
|
|
84
|
+
}
|
|
85
|
+
|
|
71
86
|
export class ModelServingManagement {
|
|
72
87
|
static CreateModelServing(req: CreateModelServingRequest, initReq?: fm.InitReq): Promise<ModelServing> {
|
|
73
88
|
return fm.fetchReq<CreateModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
@@ -82,6 +97,9 @@ export class ModelServingManagement {
|
|
|
82
97
|
return fm.fetchReq<DeleteModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
|
|
83
98
|
}
|
|
84
99
|
static UpdateModelServingReplicas(req: UpdateModelServingReplicasRequest, initReq?: fm.InitReq): Promise<ModelServing> {
|
|
85
|
-
return fm.fetchReq<UpdateModelServingReplicasRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}`, {...initReq, method: "PATCH", body: JSON.stringify(req, fm.replacer)})
|
|
100
|
+
return fm.fetchReq<UpdateModelServingReplicasRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}/replicas`, {...initReq, method: "PATCH", body: JSON.stringify(req, fm.replacer)})
|
|
101
|
+
}
|
|
102
|
+
static DoModelServingAction(req: ModelServingActionRequest, initReq?: fm.InitReq): Promise<ModelServing> {
|
|
103
|
+
return fm.fetchReq<ModelServingActionRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
86
104
|
}
|
|
87
105
|
}
|
|
@@ -9,8 +9,7 @@ import * as fm from "../../../fetch.pb"
|
|
|
9
9
|
|
|
10
10
|
export enum SKUPaymentMethod {
|
|
11
11
|
PAYMENT_METHOD_UNSPECIFIED = "PAYMENT_METHOD_UNSPECIFIED",
|
|
12
|
-
|
|
13
|
-
PREPAID = "PREPAID",
|
|
12
|
+
PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export enum SKUPriceCurrency {
|
|
@@ -21,7 +20,7 @@ export enum SKUPriceCurrency {
|
|
|
21
20
|
|
|
22
21
|
export enum ListSKURequestResourceType {
|
|
23
22
|
RESOURCE_TYPE_UNSPECIFIED = "RESOURCE_TYPE_UNSPECIFIED",
|
|
24
|
-
|
|
23
|
+
MODEL = "MODEL",
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
export type Region = {
|
|
@@ -40,7 +39,7 @@ export type ListRegionResponse = {
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
export type GetRegionRequest = {
|
|
43
|
-
|
|
42
|
+
region?: string
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
export type SKU = {
|
|
@@ -70,7 +69,7 @@ export class SKUManagement {
|
|
|
70
69
|
return fm.fetchReq<ListRegionRequest, ListRegionResponse>(`/apis/hydra.io/v1alpha1/regions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
71
70
|
}
|
|
72
71
|
static GetRegion(req: GetRegionRequest, initReq?: fm.InitReq): Promise<Region> {
|
|
73
|
-
return fm.fetchReq<GetRegionRequest, Region>(`/apis/hydra.io/v1alpha1/regions/${req["
|
|
72
|
+
return fm.fetchReq<GetRegionRequest, Region>(`/apis/hydra.io/v1alpha1/regions/${req["region"]}?${fm.renderURLSearchParams(req, ["region"])}`, {...initReq, method: "GET"})
|
|
74
73
|
}
|
|
75
74
|
static ListSKUs(req: ListSKURequest, initReq?: fm.InitReq): Promise<ListSKUResponse> {
|
|
76
75
|
return fm.fetchReq<ListSKURequest, ListSKUResponse>(`/apis/hydra.io/v1alpha1/skus?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|