@origincloud/compute 0.0.0-stage → 0.3.0
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/LICENSE +202 -0
- package/README.md +24 -2
- package/dist/longrunning/v1beta1/index.d.ts +2 -0
- package/dist/longrunning/v1beta1/index.d.ts.map +1 -0
- package/dist/longrunning/v1beta1/index.js +3 -0
- package/dist/longrunning/v1beta1/index.js.map +1 -0
- package/dist/longrunning/v1beta1/operations.d.ts +63 -0
- package/dist/longrunning/v1beta1/operations.d.ts.map +1 -0
- package/dist/longrunning/v1beta1/operations.js +54 -0
- package/dist/longrunning/v1beta1/operations.js.map +1 -0
- package/dist/v1beta1/catalog.d.ts +146 -0
- package/dist/v1beta1/catalog.d.ts.map +1 -0
- package/dist/v1beta1/catalog.js +86 -0
- package/dist/v1beta1/catalog.js.map +1 -0
- package/dist/v1beta1/image.d.ts +172 -0
- package/dist/v1beta1/image.d.ts.map +1 -0
- package/dist/v1beta1/image.js +115 -0
- package/dist/v1beta1/image.js.map +1 -0
- package/dist/v1beta1/index.d.ts +7 -0
- package/dist/v1beta1/index.d.ts.map +1 -0
- package/dist/v1beta1/index.js +8 -0
- package/dist/v1beta1/index.js.map +1 -0
- package/dist/v1beta1/instance.d.ts +398 -0
- package/dist/v1beta1/instance.d.ts.map +1 -0
- package/dist/v1beta1/instance.js +253 -0
- package/dist/v1beta1/instance.js.map +1 -0
- package/dist/v1beta1/key_pair.d.ts +126 -0
- package/dist/v1beta1/key_pair.d.ts.map +1 -0
- package/dist/v1beta1/key_pair.js +95 -0
- package/dist/v1beta1/key_pair.js.map +1 -0
- package/dist/v1beta1/public_image.d.ts +94 -0
- package/dist/v1beta1/public_image.d.ts.map +1 -0
- package/dist/v1beta1/public_image.js +56 -0
- package/dist/v1beta1/public_image.js.map +1 -0
- package/dist/v1beta1/volume_attachment.d.ts +156 -0
- package/dist/v1beta1/volume_attachment.d.ts.map +1 -0
- package/dist/v1beta1/volume_attachment.js +125 -0
- package/dist/v1beta1/volume_attachment.js.map +1 -0
- package/package.json +40 -4
- package/src/longrunning/v1beta1/index.ts +3 -0
- package/src/longrunning/v1beta1/operations.ts +103 -0
- package/src/v1beta1/catalog.ts +208 -0
- package/src/v1beta1/image.ts +269 -0
- package/src/v1beta1/index.ts +8 -0
- package/src/v1beta1/instance.ts +541 -0
- package/src/v1beta1/key_pair.ts +216 -0
- package/src/v1beta1/public_image.ts +137 -0
- package/src/v1beta1/volume_attachment.ts +241 -0
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
// Code generated by the SDK's generator (generator/). DO NOT EDIT.
|
|
2
|
+
// source: origincloud/compute/v1beta1/instance.proto
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
type CallOptions,
|
|
6
|
+
type Client,
|
|
7
|
+
type Empty,
|
|
8
|
+
type LongrunningOperation,
|
|
9
|
+
Operation,
|
|
10
|
+
type Service,
|
|
11
|
+
newRequestId,
|
|
12
|
+
pathValue,
|
|
13
|
+
query,
|
|
14
|
+
} from "@origincloud/core";
|
|
15
|
+
import type { OperationMetadata } from "../longrunning/v1beta1/operations.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Calls InstanceService.
|
|
19
|
+
*
|
|
20
|
+
* Instances: virtual machines in one zone, booted from an image onto a
|
|
21
|
+
* durable boot volume, with network interfaces created beforehand with the
|
|
22
|
+
* network service.
|
|
23
|
+
*/
|
|
24
|
+
export class InstanceClient {
|
|
25
|
+
/**
|
|
26
|
+
* The endpoint the client sends its calls to, which also serves the
|
|
27
|
+
* operations its methods answer with.
|
|
28
|
+
*/
|
|
29
|
+
readonly service: Service;
|
|
30
|
+
|
|
31
|
+
/** A client of InstanceService that sends its calls through `client`. */
|
|
32
|
+
constructor(client: Client) {
|
|
33
|
+
this.service = client.service("compute", true);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Returns an instance. A terminated instance can be read by name for a
|
|
38
|
+
* day after it was terminated.
|
|
39
|
+
*/
|
|
40
|
+
async getInstance(request: GetInstanceRequest, options?: CallOptions): Promise<Instance> {
|
|
41
|
+
const p0 = pathValue("name", request.name, "projects/*/zones/*/instances/*");
|
|
42
|
+
return this.service.call<Instance>(
|
|
43
|
+
{
|
|
44
|
+
method: "GET",
|
|
45
|
+
path: `/v1beta1/${p0}`,
|
|
46
|
+
query: query(request, ["name"]),
|
|
47
|
+
idempotent: true,
|
|
48
|
+
},
|
|
49
|
+
options,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Lists the instances in a zone, oldest first. A terminated instance is
|
|
55
|
+
* listed for two hours after it was terminated. For every zone's
|
|
56
|
+
* instances, list the zones whose `services` name `compute` with the
|
|
57
|
+
* location service (`location.origincloudapis.eu`), then each zone's
|
|
58
|
+
* instances.
|
|
59
|
+
*/
|
|
60
|
+
async listInstances(request: ListInstancesRequest, options?: CallOptions): Promise<ListInstancesResponse> {
|
|
61
|
+
const p0 = pathValue("parent", request.parent, "projects/*/zones/*");
|
|
62
|
+
return this.service.call<ListInstancesResponse>(
|
|
63
|
+
{
|
|
64
|
+
method: "GET",
|
|
65
|
+
path: `/v1beta1/${p0}/instances`,
|
|
66
|
+
query: query(request, ["parent"]),
|
|
67
|
+
idempotent: true,
|
|
68
|
+
},
|
|
69
|
+
options,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Iterates over everything listInstances lists from the request's page on,
|
|
75
|
+
* fetching the next page as the loop reaches it. A page that fails ends
|
|
76
|
+
* the iteration with its error.
|
|
77
|
+
*/
|
|
78
|
+
async *allInstances(request: ListInstancesRequest, options?: CallOptions): AsyncGenerator<Instance, void, undefined> {
|
|
79
|
+
for (let page = request; ; ) {
|
|
80
|
+
const response = await this.listInstances(page, options);
|
|
81
|
+
yield* response.instances ?? [];
|
|
82
|
+
if (!response.nextPageToken) return;
|
|
83
|
+
page = { ...page, pageToken: response.nextPageToken };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Launches an instance. The operation is done once the instance is
|
|
89
|
+
* `RUNNING`, or failed once it is `FAILED`, with the reason in
|
|
90
|
+
* `stateReason`; a failed instance still exists, and can be started
|
|
91
|
+
* again or deleted.
|
|
92
|
+
*
|
|
93
|
+
* It answers with an operation to wait on, whose result is the Instance.
|
|
94
|
+
*/
|
|
95
|
+
async createInstance(request: CreateInstanceRequest, options?: CallOptions): Promise<Operation<Instance, OperationMetadata>> {
|
|
96
|
+
if (!request.requestId) request = { ...request, requestId: newRequestId() };
|
|
97
|
+
const p0 = pathValue("parent", request.parent, "projects/*/zones/*");
|
|
98
|
+
const op = await this.service.call<LongrunningOperation>(
|
|
99
|
+
{
|
|
100
|
+
method: "POST",
|
|
101
|
+
path: `/v1beta1/${p0}/instances`,
|
|
102
|
+
body: request.instance,
|
|
103
|
+
query: query(request, ["parent", "instance"]),
|
|
104
|
+
idempotent: true,
|
|
105
|
+
},
|
|
106
|
+
options,
|
|
107
|
+
);
|
|
108
|
+
return new Operation<Instance, OperationMetadata>(this.service, op, "origincloud.compute.v1beta1.Instance");
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Changes an instance's type or tags. A new `instanceType` needs the
|
|
113
|
+
* instance `STOPPED`, and is refused with `FAILED_PRECONDITION`
|
|
114
|
+
* otherwise; it takes effect at the next start. A larger type is checked
|
|
115
|
+
* against the same vCPU quota a launch is. The operation is done once the
|
|
116
|
+
* instance shows the change.
|
|
117
|
+
*
|
|
118
|
+
* It answers with an operation to wait on, whose result is the Instance.
|
|
119
|
+
*/
|
|
120
|
+
async updateInstance(request: UpdateInstanceRequest, options?: CallOptions): Promise<Operation<Instance, OperationMetadata>> {
|
|
121
|
+
if (!request.requestId) request = { ...request, requestId: newRequestId() };
|
|
122
|
+
const p0 = pathValue("instance.name", request.instance?.name, "projects/*/zones/*/instances/*");
|
|
123
|
+
const op = await this.service.call<LongrunningOperation>(
|
|
124
|
+
{
|
|
125
|
+
method: "PATCH",
|
|
126
|
+
path: `/v1beta1/${p0}`,
|
|
127
|
+
body: request.instance,
|
|
128
|
+
query: query(request, ["instance.name", "instance"]),
|
|
129
|
+
idempotent: true,
|
|
130
|
+
},
|
|
131
|
+
options,
|
|
132
|
+
);
|
|
133
|
+
return new Operation<Instance, OperationMetadata>(this.service, op, "origincloud.compute.v1beta1.Instance");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Terminates an instance: its guest is stopped for good, its network
|
|
138
|
+
* interfaces are released, `AVAILABLE` again with their addresses (one
|
|
139
|
+
* created for it at launch is deleted), and
|
|
140
|
+
* its boot volume is deleted with it unless a snapshot of it exists.
|
|
141
|
+
* Other attached volumes are detached and kept.
|
|
142
|
+
* Terminating a terminated instance changes nothing. The operation is
|
|
143
|
+
* done once the instance is `TERMINATED`.
|
|
144
|
+
*
|
|
145
|
+
* It answers with an operation to wait on, which has no result.
|
|
146
|
+
*/
|
|
147
|
+
async deleteInstance(request: DeleteInstanceRequest, options?: CallOptions): Promise<Operation<Empty, OperationMetadata>> {
|
|
148
|
+
if (!request.requestId) request = { ...request, requestId: newRequestId() };
|
|
149
|
+
const p0 = pathValue("name", request.name, "projects/*/zones/*/instances/*");
|
|
150
|
+
const op = await this.service.call<LongrunningOperation>(
|
|
151
|
+
{
|
|
152
|
+
method: "DELETE",
|
|
153
|
+
path: `/v1beta1/${p0}`,
|
|
154
|
+
query: query(request, ["name"]),
|
|
155
|
+
idempotent: true,
|
|
156
|
+
},
|
|
157
|
+
options,
|
|
158
|
+
);
|
|
159
|
+
return new Operation<Empty, OperationMetadata>(this.service, op, "google.protobuf.Empty");
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Starts a `STOPPED` or `FAILED` instance. It keeps its name, its
|
|
164
|
+
* addresses and its volumes, and may come back on another machine.
|
|
165
|
+
* Starting a running instance changes nothing; it is refused while the
|
|
166
|
+
* instance is `INITIALIZING`, `STOPPING` or `SHUTTING_DOWN`. The
|
|
167
|
+
* operation is done once the instance is `RUNNING`, or failed once it is
|
|
168
|
+
* `FAILED`.
|
|
169
|
+
*
|
|
170
|
+
* It answers with an operation to wait on, whose result is the Instance.
|
|
171
|
+
*/
|
|
172
|
+
async startInstance(request: StartInstanceRequest, options?: CallOptions): Promise<Operation<Instance, OperationMetadata>> {
|
|
173
|
+
if (!request.requestId) request = { ...request, requestId: newRequestId() };
|
|
174
|
+
const p0 = pathValue("name", request.name, "projects/*/zones/*/instances/*");
|
|
175
|
+
const op = await this.service.call<LongrunningOperation>(
|
|
176
|
+
{
|
|
177
|
+
method: "POST",
|
|
178
|
+
path: `/v1beta1/${p0}:start`,
|
|
179
|
+
body: request,
|
|
180
|
+
idempotent: true,
|
|
181
|
+
},
|
|
182
|
+
options,
|
|
183
|
+
);
|
|
184
|
+
return new Operation<Instance, OperationMetadata>(this.service, op, "origincloud.compute.v1beta1.Instance");
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Stops a running instance: its guest is shut down, and it keeps its
|
|
189
|
+
* volumes and addresses. Stopping a stopped instance changes nothing. The
|
|
190
|
+
* operation is done once the instance is `STOPPED`, or failed once it is
|
|
191
|
+
* `FAILED`.
|
|
192
|
+
*
|
|
193
|
+
* It answers with an operation to wait on, whose result is the Instance.
|
|
194
|
+
*/
|
|
195
|
+
async stopInstance(request: StopInstanceRequest, options?: CallOptions): Promise<Operation<Instance, OperationMetadata>> {
|
|
196
|
+
if (!request.requestId) request = { ...request, requestId: newRequestId() };
|
|
197
|
+
const p0 = pathValue("name", request.name, "projects/*/zones/*/instances/*");
|
|
198
|
+
const op = await this.service.call<LongrunningOperation>(
|
|
199
|
+
{
|
|
200
|
+
method: "POST",
|
|
201
|
+
path: `/v1beta1/${p0}:stop`,
|
|
202
|
+
body: request,
|
|
203
|
+
idempotent: true,
|
|
204
|
+
},
|
|
205
|
+
options,
|
|
206
|
+
);
|
|
207
|
+
return new Operation<Instance, OperationMetadata>(this.service, op, "origincloud.compute.v1beta1.Instance");
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** A virtual machine in one zone. */
|
|
212
|
+
export interface Instance {
|
|
213
|
+
/** The instance's resource name. */
|
|
214
|
+
name?: string;
|
|
215
|
+
/**
|
|
216
|
+
* The instance's URN, the identifier access policies and the audit log
|
|
217
|
+
* use.
|
|
218
|
+
*/
|
|
219
|
+
urn?: string;
|
|
220
|
+
/**
|
|
221
|
+
* The instance type, `instanceTypes/{instance_type}`, such as
|
|
222
|
+
* `instanceTypes/gp1.core.2`: one whose `available` is true. Changing it
|
|
223
|
+
* needs the instance `STOPPED`.
|
|
224
|
+
*/
|
|
225
|
+
instanceType?: string;
|
|
226
|
+
/**
|
|
227
|
+
* The image the boot volume is created from, in the instance's zone: one
|
|
228
|
+
* of the project's own, `projects/{project}/zones/{zone}/images/{image}`,
|
|
229
|
+
* or a public one, `zones/{zone}/images/{image}`. Set exactly one of
|
|
230
|
+
* `image` and `imageFamily`; launched from a family, this is the public
|
|
231
|
+
* image the family resolved to.
|
|
232
|
+
*/
|
|
233
|
+
image?: string;
|
|
234
|
+
/**
|
|
235
|
+
* The image family to launch the current public image of,
|
|
236
|
+
* `imageFamilies/{image_family}`. Set exactly one of `image` and
|
|
237
|
+
* `imageFamily`. Empty when the instance was launched from an image.
|
|
238
|
+
*/
|
|
239
|
+
imageFamily?: string;
|
|
240
|
+
/**
|
|
241
|
+
* The key pair whose public key is installed for `loginUser`, in the
|
|
242
|
+
* instance's project.
|
|
243
|
+
*/
|
|
244
|
+
keyPair?: string;
|
|
245
|
+
/**
|
|
246
|
+
* The account to log in as: a user created at first boot that holds the
|
|
247
|
+
* key pair. A POSIX user name of at most 32 lowercase letters, digits,
|
|
248
|
+
* underscores and hyphens, starting with a letter or an underscore, and
|
|
249
|
+
* not `root`. The image's `defaultUser` when left empty.
|
|
250
|
+
*/
|
|
251
|
+
loginUser?: string;
|
|
252
|
+
/**
|
|
253
|
+
* The boot volume: its size and storage class at launch, and the volume.
|
|
254
|
+
* The image's size on the default storage class when left out.
|
|
255
|
+
*/
|
|
256
|
+
bootVolume?: BootVolume;
|
|
257
|
+
/**
|
|
258
|
+
* The network interfaces, in device order, the boot interface first;
|
|
259
|
+
* exactly one today. Each is an existing interface in the instance's
|
|
260
|
+
* project and zone that nothing else holds, created with the network
|
|
261
|
+
* service: its subnet and security groups are the instance's.
|
|
262
|
+
* Terminating the instance releases it, and it stays. An instance
|
|
263
|
+
* launched before interfaces were named at launch shows the interface
|
|
264
|
+
* created for it, which is deleted with the instance.
|
|
265
|
+
*/
|
|
266
|
+
networkInterfaces?: string[];
|
|
267
|
+
/** Where the instance is in its lifecycle. */
|
|
268
|
+
state?: Instance_State;
|
|
269
|
+
/**
|
|
270
|
+
* Why the instance is `FAILED`, or why a `STOPPED` instance went down
|
|
271
|
+
* when the machine it ran on failed; empty otherwise.
|
|
272
|
+
*/
|
|
273
|
+
stateReason?: string;
|
|
274
|
+
/**
|
|
275
|
+
* Whether the platform can currently confirm the instance is working,
|
|
276
|
+
* which `state` doesn't say: a `RUNNING` instance on a machine that
|
|
277
|
+
* stopped answering is still `RUNNING`.
|
|
278
|
+
*/
|
|
279
|
+
health?: InstanceHealth;
|
|
280
|
+
/** When the instance was launched. */
|
|
281
|
+
createTime?: string;
|
|
282
|
+
/**
|
|
283
|
+
* The principal that launched the instance, such as `user:<id>` or
|
|
284
|
+
* `service_account:<id>`.
|
|
285
|
+
*/
|
|
286
|
+
creator?: string;
|
|
287
|
+
/**
|
|
288
|
+
* Labels of your own, at most 50. The `origin:name` tag is the name the
|
|
289
|
+
* console shows.
|
|
290
|
+
*/
|
|
291
|
+
tags?: Record<string, string>;
|
|
292
|
+
/**
|
|
293
|
+
* Each network interface's private addresses, in the order of
|
|
294
|
+
* `networkInterfaces`; an interface not attached yet has none.
|
|
295
|
+
*/
|
|
296
|
+
interfaceAddresses?: InterfaceAddresses[];
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** Where the instance is in its lifecycle. */
|
|
300
|
+
export const Instance_State = {
|
|
301
|
+
/** Not set. */
|
|
302
|
+
STATE_UNSPECIFIED: "STATE_UNSPECIFIED",
|
|
303
|
+
/**
|
|
304
|
+
* Its boot volume and network interface are being created; it starts
|
|
305
|
+
* on its own once they are ready.
|
|
306
|
+
*/
|
|
307
|
+
INITIALIZING: "INITIALIZING",
|
|
308
|
+
/** Being placed on a machine and booted. */
|
|
309
|
+
PENDING: "PENDING",
|
|
310
|
+
/** Running. */
|
|
311
|
+
RUNNING: "RUNNING",
|
|
312
|
+
/** Shutting down, to `STOPPED`. */
|
|
313
|
+
STOPPING: "STOPPING",
|
|
314
|
+
/**
|
|
315
|
+
* Stopped: it holds its volumes and addresses, and no compute capacity
|
|
316
|
+
* is charged.
|
|
317
|
+
*/
|
|
318
|
+
STOPPED: "STOPPED",
|
|
319
|
+
/** Being terminated. */
|
|
320
|
+
SHUTTING_DOWN: "SHUTTING_DOWN",
|
|
321
|
+
/** Terminated. Readable by name for a day. */
|
|
322
|
+
TERMINATED: "TERMINATED",
|
|
323
|
+
/**
|
|
324
|
+
* A start, a stop or the launch failed; `stateReason` says why. Start
|
|
325
|
+
* it again, or delete it.
|
|
326
|
+
*/
|
|
327
|
+
FAILED: "FAILED",
|
|
328
|
+
} as const;
|
|
329
|
+
|
|
330
|
+
/** Where the instance is in its lifecycle. */
|
|
331
|
+
export type Instance_State = (typeof Instance_State)[keyof typeof Instance_State];
|
|
332
|
+
|
|
333
|
+
/** An instance's boot volume. */
|
|
334
|
+
export interface BootVolume {
|
|
335
|
+
/**
|
|
336
|
+
* The size in GiB the volume was created with, at least the image's
|
|
337
|
+
* size; the image's size when left at 0. Grow the volume itself to
|
|
338
|
+
* resize it; this keeps the size at launch.
|
|
339
|
+
*/
|
|
340
|
+
sizeGib?: number;
|
|
341
|
+
/**
|
|
342
|
+
* The storage class, `storageClasses/{storage_class}` of the persistent
|
|
343
|
+
* volume service; the default class when left empty.
|
|
344
|
+
*/
|
|
345
|
+
storageClass?: string;
|
|
346
|
+
/** The volume, in the instance's project and zone. */
|
|
347
|
+
volume?: string;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/** The private addresses of one of an instance's network interfaces. */
|
|
351
|
+
export interface InterfaceAddresses {
|
|
352
|
+
/** The network interface. */
|
|
353
|
+
networkInterface?: string;
|
|
354
|
+
/** Its private IPv4 address. */
|
|
355
|
+
ipv4Address?: string;
|
|
356
|
+
/** Its IPv6 address. */
|
|
357
|
+
ipv6Address?: string;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/** An instance's health: each check, and their summary. */
|
|
361
|
+
export interface InstanceHealth {
|
|
362
|
+
/**
|
|
363
|
+
* The summary of `checks`, for a listing that shows one value per
|
|
364
|
+
* instance. Only the checks say whether a problem is the platform's or
|
|
365
|
+
* the instance's own.
|
|
366
|
+
*/
|
|
367
|
+
availability?: InstanceHealth_Availability;
|
|
368
|
+
/**
|
|
369
|
+
* Every check, always all of them: one with nothing to report is
|
|
370
|
+
* `NOT_APPLICABLE` or `INSUFFICIENT_DATA`, never left out.
|
|
371
|
+
*/
|
|
372
|
+
checks?: HealthCheck[];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/** The summary of the checks. */
|
|
376
|
+
export const InstanceHealth_Availability = {
|
|
377
|
+
/** Not set. */
|
|
378
|
+
AVAILABILITY_UNSPECIFIED: "AVAILABILITY_UNSPECIFIED",
|
|
379
|
+
/** Every check that applies passed. */
|
|
380
|
+
AVAILABLE: "AVAILABLE",
|
|
381
|
+
/** A check failed. */
|
|
382
|
+
IMPAIRED: "IMPAIRED",
|
|
383
|
+
/** A check that applies has no recent observation. */
|
|
384
|
+
UNKNOWN: "UNKNOWN",
|
|
385
|
+
/** No check applies, as for a stopped instance. */
|
|
386
|
+
NOT_APPLICABLE: "NOT_APPLICABLE",
|
|
387
|
+
} as const;
|
|
388
|
+
|
|
389
|
+
/** The summary of the checks. */
|
|
390
|
+
export type InstanceHealth_Availability = (typeof InstanceHealth_Availability)[keyof typeof InstanceHealth_Availability];
|
|
391
|
+
|
|
392
|
+
/** One health check of an instance. */
|
|
393
|
+
export interface HealthCheck {
|
|
394
|
+
/** What the check observes. */
|
|
395
|
+
kind?: HealthCheck_Kind;
|
|
396
|
+
/** Whose the subject is, derived from `kind`. */
|
|
397
|
+
category?: HealthCheck_Category;
|
|
398
|
+
/** Its outcome. */
|
|
399
|
+
outcome?: HealthCheck_Outcome;
|
|
400
|
+
/** When the check came to `outcome`; empty while nothing has observed it. */
|
|
401
|
+
changeTime?: string;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/** What a check observes. */
|
|
405
|
+
export const HealthCheck_Kind = {
|
|
406
|
+
/** Not set. */
|
|
407
|
+
KIND_UNSPECIFIED: "KIND_UNSPECIFIED",
|
|
408
|
+
/** The machine the instance runs on answers. */
|
|
409
|
+
HOST_REACHABLE: "HOST_REACHABLE",
|
|
410
|
+
/** The machine reports the virtual machine in the state it should be in. */
|
|
411
|
+
DOMAIN_STATE: "DOMAIN_STATE",
|
|
412
|
+
/** The instance answers on its network interface. */
|
|
413
|
+
NETWORK_REACHABLE: "NETWORK_REACHABLE",
|
|
414
|
+
/** The agent in the guest answers. */
|
|
415
|
+
GUEST_AGENT: "GUEST_AGENT",
|
|
416
|
+
/** The virtual machine exists on its machine. */
|
|
417
|
+
GUEST_PRESENT: "GUEST_PRESENT",
|
|
418
|
+
} as const;
|
|
419
|
+
|
|
420
|
+
/** What a check observes. */
|
|
421
|
+
export type HealthCheck_Kind = (typeof HealthCheck_Kind)[keyof typeof HealthCheck_Kind];
|
|
422
|
+
|
|
423
|
+
/** Whose a check's subject is. */
|
|
424
|
+
export const HealthCheck_Category = {
|
|
425
|
+
/** Not set. */
|
|
426
|
+
CATEGORY_UNSPECIFIED: "CATEGORY_UNSPECIFIED",
|
|
427
|
+
/** The platform underneath the instance. */
|
|
428
|
+
SYSTEM: "SYSTEM",
|
|
429
|
+
/** The instance's own operating system and network configuration. */
|
|
430
|
+
INSTANCE: "INSTANCE",
|
|
431
|
+
} as const;
|
|
432
|
+
|
|
433
|
+
/** Whose a check's subject is. */
|
|
434
|
+
export type HealthCheck_Category = (typeof HealthCheck_Category)[keyof typeof HealthCheck_Category];
|
|
435
|
+
|
|
436
|
+
/** A check's outcome. */
|
|
437
|
+
export const HealthCheck_Outcome = {
|
|
438
|
+
/** Not set. */
|
|
439
|
+
OUTCOME_UNSPECIFIED: "OUTCOME_UNSPECIFIED",
|
|
440
|
+
/** Passed. */
|
|
441
|
+
OK: "OK",
|
|
442
|
+
/** Failed. */
|
|
443
|
+
IMPAIRED: "IMPAIRED",
|
|
444
|
+
/** No recent observation. */
|
|
445
|
+
INSUFFICIENT_DATA: "INSUFFICIENT_DATA",
|
|
446
|
+
/** The check doesn't apply now. */
|
|
447
|
+
NOT_APPLICABLE: "NOT_APPLICABLE",
|
|
448
|
+
} as const;
|
|
449
|
+
|
|
450
|
+
/** A check's outcome. */
|
|
451
|
+
export type HealthCheck_Outcome = (typeof HealthCheck_Outcome)[keyof typeof HealthCheck_Outcome];
|
|
452
|
+
|
|
453
|
+
/** The request for GetInstance. */
|
|
454
|
+
export interface GetInstanceRequest {
|
|
455
|
+
/** The instance to return. */
|
|
456
|
+
name?: string;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/** The request for ListInstances. */
|
|
460
|
+
export interface ListInstancesRequest {
|
|
461
|
+
/** The zone whose instances to list, `projects/{project}/zones/{zone}`. */
|
|
462
|
+
parent?: string;
|
|
463
|
+
/**
|
|
464
|
+
* The most instances to return; the server clamps it, and 0 means its
|
|
465
|
+
* default.
|
|
466
|
+
*/
|
|
467
|
+
pageSize?: number;
|
|
468
|
+
/** A previous response's `nextPageToken`, for the page after it. */
|
|
469
|
+
pageToken?: string;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/** The response for ListInstances. */
|
|
473
|
+
export interface ListInstancesResponse {
|
|
474
|
+
/** The instances on this page. */
|
|
475
|
+
instances?: Instance[];
|
|
476
|
+
/** The token for the next page; empty on the last one. */
|
|
477
|
+
nextPageToken?: string;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/** The request for CreateInstance. */
|
|
481
|
+
export interface CreateInstanceRequest {
|
|
482
|
+
/** The zone to launch the instance in, `projects/{project}/zones/{zone}`. */
|
|
483
|
+
parent?: string;
|
|
484
|
+
/**
|
|
485
|
+
* The instance to launch: its type, its image or image family, its key
|
|
486
|
+
* pair and its network interface, and optionally its login user, boot
|
|
487
|
+
* volume and tags.
|
|
488
|
+
*/
|
|
489
|
+
instance?: Instance;
|
|
490
|
+
/**
|
|
491
|
+
* A UUID; a repeat with the same id returns the first request's
|
|
492
|
+
* operation instead of launching a second instance.
|
|
493
|
+
*/
|
|
494
|
+
requestId?: string;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/** The request for UpdateInstance. */
|
|
498
|
+
export interface UpdateInstanceRequest {
|
|
499
|
+
/** The instance, by its name, with the fields to change. */
|
|
500
|
+
instance?: Instance;
|
|
501
|
+
/** The fields to change: `instanceType`, `tags`, or both. `*` is both. */
|
|
502
|
+
updateMask?: string;
|
|
503
|
+
/**
|
|
504
|
+
* A UUID; a repeat with the same id returns the first request's
|
|
505
|
+
* operation instead of changing the instance again.
|
|
506
|
+
*/
|
|
507
|
+
requestId?: string;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/** The request for DeleteInstance. */
|
|
511
|
+
export interface DeleteInstanceRequest {
|
|
512
|
+
/** The instance to terminate. */
|
|
513
|
+
name?: string;
|
|
514
|
+
/**
|
|
515
|
+
* A UUID; a repeat with the same id returns the first request's
|
|
516
|
+
* operation.
|
|
517
|
+
*/
|
|
518
|
+
requestId?: string;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/** The request for StartInstance. */
|
|
522
|
+
export interface StartInstanceRequest {
|
|
523
|
+
/** The instance to start. */
|
|
524
|
+
name?: string;
|
|
525
|
+
/**
|
|
526
|
+
* A UUID; a repeat with the same id returns the first request's
|
|
527
|
+
* operation.
|
|
528
|
+
*/
|
|
529
|
+
requestId?: string;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/** The request for StopInstance. */
|
|
533
|
+
export interface StopInstanceRequest {
|
|
534
|
+
/** The instance to stop. */
|
|
535
|
+
name?: string;
|
|
536
|
+
/**
|
|
537
|
+
* A UUID; a repeat with the same id returns the first request's
|
|
538
|
+
* operation.
|
|
539
|
+
*/
|
|
540
|
+
requestId?: string;
|
|
541
|
+
}
|