@daocloud-proto/kairship 0.0.2-6 → 0.0.3-2
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.
|
@@ -81,12 +81,13 @@ export type ListClustersResponse = {
|
|
|
81
81
|
pagination?: KairshipIoApiTypesPage.Pagination
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
export type
|
|
84
|
+
export type ClusterRequest = {
|
|
85
85
|
instance?: string
|
|
86
|
+
name?: string
|
|
86
87
|
cluster?: Cluster
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
export type
|
|
90
|
+
export type ClusterResponse = {
|
|
90
91
|
items?: Cluster
|
|
91
92
|
pagination?: KairshipIoApiTypesPage.Pagination
|
|
92
93
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../../../fetch.pb"
|
|
8
|
+
import * as GoogleProtobufEmpty from "../../../google/api/empty.pb"
|
|
8
9
|
import * as KairshipIoApiClusterV1alpha1Cluster from "../cluster/v1alpha1/cluster.pb"
|
|
9
10
|
import * as KairshipIoApiGuestbookV1alpha1Guestbook from "../guestbook/v1alpha1/guestbook.pb"
|
|
10
11
|
import * as KairshipIoApiPolicyV1alpha1Overridepolicy from "../policy/v1alpha1/overridepolicy.pb"
|
|
@@ -26,7 +27,13 @@ export class Cluster {
|
|
|
26
27
|
static ListClusters(req: KairshipIoApiClusterV1alpha1Cluster.ListClustersRequest, initReq?: fm.InitReq): Promise<KairshipIoApiClusterV1alpha1Cluster.ListClustersResponse> {
|
|
27
28
|
return fm.fetchReq<KairshipIoApiClusterV1alpha1Cluster.ListClustersRequest, KairshipIoApiClusterV1alpha1Cluster.ListClustersResponse>(`/apis/kairship.io/v1alpha1/kpanda-clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
28
29
|
}
|
|
29
|
-
static JoinCluster(req: KairshipIoApiClusterV1alpha1Cluster.
|
|
30
|
-
return fm.fetchReq<KairshipIoApiClusterV1alpha1Cluster.
|
|
30
|
+
static JoinCluster(req: KairshipIoApiClusterV1alpha1Cluster.ClusterRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
31
|
+
return fm.fetchReq<KairshipIoApiClusterV1alpha1Cluster.ClusterRequest, GoogleProtobufEmpty.Empty>(`/apis/kairship.io/v1alpha1/instances/${req["instance"]}/clusters/${req["name"]}`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
32
|
+
}
|
|
33
|
+
static ListJoinedClusters(req: KairshipIoApiClusterV1alpha1Cluster.ListClustersRequest, initReq?: fm.InitReq): Promise<KairshipIoApiClusterV1alpha1Cluster.ListClustersResponse> {
|
|
34
|
+
return fm.fetchReq<KairshipIoApiClusterV1alpha1Cluster.ListClustersRequest, KairshipIoApiClusterV1alpha1Cluster.ListClustersResponse>(`/apis/kairship.io/v1alpha1/instances/${req["instance"]}/clusters?${fm.renderURLSearchParams(req, ["instance"])}`, {...initReq, method: "GET"})
|
|
35
|
+
}
|
|
36
|
+
static RemoveJoinedCluster(req: KairshipIoApiClusterV1alpha1Cluster.ClusterRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
37
|
+
return fm.fetchReq<KairshipIoApiClusterV1alpha1Cluster.ClusterRequest, GoogleProtobufEmpty.Empty>(`/apis/kairship.io/v1alpha1/instances/${req["instance"]}/clusters/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
31
38
|
}
|
|
32
39
|
}
|