@daocloud-proto/ghippo 0.7.14 → 0.7.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/ghippo",
3
- "version":"0.7.14",
3
+ "version":"0.7.18",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -0,0 +1,99 @@
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
+
9
+ export enum StatusType {
10
+ all = "all",
11
+ succeeded = "succeeded",
12
+ failed = "failed",
13
+ }
14
+
15
+ export enum TimeType {
16
+ day = "day",
17
+ hour = "hour",
18
+ minute = "minute",
19
+ }
20
+
21
+ export type ListAuditRequest = {
22
+ source?: string
23
+ type?: string
24
+ status?: StatusType
25
+ search?: string
26
+ timeType?: TimeType
27
+ timeCount?: number
28
+ page?: number
29
+ pageSize?: number
30
+ }
31
+
32
+ export type ListAuditResponse = {
33
+ items?: AuditInfo[]
34
+ pagination?: Pagination
35
+ }
36
+
37
+ export type AuditInfo = {
38
+ id?: number
39
+ auditName?: string
40
+ source?: string
41
+ resourceType?: string
42
+ resourceName?: string
43
+ status?: StatusType
44
+ user?: string
45
+ client?: string
46
+ ip?: string
47
+ createdAt?: string
48
+ }
49
+
50
+ export type Pagination = {
51
+ total?: number
52
+ page?: number
53
+ pageSize?: number
54
+ }
55
+
56
+ export type GetAuditRequest = {
57
+ id?: number
58
+ }
59
+
60
+ export type GetAuditResponse = {
61
+ audit?: string
62
+ }
63
+
64
+ export type ClearAuditRequest = {
65
+ days?: number
66
+ }
67
+
68
+ export type ClearAuditResponse = {
69
+ }
70
+
71
+ export type ExportAuditRequest = {
72
+ days?: number
73
+ }
74
+
75
+ export type ExportAuditResponse = {
76
+ csv?: string
77
+ }
78
+
79
+ export type CreateAuditRequest = {
80
+ audit?: AuditInfo
81
+ }
82
+
83
+ export type CreateAuditResponse = {
84
+ }
85
+
86
+ export class Audit {
87
+ static ListAudit(req: ListAuditRequest, initReq?: fm.InitReq): Promise<ListAuditResponse> {
88
+ return fm.fetchReq<ListAuditRequest, ListAuditResponse>(`/apis/ghippo.io/v1alpha1/audits?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
89
+ }
90
+ static GetAudit(req: GetAuditRequest, initReq?: fm.InitReq): Promise<GetAuditResponse> {
91
+ return fm.fetchReq<GetAuditRequest, GetAuditResponse>(`/apis/ghippo.io/v1alpha1/audits/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
92
+ }
93
+ static ClearAudit(req: ClearAuditRequest, initReq?: fm.InitReq): Promise<ClearAuditResponse> {
94
+ return fm.fetchReq<ClearAuditRequest, ClearAuditResponse>(`/apis/ghippo.io/v1alpha1/audits`, {...initReq, method: "DELETE"})
95
+ }
96
+ static ExportAudit(req: ExportAuditRequest, initReq?: fm.InitReq): Promise<ExportAuditResponse> {
97
+ return fm.fetchReq<ExportAuditRequest, ExportAuditResponse>(`/apis/ghippo.io/v1alpha1/audits/export?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
98
+ }
99
+ }
@@ -27,7 +27,7 @@ export type ListWorkspacesResponse = {
27
27
  pagination?: Pagination
28
28
  }
29
29
 
30
- export type ResourceInfo = {
30
+ export type WorkspacesResourceInfo = {
31
31
  resourceName?: string
32
32
  resourceType?: string
33
33
  resourceScope?: string
@@ -35,15 +35,15 @@ export type ResourceInfo = {
35
35
  workspaceId?: number
36
36
  }
37
37
 
38
- export type ListResourcesRequest = {
38
+ export type ListWorkspacesResourcesRequest = {
39
39
  page?: number
40
40
  pageSize?: number
41
41
  workspaceId?: number
42
42
  gproduct?: string
43
43
  }
44
44
 
45
- export type ListResourcesResponse = {
46
- items?: ResourceInfo[]
45
+ export type ListWorkspacesResourcesResponse = {
46
+ items?: WorkspacesResourceInfo[]
47
47
  pagination?: Pagination
48
48
  }
49
49
 
@@ -54,7 +54,7 @@ export type ListExclusiveResourcesByWorkspaceRequest = {
54
54
  }
55
55
 
56
56
  export type ListExclusiveResourcesByWorkspaceResponse = {
57
- items?: ResourceInfo[]
57
+ items?: WorkspacesResourceInfo[]
58
58
  pagination?: Pagination
59
59
  }
60
60
 
@@ -65,7 +65,7 @@ export type ListSharedResourcesByWorkspaceRequest = {
65
65
  }
66
66
 
67
67
  export type ListSharedResourcesByWorkspaceResponse = {
68
- items?: ResourceInfo[]
68
+ items?: WorkspacesResourceInfo[]
69
69
  pagination?: Pagination
70
70
  }
71
71
 
@@ -253,19 +253,19 @@ export type ListMembersRolesResourcesResponse = {
253
253
  pagination?: Pagination
254
254
  }
255
255
 
256
- export type ProductSubResourceInfo = {
256
+ export type SubResourceInfo = {
257
257
  type?: string
258
258
  names?: string[]
259
259
  }
260
260
 
261
- export type ProductResourceInfo = {
261
+ export type ResourceInfo = {
262
262
  name?: string
263
263
  type?: string
264
264
  gproduct?: string
265
- subresource?: ProductSubResourceInfo
265
+ subresource?: SubResourceInfo
266
266
  }
267
267
 
268
- export type ListProductResourcesRequest = {
268
+ export type ListResourcesRequest = {
269
269
  page?: number
270
270
  pageSize?: number
271
271
  name?: string
@@ -273,12 +273,12 @@ export type ListProductResourcesRequest = {
273
273
  type?: string
274
274
  }
275
275
 
276
- export type ListProductResourcesResponse = {
277
- items?: ProductResourceInfo[]
276
+ export type ListResourcesResponse = {
277
+ items?: ResourceInfo[]
278
278
  pagination?: Pagination
279
279
  }
280
280
 
281
- export type ProductResourceType = {
281
+ export type ResourceType = {
282
282
  parent?: boolean
283
283
  name?: string
284
284
  }
@@ -287,7 +287,7 @@ export type ListResourceTypesRequest = {
287
287
  }
288
288
 
289
289
  export type ListResourceTypesResponse = {
290
- items?: ProductResourceType[]
290
+ items?: ResourceType[]
291
291
  pagination?: Pagination
292
292
  }
293
293
 
@@ -295,7 +295,7 @@ export type ListExclusiveResourceTypesRequest = {
295
295
  }
296
296
 
297
297
  export type ListExclusiveResourceTypesResponse = {
298
- items?: ProductResourceType[]
298
+ items?: ResourceType[]
299
299
  pagination?: Pagination
300
300
  }
301
301
 
@@ -303,7 +303,7 @@ export type ListSharedResourceTypesRequest = {
303
303
  }
304
304
 
305
305
  export type ListSharedResourceTypesResponse = {
306
- items?: ProductResourceType[]
306
+ items?: ResourceType[]
307
307
  pagination?: Pagination
308
308
  }
309
309
 
@@ -315,19 +315,21 @@ export type Resource = {
315
315
  }
316
316
 
317
317
  export type QuotaHard = {
318
- limits?: QuotaHardResource
319
- requests?: QuotaHardResource
318
+ limits?: QuotaResource
319
+ requests?: QuotaResource
320
320
  }
321
321
 
322
- export type QuotaHardResource = {
322
+ export type QuotaResource = {
323
323
  cpu?: string
324
324
  memory?: string
325
325
  }
326
326
 
327
327
  export type BindResourceAndSetQuotaHardToWorkspaceRequest = {
328
+ resourceName?: string
329
+ resourceType?: string
330
+ gproduct?: string
328
331
  workspaceId?: number
329
332
  quotaHard?: QuotaHard
330
- resource?: Resource
331
333
  }
332
334
 
333
335
  export type BindResourceAndSetQuotaHardToWorkspaceResponse = {
@@ -335,37 +337,34 @@ export type BindResourceAndSetQuotaHardToWorkspaceResponse = {
335
337
 
336
338
  export type SetQuotaHardForWorkspaceResourceRequest = {
337
339
  workspaceResourceId?: number
338
- limits?: QuotaHardResource
339
- requests?: QuotaHardResource
340
+ quotaHard?: QuotaHard
340
341
  }
341
342
 
342
343
  export type SetQuotaHardForWorkspaceResourceResponse = {
343
344
  }
344
345
 
345
346
  export type GetWorkspaceResourceQuotaUsedRequest = {
347
+ workspaceId?: number
348
+ cluster?: string
346
349
  }
347
350
 
348
351
  export type GetWorkspaceResourceQuotaUsedResponse = {
349
- }
350
-
351
- export type GetWorkspaceResourceQuotaAllocatableRequest = {
352
- }
353
-
354
- export type GetWorkspaceResourceQuotaAllocatableResponse = {
352
+ quota?: {[key: string]: string}
355
353
  }
356
354
 
357
355
  export type ListResourceQuotaTypesRequest = {
358
356
  }
359
357
 
360
358
  export type ListResourceQuotaTypesResponse = {
359
+ items?: string[]
361
360
  }
362
361
 
363
362
  export class Workspace {
364
363
  static ListWorkspaces(req: ListWorkspacesRequest, initReq?: fm.InitReq): Promise<ListWorkspacesResponse> {
365
364
  return fm.fetchReq<ListWorkspacesRequest, ListWorkspacesResponse>(`/apis/ghippo.io/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
366
365
  }
367
- static ListResources(req: ListResourcesRequest, initReq?: fm.InitReq): Promise<ListResourcesResponse> {
368
- return fm.fetchReq<ListResourcesRequest, ListResourcesResponse>(`/apis/ghippo.io/v1alpha1/resources?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
366
+ static ListWorkspacesResources(req: ListWorkspacesResourcesRequest, initReq?: fm.InitReq): Promise<ListWorkspacesResourcesResponse> {
367
+ return fm.fetchReq<ListWorkspacesResourcesRequest, ListWorkspacesResourcesResponse>(`/apis/ghippo.io/v1alpha1/workspacesresources?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
369
368
  }
370
369
  static ListExclusiveResourcesByWorkspace(req: ListExclusiveResourcesByWorkspaceRequest, initReq?: fm.InitReq): Promise<ListExclusiveResourcesByWorkspaceResponse> {
371
370
  return fm.fetchReq<ListExclusiveResourcesByWorkspaceRequest, ListExclusiveResourcesByWorkspaceResponse>(`/apis/ghippo.io/v1alpha1/workspaces/${req["workspaceId"]}/exclusiveresources?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
@@ -421,8 +420,8 @@ export class Workspace {
421
420
  static ListMembersRolesResources(req: ListMembersRolesResourcesRequest, initReq?: fm.InitReq): Promise<ListMembersRolesResourcesResponse> {
422
421
  return fm.fetchReq<ListMembersRolesResourcesRequest, ListMembersRolesResourcesResponse>(`/apis/ghippo.io/v1alpha1/resources/members-roles?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
423
422
  }
424
- static ListProductResources(req: ListProductResourcesRequest, initReq?: fm.InitReq): Promise<ListProductResourcesResponse> {
425
- return fm.fetchReq<ListProductResourcesRequest, ListProductResourcesResponse>(`/apis/ghippo.io/v1alpha1/product-resources?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
423
+ static ListResources(req: ListResourcesRequest, initReq?: fm.InitReq): Promise<ListResourcesResponse> {
424
+ return fm.fetchReq<ListResourcesRequest, ListResourcesResponse>(`/apis/ghippo.io/v1alpha1/resources?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
426
425
  }
427
426
  static ListResourceTypes(req: ListResourceTypesRequest, initReq?: fm.InitReq): Promise<ListResourceTypesResponse> {
428
427
  return fm.fetchReq<ListResourceTypesRequest, ListResourceTypesResponse>(`/apis/ghippo.io/v1alpha1/resource-types?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -442,9 +441,6 @@ export class Workspace {
442
441
  static GetWorkspaceResourceQuotaUsed(req: GetWorkspaceResourceQuotaUsedRequest, initReq?: fm.InitReq): Promise<GetWorkspaceResourceQuotaUsedResponse> {
443
442
  return fm.fetchReq<GetWorkspaceResourceQuotaUsedRequest, GetWorkspaceResourceQuotaUsedResponse>(`/apis/ghippo.io/v1alpha1/workspaceresource-quota-used?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
444
443
  }
445
- static GetWorkspaceResourceQuotaAllocatable(req: GetWorkspaceResourceQuotaAllocatableRequest, initReq?: fm.InitReq): Promise<GetWorkspaceResourceQuotaAllocatableResponse> {
446
- return fm.fetchReq<GetWorkspaceResourceQuotaAllocatableRequest, GetWorkspaceResourceQuotaAllocatableResponse>(`/apis/ghippo.io/v1alpha1/workspaceresource-quota-allocatable?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
447
- }
448
444
  static ListResourceQuotaTypes(req: ListResourceQuotaTypesRequest, initReq?: fm.InitReq): Promise<ListResourceQuotaTypesResponse> {
449
445
  return fm.fetchReq<ListResourceQuotaTypesRequest, ListResourceQuotaTypesResponse>(`/apis/ghippo.io/v1alpha1/resourcequota-types?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
450
446
  }