@daocloud-proto/zestu 0.1.0-dev-09d40be9 → 0.1.0-dev-28748d99
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 +1 -1
- package/zestu.io/api/containerinstance/v1alpha1/containerinstance.pb.ts +204 -0
- package/zestu.io/api/region/v1alpha1/region.pb.ts +14 -0
- package/zestu.io/api/types/page.pb.ts +0 -4
- package/zestu.io/api/v1alpha1/zestu.pb.ts +35 -4
- package/zestu.io/api/worker/v1alpha1/worker.pb.ts +0 -11
package/package.json
CHANGED
|
@@ -0,0 +1,204 @@
|
|
|
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 ZestuIoApiTypesPage from "../../types/page.pb"
|
|
8
|
+
|
|
9
|
+
export enum ImageType {
|
|
10
|
+
IMAGE_TYPE_UNSPECIFIED = "IMAGE_TYPE_UNSPECIFIED",
|
|
11
|
+
IMAGE_OFFICIAL = "IMAGE_OFFICIAL",
|
|
12
|
+
IMAGE_APPLICATION = "IMAGE_APPLICATION",
|
|
13
|
+
IMAGE_CUSTOM = "IMAGE_CUSTOM",
|
|
14
|
+
IMAGE_PRIVATE = "IMAGE_PRIVATE",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum ChargeMode {
|
|
18
|
+
CHARGE_MODE_UNSPECIFIED = "CHARGE_MODE_UNSPECIFIED",
|
|
19
|
+
CHARGE_ELASTIC = "CHARGE_ELASTIC",
|
|
20
|
+
CHARGE_HOUR = "CHARGE_HOUR",
|
|
21
|
+
CHARGE_DAY = "CHARGE_DAY",
|
|
22
|
+
CHARGE_WEEK = "CHARGE_WEEK",
|
|
23
|
+
CHARGE_MONTH = "CHARGE_MONTH",
|
|
24
|
+
CHARGE_YEAR = "CHARGE_YEAR",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export enum InstanceType {
|
|
28
|
+
INSTANCE_TYPE_UNSPECIFIED = "INSTANCE_TYPE_UNSPECIFIED",
|
|
29
|
+
POD = "POD",
|
|
30
|
+
VM = "VM",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export enum InstanceStatus {
|
|
34
|
+
STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
|
|
35
|
+
RUNNING = "RUNNING",
|
|
36
|
+
PENDING = "PENDING",
|
|
37
|
+
STOPPING = "STOPPING",
|
|
38
|
+
DELETING = "DELETING",
|
|
39
|
+
STOPPED = "STOPPED",
|
|
40
|
+
DELETED = "DELETED",
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export enum NetworkType {
|
|
44
|
+
NETWORK_TYPE_UNSPECIFIED = "NETWORK_TYPE_UNSPECIFIED",
|
|
45
|
+
NETWORK_TYPE_SSH = "NETWORK_TYPE_SSH",
|
|
46
|
+
NETWORK_TYPE_JUPYTER = "NETWORK_TYPE_JUPYTER",
|
|
47
|
+
NETWORK_TYPE_VSCODE = "NETWORK_TYPE_VSCODE",
|
|
48
|
+
NETWORK_TYPE_CUSTOM = "NETWORK_TYPE_CUSTOM",
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export enum NetworkProtocol {
|
|
52
|
+
PROTOCOL_UNSPECIFIED = "PROTOCOL_UNSPECIFIED",
|
|
53
|
+
HTTP = "HTTP",
|
|
54
|
+
HTTPS = "HTTPS",
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ListContainerInstancesRequest = {
|
|
58
|
+
name?: string
|
|
59
|
+
page?: number
|
|
60
|
+
pageSize?: number
|
|
61
|
+
status?: InstanceStatus
|
|
62
|
+
regionId?: string
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type ListContainerInstancesResponse = {
|
|
66
|
+
items?: ContainerInstance[]
|
|
67
|
+
pagination?: ZestuIoApiTypesPage.Pagination
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type ContainerInstance = {
|
|
71
|
+
instanceName?: string
|
|
72
|
+
namespace?: string
|
|
73
|
+
creationTimestamp?: string
|
|
74
|
+
instanceId?: string
|
|
75
|
+
status?: InstanceStatus
|
|
76
|
+
charge?: ChargeInfo
|
|
77
|
+
hardware?: {[key: string]: string}
|
|
78
|
+
volumeSpec?: VolumeSpec[]
|
|
79
|
+
image?: string
|
|
80
|
+
instanceSpec?: InstanceSpec
|
|
81
|
+
regionId?: string
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type CreateContainerInstanceRequest = {
|
|
85
|
+
name?: string
|
|
86
|
+
charge?: ChargeInfo
|
|
87
|
+
regionId?: string
|
|
88
|
+
instanceSpec?: InstanceSpec
|
|
89
|
+
image?: Image
|
|
90
|
+
serviceEnable?: ServiceEnable
|
|
91
|
+
packageSource?: PackageSource
|
|
92
|
+
volumeSpec?: VolumeSpec[]
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type Image = {
|
|
96
|
+
imageType?: ImageType
|
|
97
|
+
name?: string
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type PackageSource = {
|
|
101
|
+
pip?: string
|
|
102
|
+
conda?: string
|
|
103
|
+
apt?: string
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type CreateContainerInstanceResponse = {
|
|
107
|
+
containerInstance?: ContainerInstance
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type ChargeInfo = {
|
|
111
|
+
chargeMode?: ChargeMode
|
|
112
|
+
duration?: number
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export type InstanceSpec = {
|
|
116
|
+
instanceType?: InstanceType
|
|
117
|
+
skuId?: string
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type VolumeSpec = {
|
|
121
|
+
sourcePath?: string
|
|
122
|
+
mountPath?: string
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type ServiceEnable = {
|
|
126
|
+
ssh?: boolean
|
|
127
|
+
jupyter?: boolean
|
|
128
|
+
vscode?: boolean
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type StopContainerInstanceRequest = {
|
|
132
|
+
namespace?: string
|
|
133
|
+
instanceId?: string
|
|
134
|
+
regionId?: string
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export type StopContainerInstanceResponse = {
|
|
138
|
+
containerInstance?: ContainerInstance
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export type StartContainerInstanceRequest = {
|
|
142
|
+
namespace?: string
|
|
143
|
+
instanceId?: string
|
|
144
|
+
regionId?: string
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type StartContainerInstanceResponse = {
|
|
148
|
+
containerInstance?: ContainerInstance
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export type DeleteContainerInstanceRequest = {
|
|
152
|
+
namespace?: string
|
|
153
|
+
instanceId?: string
|
|
154
|
+
regionId?: string
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export type ListContainerInstanceNetworksRequest = {
|
|
158
|
+
namespace?: string
|
|
159
|
+
instanceId?: string
|
|
160
|
+
regionId?: string
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type ListContainerInstanceNetworksResponse = {
|
|
164
|
+
items?: ContainerInstanceNetwork[]
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export type ContainerInstanceNetwork = {
|
|
168
|
+
networkType?: NetworkType
|
|
169
|
+
name?: string
|
|
170
|
+
url?: string
|
|
171
|
+
containerPort?: number
|
|
172
|
+
protocol?: NetworkProtocol
|
|
173
|
+
externalPort?: number
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type AddContainerInstanceNetworkRequest = {
|
|
177
|
+
namespace?: string
|
|
178
|
+
instanceId?: string
|
|
179
|
+
regionId?: string
|
|
180
|
+
protocol?: NetworkProtocol
|
|
181
|
+
port?: number
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export type AddContainerInstanceNetworkResponse = {
|
|
185
|
+
network?: ContainerInstanceNetwork
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export type DeleteContainerInstanceNetworkRequest = {
|
|
189
|
+
namespace?: string
|
|
190
|
+
instanceId?: string
|
|
191
|
+
regionId?: string
|
|
192
|
+
protocol?: NetworkProtocol
|
|
193
|
+
port?: number
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export type Region = {
|
|
197
|
+
regionId?: string
|
|
198
|
+
regionNameCh?: string
|
|
199
|
+
regionNameEng?: string
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type ListRegionsResponse = {
|
|
203
|
+
items?: Region[]
|
|
204
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
export type Region = {
|
|
7
|
+
regionId?: string
|
|
8
|
+
regionNameCh?: string
|
|
9
|
+
regionNameEng?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type ListRegionsResponse = {
|
|
13
|
+
items?: Region[]
|
|
14
|
+
}
|
|
@@ -12,10 +12,6 @@ export enum SortDir {
|
|
|
12
12
|
export enum SortBy {
|
|
13
13
|
SORT_BY_UNSPECIFIED = "SORT_BY_UNSPECIFIED",
|
|
14
14
|
field_name = "field_name",
|
|
15
|
-
state = "state",
|
|
16
|
-
workspace = "workspace",
|
|
17
|
-
cluster = "cluster",
|
|
18
|
-
namespace = "namespace",
|
|
19
15
|
created_at = "created_at",
|
|
20
16
|
}
|
|
21
17
|
|
|
@@ -5,9 +5,40 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../../../fetch.pb"
|
|
8
|
-
import * as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import * as GoogleProtobufEmpty from "../../../google/api/empty.pb"
|
|
9
|
+
import * as ZestuIoApiContainerinstanceV1alpha1Containerinstance from "../containerinstance/v1alpha1/containerinstance.pb"
|
|
10
|
+
import * as ZestuIoApiRegionV1alpha1Region from "../region/v1alpha1/region.pb"
|
|
11
|
+
export class ContainerInstance {
|
|
12
|
+
static ListContainerInstances(req: ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstancesRequest, initReq?: fm.InitReq): Promise<ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstancesResponse> {
|
|
13
|
+
return fm.fetchReq<ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstancesRequest, ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstancesResponse>(`/apis/zestu.io/v1/region/${req["regionId"]}/containerinstances?${fm.renderURLSearchParams(req, ["regionId"])}`, {...initReq, method: "GET"})
|
|
14
|
+
}
|
|
15
|
+
static ListAllContainerInstances(req: ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstancesRequest, initReq?: fm.InitReq): Promise<ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstancesResponse> {
|
|
16
|
+
return fm.fetchReq<ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstancesRequest, ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstancesResponse>(`/apis/zestu.io/v1/containerinstances?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
17
|
+
}
|
|
18
|
+
static CreateContainerInstance(req: ZestuIoApiContainerinstanceV1alpha1Containerinstance.CreateContainerInstanceRequest, initReq?: fm.InitReq): Promise<ZestuIoApiContainerinstanceV1alpha1Containerinstance.CreateContainerInstanceResponse> {
|
|
19
|
+
return fm.fetchReq<ZestuIoApiContainerinstanceV1alpha1Containerinstance.CreateContainerInstanceRequest, ZestuIoApiContainerinstanceV1alpha1Containerinstance.CreateContainerInstanceResponse>(`/apis/zestu.io/v1/region/${req["regionId"]}/containerinstances`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
20
|
+
}
|
|
21
|
+
static StopContainerInstance(req: ZestuIoApiContainerinstanceV1alpha1Containerinstance.StopContainerInstanceRequest, initReq?: fm.InitReq): Promise<ZestuIoApiContainerinstanceV1alpha1Containerinstance.StopContainerInstanceResponse> {
|
|
22
|
+
return fm.fetchReq<ZestuIoApiContainerinstanceV1alpha1Containerinstance.StopContainerInstanceRequest, ZestuIoApiContainerinstanceV1alpha1Containerinstance.StopContainerInstanceResponse>(`/apis/zestu.io/v1/region/${req["regionId"]}/containerinstances/${req["instanceId"]}/stop`, {...initReq, method: "PATCH"})
|
|
23
|
+
}
|
|
24
|
+
static StartContainerInstance(req: ZestuIoApiContainerinstanceV1alpha1Containerinstance.StartContainerInstanceRequest, initReq?: fm.InitReq): Promise<ZestuIoApiContainerinstanceV1alpha1Containerinstance.StartContainerInstanceResponse> {
|
|
25
|
+
return fm.fetchReq<ZestuIoApiContainerinstanceV1alpha1Containerinstance.StartContainerInstanceRequest, ZestuIoApiContainerinstanceV1alpha1Containerinstance.StartContainerInstanceResponse>(`/apis/zestu.io/v1/region/${req["regionId"]}/containerinstances/${req["instanceId"]}/start`, {...initReq, method: "PATCH"})
|
|
26
|
+
}
|
|
27
|
+
static DeleteContainerInstance(req: ZestuIoApiContainerinstanceV1alpha1Containerinstance.DeleteContainerInstanceRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
28
|
+
return fm.fetchReq<ZestuIoApiContainerinstanceV1alpha1Containerinstance.DeleteContainerInstanceRequest, GoogleProtobufEmpty.Empty>(`/apis/zestu.io/v1/region/${req["regionId"]}/containerinstances/${req["instanceId"]}`, {...initReq, method: "DELETE"})
|
|
29
|
+
}
|
|
30
|
+
static AddContainerInstanceNetwork(req: ZestuIoApiContainerinstanceV1alpha1Containerinstance.AddContainerInstanceNetworkRequest, initReq?: fm.InitReq): Promise<ZestuIoApiContainerinstanceV1alpha1Containerinstance.AddContainerInstanceNetworkResponse> {
|
|
31
|
+
return fm.fetchReq<ZestuIoApiContainerinstanceV1alpha1Containerinstance.AddContainerInstanceNetworkRequest, ZestuIoApiContainerinstanceV1alpha1Containerinstance.AddContainerInstanceNetworkResponse>(`/apis/zestu.io/v1/region/${req["regionId"]}/containerinstances/${req["instanceId"]}/ports`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
32
|
+
}
|
|
33
|
+
static ListContainerInstanceNetworks(req: ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstanceNetworksRequest, initReq?: fm.InitReq): Promise<ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstanceNetworksResponse> {
|
|
34
|
+
return fm.fetchReq<ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstanceNetworksRequest, ZestuIoApiContainerinstanceV1alpha1Containerinstance.ListContainerInstanceNetworksResponse>(`/apis/zestu.io/v1/region/${req["regionId"]}/containerinstances/${req["instanceId"]}/ports?${fm.renderURLSearchParams(req, ["regionId", "instanceId"])}`, {...initReq, method: "GET"})
|
|
35
|
+
}
|
|
36
|
+
static DeleteContainerInstanceNetwork(req: ZestuIoApiContainerinstanceV1alpha1Containerinstance.DeleteContainerInstanceNetworkRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
37
|
+
return fm.fetchReq<ZestuIoApiContainerinstanceV1alpha1Containerinstance.DeleteContainerInstanceNetworkRequest, GoogleProtobufEmpty.Empty>(`/apis/zestu.io/v1/region/${req["regionId"]}/containerinstances/${req["instanceId"]}/ports`, {...initReq, method: "DELETE"})
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export class Region {
|
|
41
|
+
static ListRegions(req: GoogleProtobufEmpty.Empty, initReq?: fm.InitReq): Promise<ZestuIoApiRegionV1alpha1Region.ListRegionsResponse> {
|
|
42
|
+
return fm.fetchReq<GoogleProtobufEmpty.Empty, ZestuIoApiRegionV1alpha1Region.ListRegionsResponse>(`/apis/zestu.io/v1/regions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
12
43
|
}
|
|
13
44
|
}
|