@daocloud-proto/kairship 0.5.0-162 → 0.5.0-166
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,133 @@
|
|
|
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 KairshipIoApiClusterV1alpha1Cluster from "../../cluster/v1alpha1/cluster.pb"
|
|
8
|
+
import * as KairshipIoApiCoreV1alpha1Pod from "../../core/v1alpha1/pod.pb"
|
|
9
|
+
import * as KairshipIoApiTypesObjectmeta from "../../types/objectmeta.pb"
|
|
10
|
+
import * as KairshipIoApiTypesPage from "../../types/page.pb"
|
|
11
|
+
|
|
12
|
+
export enum JobStatusJobState {
|
|
13
|
+
JOB_STATE_UNSPECIFIED = "JOB_STATE_UNSPECIFIED",
|
|
14
|
+
Waiting = "Waiting",
|
|
15
|
+
Running = "Running",
|
|
16
|
+
Completed = "Completed",
|
|
17
|
+
Deleting = "Deleting",
|
|
18
|
+
Failed = "Failed",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type Job = {
|
|
22
|
+
metadata?: KairshipIoApiTypesObjectmeta.ObjectMeta
|
|
23
|
+
spec?: JobSpec
|
|
24
|
+
status?: JobStatus
|
|
25
|
+
executionTimestamp?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type JobSpec = {
|
|
29
|
+
template?: KairshipIoApiCoreV1alpha1Pod.PodTemplateSpec
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type JobStatus = {
|
|
33
|
+
active?: number
|
|
34
|
+
succeed?: number
|
|
35
|
+
failed?: number
|
|
36
|
+
phase?: JobStatusJobState
|
|
37
|
+
conditions?: KairshipIoApiTypesObjectmeta.Condition[]
|
|
38
|
+
clusters?: KairshipIoApiClusterV1alpha1Cluster.ClusterProviderSummary[]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type GetJobJSONRequest = {
|
|
42
|
+
instance?: string
|
|
43
|
+
namespace?: string
|
|
44
|
+
name?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type GetJobJSONResponse = {
|
|
48
|
+
data?: string
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type CreateJobRequest = {
|
|
52
|
+
instance?: string
|
|
53
|
+
namespace?: string
|
|
54
|
+
data?: string
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type CreateJobResponse = {
|
|
58
|
+
data?: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type ListPodsByJobNameRequest = {
|
|
62
|
+
name?: string
|
|
63
|
+
instance?: string
|
|
64
|
+
namespace?: string
|
|
65
|
+
phase?: KairshipIoApiCoreV1alpha1Pod.PodStatusPhase
|
|
66
|
+
page?: number
|
|
67
|
+
pageSize?: number
|
|
68
|
+
sortBy?: KairshipIoApiTypesPage.SortBy
|
|
69
|
+
sortDir?: KairshipIoApiTypesPage.SortDir
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type ListPodsByJobNameResponse = {
|
|
73
|
+
items?: KairshipIoApiCoreV1alpha1Pod.Pod[]
|
|
74
|
+
pagination?: KairshipIoApiTypesPage.Pagination
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type GetJobRequest = {
|
|
78
|
+
instance?: string
|
|
79
|
+
namespace?: string
|
|
80
|
+
name?: string
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type ListInstanceJobsRequest = {
|
|
84
|
+
instance?: string
|
|
85
|
+
namespace?: string
|
|
86
|
+
phase?: string
|
|
87
|
+
page?: number
|
|
88
|
+
pageSize?: number
|
|
89
|
+
sortBy?: KairshipIoApiTypesPage.SortBy
|
|
90
|
+
sortDir?: KairshipIoApiTypesPage.SortDir
|
|
91
|
+
name?: string
|
|
92
|
+
labelSelector?: string
|
|
93
|
+
fieldSelector?: string
|
|
94
|
+
fuzzyName?: string
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type ListInstanceJobsResponse = {
|
|
98
|
+
items?: Job[]
|
|
99
|
+
pagination?: KairshipIoApiTypesPage.Pagination
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type ListJobsRequest = {
|
|
103
|
+
instance?: string
|
|
104
|
+
namespace?: string
|
|
105
|
+
page?: number
|
|
106
|
+
pageSize?: number
|
|
107
|
+
name?: string
|
|
108
|
+
phase?: string
|
|
109
|
+
sortBy?: KairshipIoApiTypesPage.SortBy
|
|
110
|
+
sortDir?: KairshipIoApiTypesPage.SortDir
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type ListJobsResponse = {
|
|
114
|
+
items?: Job[]
|
|
115
|
+
pagination?: KairshipIoApiTypesPage.Pagination
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type DeleteJobRequest = {
|
|
119
|
+
instance?: string
|
|
120
|
+
namespace?: string
|
|
121
|
+
name?: string
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export type RestartJobRequest = {
|
|
125
|
+
instance?: string
|
|
126
|
+
namespace?: string
|
|
127
|
+
name?: string
|
|
128
|
+
resourceVersion?: string
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type RestartJobResponse = {
|
|
132
|
+
job?: Job
|
|
133
|
+
}
|
|
@@ -8,6 +8,7 @@ import * as fm from "../../../fetch.pb"
|
|
|
8
8
|
import * as GoogleProtobufEmpty from "../../../google/api/empty.pb"
|
|
9
9
|
import * as KairshipIoApiAggregationV1alpha1Aggregation from "../aggregation/v1alpha1/aggregation.pb"
|
|
10
10
|
import * as KairshipIoApiAppsV1alpha1Deployment from "../apps/v1alpha1/deployment.pb"
|
|
11
|
+
import * as KairshipIoApiBatchV1alpha1Job from "../batch/v1alpha1/job.pb"
|
|
11
12
|
import * as KairshipIoApiCloudshellV1alpha1Cloudshell from "../cloudshell/v1alpha1/cloudshell.pb"
|
|
12
13
|
import * as KairshipIoApiClusterV1alpha1Cluster from "../cluster/v1alpha1/cluster.pb"
|
|
13
14
|
import * as KairshipIoApiCoreV1alpha1Configmap from "../core/v1alpha1/configmap.pb"
|
|
@@ -323,4 +324,27 @@ export class Workspace {
|
|
|
323
324
|
static ListWorkspaces(req: KairshipIoApiWorkspaceV1alpha1Workspace.ListWorkspacesRequest, initReq?: fm.InitReq): Promise<KairshipIoApiWorkspaceV1alpha1Workspace.ListWorkspacesResponse> {
|
|
324
325
|
return fm.fetchReq<KairshipIoApiWorkspaceV1alpha1Workspace.ListWorkspacesRequest, KairshipIoApiWorkspaceV1alpha1Workspace.ListWorkspacesResponse>(`/apis/kairship.io/v1alpha1/workspace-management/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
325
326
|
}
|
|
327
|
+
}
|
|
328
|
+
export class Batch {
|
|
329
|
+
static CreateJob(req: KairshipIoApiBatchV1alpha1Job.CreateJobRequest, initReq?: fm.InitReq): Promise<KairshipIoApiBatchV1alpha1Job.CreateJobResponse> {
|
|
330
|
+
return fm.fetchReq<KairshipIoApiBatchV1alpha1Job.CreateJobRequest, KairshipIoApiBatchV1alpha1Job.CreateJobResponse>(`/apis/kairship.io/v1alpha1/instances/${req["instance"]}/namespaces/${req["namespace"]}/jobs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
331
|
+
}
|
|
332
|
+
static GetJob(req: KairshipIoApiBatchV1alpha1Job.GetJobRequest, initReq?: fm.InitReq): Promise<KairshipIoApiBatchV1alpha1Job.Job> {
|
|
333
|
+
return fm.fetchReq<KairshipIoApiBatchV1alpha1Job.GetJobRequest, KairshipIoApiBatchV1alpha1Job.Job>(`/apis/kairship.io/v1alpha1/instances/${req["instance"]}/namespaces/${req["namespace"]}/jobs/${req["name"]}?${fm.renderURLSearchParams(req, ["instance", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
334
|
+
}
|
|
335
|
+
static GetJobJSON(req: KairshipIoApiBatchV1alpha1Job.GetJobJSONRequest, initReq?: fm.InitReq): Promise<KairshipIoApiBatchV1alpha1Job.GetJobJSONResponse> {
|
|
336
|
+
return fm.fetchReq<KairshipIoApiBatchV1alpha1Job.GetJobJSONRequest, KairshipIoApiBatchV1alpha1Job.GetJobJSONResponse>(`/apis/kairship.io/v1alpha1/instances/${req["instance"]}/namespaces/${req["namespace"]}/jobs/${req["name"]}/json?${fm.renderURLSearchParams(req, ["instance", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
337
|
+
}
|
|
338
|
+
static DeleteJob(req: KairshipIoApiBatchV1alpha1Job.DeleteJobRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
339
|
+
return fm.fetchReq<KairshipIoApiBatchV1alpha1Job.DeleteJobRequest, GoogleProtobufEmpty.Empty>(`/apis/kairship.io/v1alpha1/instances/${req["instance"]}/namespaces/${req["namespace"]}/jobs/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
340
|
+
}
|
|
341
|
+
static ListJobs(req: KairshipIoApiBatchV1alpha1Job.ListJobsRequest, initReq?: fm.InitReq): Promise<KairshipIoApiBatchV1alpha1Job.ListJobsResponse> {
|
|
342
|
+
return fm.fetchReq<KairshipIoApiBatchV1alpha1Job.ListJobsRequest, KairshipIoApiBatchV1alpha1Job.ListJobsResponse>(`/apis/kairship.io/v1alpha1/instances/${req["instance"]}/namespaces/${req["namespace"]}/jobs?${fm.renderURLSearchParams(req, ["instance", "namespace"])}`, {...initReq, method: "GET"})
|
|
343
|
+
}
|
|
344
|
+
static ListInstanceJobs(req: KairshipIoApiBatchV1alpha1Job.ListInstanceJobsRequest, initReq?: fm.InitReq): Promise<KairshipIoApiBatchV1alpha1Job.ListInstanceJobsResponse> {
|
|
345
|
+
return fm.fetchReq<KairshipIoApiBatchV1alpha1Job.ListInstanceJobsRequest, KairshipIoApiBatchV1alpha1Job.ListInstanceJobsResponse>(`/apis/kairship.io/v1alpha1/instances/${req["instance"]}/jobs?${fm.renderURLSearchParams(req, ["instance"])}`, {...initReq, method: "GET"})
|
|
346
|
+
}
|
|
347
|
+
static RestartJob(req: KairshipIoApiBatchV1alpha1Job.RestartJobRequest, initReq?: fm.InitReq): Promise<KairshipIoApiBatchV1alpha1Job.RestartJobResponse> {
|
|
348
|
+
return fm.fetchReq<KairshipIoApiBatchV1alpha1Job.RestartJobRequest, KairshipIoApiBatchV1alpha1Job.RestartJobResponse>(`/apis/kairship.io/v1alpha1/instances/${req["instance"]}/namespaces/${req["namespace"]}/jobs/${req["name"]}:restart`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
349
|
+
}
|
|
326
350
|
}
|