@daocloud-proto/hydra 0.2.0-dev-7 → 0.2.0-dev-8

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.
@@ -6,6 +6,13 @@
6
6
 
7
7
  import * as HydraCommonCommon from "../../../common/common.pb"
8
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
+
9
16
  export type ListWorkspaceRequest = {
10
17
  page?: HydraCommonCommon.Pagination
11
18
  cluster?: string
@@ -21,8 +28,47 @@ export type ListWorkspacesResponse = {
21
28
  page?: HydraCommonCommon.Pagination
22
29
  }
23
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
+
24
64
  export class WorkspaceService {
25
65
  static ListWorkspaces(req: ListWorkspaceRequest, initReq?: fm.InitReq): Promise<ListWorkspacesResponse> {
26
66
  return fm.fetchReq<ListWorkspaceRequest, ListWorkspacesResponse>(`/apis/hydra.io/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
27
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
+ }
28
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.2.0-dev-7",
3
+ "version": "v0.2.0-dev-8",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"