@daocloud-proto/hydra 0.17.0-rc1-dev-10 → 0.17.0-rc1-dev-14
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,42 @@
|
|
|
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
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
9
|
+
|
|
10
|
+
export enum UsageAggregationPhase {
|
|
11
|
+
USAGE_AGGREGATION_PHASE_UNSPECIFIED = "USAGE_AGGREGATION_PHASE_UNSPECIFIED",
|
|
12
|
+
USAGE_AGGREGATION_PHASE_READY = "USAGE_AGGREGATION_PHASE_READY",
|
|
13
|
+
USAGE_AGGREGATION_PHASE_PENDING = "USAGE_AGGREGATION_PHASE_PENDING",
|
|
14
|
+
USAGE_AGGREGATION_PHASE_SHRINKING = "USAGE_AGGREGATION_PHASE_SHRINKING",
|
|
15
|
+
USAGE_AGGREGATION_PHASE_BACKFILLING = "USAGE_AGGREGATION_PHASE_BACKFILLING",
|
|
16
|
+
USAGE_AGGREGATION_PHASE_INVALID = "USAGE_AGGREGATION_PHASE_INVALID",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type GetUsageAggregationConfigRequest = {
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type UpdateUsageAggregationConfigRequest = {
|
|
23
|
+
retentionDays?: number
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type UsageAggregationConfig = {
|
|
27
|
+
retentionDays?: number
|
|
28
|
+
desiredCoveredFrom?: GoogleProtobufTimestamp.Timestamp
|
|
29
|
+
coveredFrom?: GoogleProtobufTimestamp.Timestamp
|
|
30
|
+
coveredThrough?: GoogleProtobufTimestamp.Timestamp
|
|
31
|
+
phase?: UsageAggregationPhase
|
|
32
|
+
message?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class UsageAggregationConfigManagement {
|
|
36
|
+
static GetUsageAggregationConfig(req: GetUsageAggregationConfigRequest, initReq?: fm.InitReq): Promise<UsageAggregationConfig> {
|
|
37
|
+
return fm.fetchReq<GetUsageAggregationConfigRequest, UsageAggregationConfig>(`/apis/admin.hydra.io/v1alpha1/usage-aggregation/config?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
38
|
+
}
|
|
39
|
+
static UpdateUsageAggregationConfig(req: UpdateUsageAggregationConfigRequest, initReq?: fm.InitReq): Promise<UsageAggregationConfig> {
|
|
40
|
+
return fm.fetchReq<UpdateUsageAggregationConfigRequest, UsageAggregationConfig>(`/apis/admin.hydra.io/v1alpha1/usage-aggregation/config`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -18,6 +18,12 @@ type OneOf<T> =
|
|
|
18
18
|
: never)
|
|
19
19
|
: never);
|
|
20
20
|
|
|
21
|
+
export enum APIKeyUsageQueryMode {
|
|
22
|
+
API_KEY_USAGE_QUERY_MODE_UNSPECIFIED = "API_KEY_USAGE_QUERY_MODE_UNSPECIFIED",
|
|
23
|
+
API_KEY_USAGE_QUERY_MODE_FAST = "API_KEY_USAGE_QUERY_MODE_FAST",
|
|
24
|
+
API_KEY_USAGE_QUERY_MODE_COMPLETE = "API_KEY_USAGE_QUERY_MODE_COMPLETE",
|
|
25
|
+
}
|
|
26
|
+
|
|
21
27
|
export enum TimePeriod {
|
|
22
28
|
TIME_PERIOD_UNSPECIFIED = "TIME_PERIOD_UNSPECIFIED",
|
|
23
29
|
TIME_PERIOD_HOUR = "TIME_PERIOD_HOUR",
|
|
@@ -26,6 +32,12 @@ export enum TimePeriod {
|
|
|
26
32
|
TIME_PERIOD_MONTH = "TIME_PERIOD_MONTH",
|
|
27
33
|
}
|
|
28
34
|
|
|
35
|
+
export enum APIKeyUsageQueryStatus {
|
|
36
|
+
API_KEY_USAGE_QUERY_STATUS_UNSPECIFIED = "API_KEY_USAGE_QUERY_STATUS_UNSPECIFIED",
|
|
37
|
+
API_KEY_USAGE_QUERY_STATUS_COMPLETED = "API_KEY_USAGE_QUERY_STATUS_COMPLETED",
|
|
38
|
+
API_KEY_USAGE_QUERY_STATUS_CONFIRMATION_REQUIRED = "API_KEY_USAGE_QUERY_STATUS_CONFIRMATION_REQUIRED",
|
|
39
|
+
}
|
|
40
|
+
|
|
29
41
|
|
|
30
42
|
/* hydra modified */ export type BaseCreateWSAPIKeyRequest = {
|
|
31
43
|
name?: string
|
|
@@ -66,6 +78,23 @@ export type APIKey = {
|
|
|
66
78
|
disabled?: boolean
|
|
67
79
|
}
|
|
68
80
|
|
|
81
|
+
export type AllAPIKeyStatus = {
|
|
82
|
+
id?: string
|
|
83
|
+
expired?: boolean
|
|
84
|
+
disabled?: boolean
|
|
85
|
+
deleted?: boolean
|
|
86
|
+
name?: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type ListAllWSAPIKeysStatusRequest = {
|
|
90
|
+
workspace?: number
|
|
91
|
+
userId?: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type ListAllWSAPIKeysStatusResponse = {
|
|
95
|
+
items?: AllAPIKeyStatus[]
|
|
96
|
+
}
|
|
97
|
+
|
|
69
98
|
export type ListWSAPIKeyRequest = {
|
|
70
99
|
workspace?: number
|
|
71
100
|
page?: HydraCommonCommon.Pagination
|
|
@@ -156,6 +185,7 @@ export type WSAPIKeyUsageStatisticsRequest = {
|
|
|
156
185
|
models?: string[]
|
|
157
186
|
period?: TimePeriod
|
|
158
187
|
workspace?: number
|
|
188
|
+
queryMode?: APIKeyUsageQueryMode
|
|
159
189
|
}
|
|
160
190
|
|
|
161
191
|
export type APIKeyUsageStatisticsRequest = {
|
|
@@ -164,11 +194,23 @@ export type APIKeyUsageStatisticsRequest = {
|
|
|
164
194
|
ids?: string[]
|
|
165
195
|
models?: string[]
|
|
166
196
|
period?: TimePeriod
|
|
197
|
+
queryMode?: APIKeyUsageQueryMode
|
|
167
198
|
}
|
|
168
199
|
|
|
169
200
|
export type APIKeyUsageStatisticsResponse = {
|
|
170
201
|
dataPoints?: DataPoint[]
|
|
171
202
|
totalUsage?: Usage
|
|
203
|
+
queryStatus?: APIKeyUsageQueryStatus
|
|
204
|
+
warnings?: APIKeyUsageWarning[]
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export type APIKeyUsageWarning = {
|
|
208
|
+
code?: string
|
|
209
|
+
message?: string
|
|
210
|
+
requestedStart?: GoogleProtobufTimestamp.Timestamp
|
|
211
|
+
hourlyCoveredFrom?: GoogleProtobufTimestamp.Timestamp
|
|
212
|
+
uncoveredStart?: GoogleProtobufTimestamp.Timestamp
|
|
213
|
+
uncoveredEnd?: GoogleProtobufTimestamp.Timestamp
|
|
172
214
|
}
|
|
173
215
|
|
|
174
216
|
export type Usage = {
|
|
@@ -231,6 +273,9 @@ export class WSAPIKeyManagement {
|
|
|
231
273
|
static ListMyWSAPIKeys(req: ListWSAPIKeyRequest, initReq?: fm.InitReq): Promise<ListAPIKeyResponse> {
|
|
232
274
|
return fm.fetchReq<ListWSAPIKeyRequest, ListAPIKeyResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/my-apikeys?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
233
275
|
}
|
|
276
|
+
static ListAllWSAPIKeysStatus(req: ListAllWSAPIKeysStatusRequest, initReq?: fm.InitReq): Promise<ListAllWSAPIKeysStatusResponse> {
|
|
277
|
+
return fm.fetchReq<ListAllWSAPIKeysStatusRequest, ListAllWSAPIKeysStatusResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/all-apikey-statuses?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
278
|
+
}
|
|
234
279
|
static ListWSAPIKeyMasked(req: ListWSAPIKeyRequest, initReq?: fm.InitReq): Promise<ListAPIKeyResponse> {
|
|
235
280
|
return fm.fetchReq<ListWSAPIKeyRequest, ListAPIKeyResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/masked-apikeys?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
236
281
|
}
|