@nilovonjs/hcloud-js 1.0.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/README.md +90 -0
- package/package.json +70 -0
- package/src/apis/actions/index.ts +113 -0
- package/src/apis/actions/schemas.ts +59 -0
- package/src/apis/actions/types.ts +77 -0
- package/src/apis/certificates/index.ts +326 -0
- package/src/apis/certificates/schemas.ts +140 -0
- package/src/apis/certificates/types.ts +176 -0
- package/src/apis/common/schemas.ts +19 -0
- package/src/apis/dns/index.ts +961 -0
- package/src/apis/dns/schemas.ts +437 -0
- package/src/apis/dns/types.ts +397 -0
- package/src/apis/firewalls/index.ts +469 -0
- package/src/apis/firewalls/schemas.ts +274 -0
- package/src/apis/firewalls/types.ts +205 -0
- package/src/apis/floating-ips/index.ts +466 -0
- package/src/apis/floating-ips/schemas.ts +203 -0
- package/src/apis/floating-ips/types.ts +207 -0
- package/src/apis/images/index.ts +195 -0
- package/src/apis/images/schemas.ts +113 -0
- package/src/apis/images/types.ts +124 -0
- package/src/apis/isos/index.ts +91 -0
- package/src/apis/isos/schemas.ts +43 -0
- package/src/apis/isos/types.ts +60 -0
- package/src/apis/load-balancers/index.ts +892 -0
- package/src/apis/load-balancers/schemas.ts +561 -0
- package/src/apis/load-balancers/types.ts +361 -0
- package/src/apis/locations/index.ts +176 -0
- package/src/apis/locations/schemas.ts +83 -0
- package/src/apis/locations/types.ts +113 -0
- package/src/apis/networks/index.ts +544 -0
- package/src/apis/networks/schemas.ts +279 -0
- package/src/apis/networks/types.ts +243 -0
- package/src/apis/placement-groups/index.ts +212 -0
- package/src/apis/placement-groups/schemas.ts +90 -0
- package/src/apis/placement-groups/types.ts +99 -0
- package/src/apis/pricing/index.ts +42 -0
- package/src/apis/pricing/schemas.ts +93 -0
- package/src/apis/pricing/types.ts +71 -0
- package/src/apis/primary-ips/index.ts +467 -0
- package/src/apis/primary-ips/schemas.ts +221 -0
- package/src/apis/primary-ips/types.ts +221 -0
- package/src/apis/server-types/index.ts +93 -0
- package/src/apis/server-types/schemas.ts +29 -0
- package/src/apis/server-types/types.ts +43 -0
- package/src/apis/servers/index.ts +378 -0
- package/src/apis/servers/schemas.ts +771 -0
- package/src/apis/servers/types.ts +538 -0
- package/src/apis/ssh-keys/index.ts +204 -0
- package/src/apis/ssh-keys/schemas.ts +84 -0
- package/src/apis/ssh-keys/types.ts +106 -0
- package/src/apis/volumes/index.ts +452 -0
- package/src/apis/volumes/schemas.ts +195 -0
- package/src/apis/volumes/types.ts +197 -0
- package/src/auth/index.ts +26 -0
- package/src/base/index.ts +10 -0
- package/src/client/index.ts +388 -0
- package/src/config/index.ts +34 -0
- package/src/errors/index.ts +38 -0
- package/src/index.ts +799 -0
- package/src/types/index.ts +37 -0
- package/src/validation/index.ts +109 -0
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for Hetzner Cloud Load Balancers API
|
|
3
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { actionSchema, actionResourceSchema } from "@/apis/actions/schemas";
|
|
8
|
+
import { paginationMetaSchema } from "@/apis/common/schemas";
|
|
9
|
+
import { locationSchema } from "@/apis/servers/schemas";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Load Balancer algorithm type schema
|
|
13
|
+
*/
|
|
14
|
+
export const loadBalancerAlgorithmTypeSchema = z.enum(["round_robin", "least_connections"]);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Load Balancer service protocol schema
|
|
18
|
+
*/
|
|
19
|
+
export const loadBalancerServiceProtocolSchema = z.enum(["http", "https", "tcp"]);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Load Balancer target type schema
|
|
23
|
+
*/
|
|
24
|
+
export const loadBalancerTargetTypeSchema = z.enum(["server", "label_selector", "ip"]);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Load Balancer service health check protocol schema
|
|
28
|
+
*/
|
|
29
|
+
export const loadBalancerServiceHealthCheckProtocolSchema = z.enum(["http", "https", "tcp"]);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Load Balancer service health check HTTP config schema
|
|
33
|
+
*/
|
|
34
|
+
export const loadBalancerServiceHealthCheckHttpConfigSchema = z.object({
|
|
35
|
+
domain: z.string().nullable(),
|
|
36
|
+
path: z.string(),
|
|
37
|
+
response: z.string().nullable(),
|
|
38
|
+
status_codes: z.array(z.string()).nullable(),
|
|
39
|
+
tls: z.boolean().optional(),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Load Balancer service health check schema
|
|
44
|
+
*/
|
|
45
|
+
export const loadBalancerServiceHealthCheckSchema = z.object({
|
|
46
|
+
protocol: loadBalancerServiceHealthCheckProtocolSchema,
|
|
47
|
+
port: z.number(),
|
|
48
|
+
interval: z.number(),
|
|
49
|
+
timeout: z.number(),
|
|
50
|
+
retries: z.number(),
|
|
51
|
+
http: loadBalancerServiceHealthCheckHttpConfigSchema.optional(),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Load Balancer service HTTP config schema
|
|
56
|
+
*/
|
|
57
|
+
export const loadBalancerServiceHttpConfigSchema = z.object({
|
|
58
|
+
sticky_sessions: z.boolean().optional(),
|
|
59
|
+
cookie_name: z.string().optional(),
|
|
60
|
+
cookie_lifetime: z.number().optional(),
|
|
61
|
+
certificates: z.array(z.number()).optional(),
|
|
62
|
+
redirect_http: z.boolean().optional(),
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Load Balancer service schema
|
|
67
|
+
*/
|
|
68
|
+
export const loadBalancerServiceSchema = z.object({
|
|
69
|
+
protocol: loadBalancerServiceProtocolSchema,
|
|
70
|
+
listen_port: z.number(),
|
|
71
|
+
destination_port: z.number(),
|
|
72
|
+
proxyprotocol: z.boolean(),
|
|
73
|
+
http: loadBalancerServiceHttpConfigSchema.optional(),
|
|
74
|
+
health_check: loadBalancerServiceHealthCheckSchema,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Load Balancer target IP schema
|
|
79
|
+
*/
|
|
80
|
+
export const loadBalancerTargetIpSchema = z.object({
|
|
81
|
+
ip: z.string(),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Load Balancer target label selector schema
|
|
86
|
+
*/
|
|
87
|
+
export const loadBalancerTargetLabelSelectorSchema = z.object({
|
|
88
|
+
selector: z.string(),
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Load Balancer target server schema
|
|
93
|
+
*/
|
|
94
|
+
export const loadBalancerTargetServerSchema = z.object({
|
|
95
|
+
id: z.number(),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Load Balancer target health status schema
|
|
100
|
+
*/
|
|
101
|
+
export const loadBalancerTargetHealthStatusSchema = z.object({
|
|
102
|
+
listen_port: z.number().nullable(),
|
|
103
|
+
status: z.enum(["healthy", "health_check_failed", "unknown"]),
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Load Balancer target schema
|
|
108
|
+
*/
|
|
109
|
+
export const loadBalancerTargetSchema = z.object({
|
|
110
|
+
type: loadBalancerTargetTypeSchema,
|
|
111
|
+
server: loadBalancerTargetServerSchema.optional(),
|
|
112
|
+
label_selector: loadBalancerTargetLabelSelectorSchema.optional(),
|
|
113
|
+
ip: loadBalancerTargetIpSchema.optional(),
|
|
114
|
+
use_private_ip: z.boolean().optional(),
|
|
115
|
+
health_status: z.array(loadBalancerTargetHealthStatusSchema).optional(),
|
|
116
|
+
targets: z.array(loadBalancerTargetHealthStatusSchema).optional(),
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Load Balancer protection schema
|
|
121
|
+
*/
|
|
122
|
+
export const loadBalancerProtectionSchema = z.object({
|
|
123
|
+
delete: z.boolean(),
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Load Balancer schema
|
|
128
|
+
*/
|
|
129
|
+
export const loadBalancerSchema = z
|
|
130
|
+
.object({
|
|
131
|
+
id: z.number(),
|
|
132
|
+
name: z.string(),
|
|
133
|
+
public_net: z.object({
|
|
134
|
+
enabled: z.boolean(),
|
|
135
|
+
ipv4: z
|
|
136
|
+
.object({
|
|
137
|
+
ip: z.string().nullable(),
|
|
138
|
+
dns_ptr: z.string().nullable(),
|
|
139
|
+
})
|
|
140
|
+
.nullable(),
|
|
141
|
+
ipv6: z
|
|
142
|
+
.object({
|
|
143
|
+
ip: z.string().nullable(),
|
|
144
|
+
dns_ptr: z.string().nullable(),
|
|
145
|
+
})
|
|
146
|
+
.nullable(),
|
|
147
|
+
}),
|
|
148
|
+
private_net: z
|
|
149
|
+
.array(
|
|
150
|
+
z.object({
|
|
151
|
+
network: z.number(),
|
|
152
|
+
ip: z.string().nullable(),
|
|
153
|
+
}),
|
|
154
|
+
)
|
|
155
|
+
.optional(),
|
|
156
|
+
location: locationSchema,
|
|
157
|
+
load_balancer_type: z.object({
|
|
158
|
+
id: z.number(),
|
|
159
|
+
name: z.string(),
|
|
160
|
+
description: z.string(),
|
|
161
|
+
max_connections: z.number(),
|
|
162
|
+
max_services: z.number(),
|
|
163
|
+
max_targets: z.number(),
|
|
164
|
+
max_assigned_certificates: z.number(),
|
|
165
|
+
prices: z.array(
|
|
166
|
+
z.object({
|
|
167
|
+
location: z.string(),
|
|
168
|
+
price_hourly: z.object({
|
|
169
|
+
gross: z.string(),
|
|
170
|
+
net: z.string(),
|
|
171
|
+
}),
|
|
172
|
+
price_monthly: z.object({
|
|
173
|
+
gross: z.string(),
|
|
174
|
+
net: z.string(),
|
|
175
|
+
}),
|
|
176
|
+
}),
|
|
177
|
+
),
|
|
178
|
+
}),
|
|
179
|
+
algorithm: z.object({
|
|
180
|
+
type: loadBalancerAlgorithmTypeSchema,
|
|
181
|
+
}),
|
|
182
|
+
services: z.array(loadBalancerServiceSchema),
|
|
183
|
+
targets: z.array(loadBalancerTargetSchema),
|
|
184
|
+
labels: z.record(z.string(), z.string()),
|
|
185
|
+
created: z.string(),
|
|
186
|
+
included_traffic: z.number(),
|
|
187
|
+
ingoing_traffic: z.number().nullable(),
|
|
188
|
+
outgoing_traffic: z.number().nullable(),
|
|
189
|
+
protection: loadBalancerProtectionSchema,
|
|
190
|
+
blocking: z.array(actionResourceSchema).optional(),
|
|
191
|
+
})
|
|
192
|
+
.passthrough();
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* List Load Balancers response schema
|
|
196
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-list-load-balancers
|
|
197
|
+
*/
|
|
198
|
+
export const listLoadBalancersResponseSchema = z.object({
|
|
199
|
+
load_balancers: z.array(loadBalancerSchema),
|
|
200
|
+
meta: z
|
|
201
|
+
.object({
|
|
202
|
+
pagination: paginationMetaSchema,
|
|
203
|
+
})
|
|
204
|
+
.optional(),
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Create Load Balancer request schema
|
|
209
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-create-a-load-balancer
|
|
210
|
+
*/
|
|
211
|
+
export const createLoadBalancerRequestSchema = z.object({
|
|
212
|
+
name: z.string(),
|
|
213
|
+
load_balancer_type: z.union([z.string(), z.number()]),
|
|
214
|
+
algorithm: z
|
|
215
|
+
.object({
|
|
216
|
+
type: loadBalancerAlgorithmTypeSchema,
|
|
217
|
+
})
|
|
218
|
+
.optional(),
|
|
219
|
+
location: z.string().optional(),
|
|
220
|
+
network_zone: z.string().optional(),
|
|
221
|
+
public_interface: z.boolean().optional(),
|
|
222
|
+
services: z.array(loadBalancerServiceSchema).optional(),
|
|
223
|
+
targets: z.array(loadBalancerTargetSchema).optional(),
|
|
224
|
+
labels: z.record(z.string(), z.string()).optional(),
|
|
225
|
+
network: z.number().optional(),
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Create Load Balancer response schema
|
|
230
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-create-a-load-balancer
|
|
231
|
+
*/
|
|
232
|
+
export const createLoadBalancerResponseSchema = z.object({
|
|
233
|
+
load_balancer: loadBalancerSchema,
|
|
234
|
+
action: actionSchema,
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Get Load Balancer response schema
|
|
239
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-get-a-load-balancer
|
|
240
|
+
*/
|
|
241
|
+
export const getLoadBalancerResponseSchema = z.object({
|
|
242
|
+
load_balancer: loadBalancerSchema,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Update Load Balancer request schema
|
|
247
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-update-a-load-balancer
|
|
248
|
+
*/
|
|
249
|
+
export const updateLoadBalancerRequestSchema = z.object({
|
|
250
|
+
name: z.string().optional(),
|
|
251
|
+
labels: z.record(z.string(), z.string()).optional(),
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Update Load Balancer response schema
|
|
256
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-update-a-load-balancer
|
|
257
|
+
*/
|
|
258
|
+
export const updateLoadBalancerResponseSchema = z.object({
|
|
259
|
+
load_balancer: loadBalancerSchema,
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Delete Load Balancer response schema
|
|
264
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-delete-a-load-balancer
|
|
265
|
+
*/
|
|
266
|
+
export const deleteLoadBalancerResponseSchema = z.object({
|
|
267
|
+
action: actionSchema.optional(),
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* List Load Balancer Actions response schema
|
|
272
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-list-actions-for-a-load-balancer
|
|
273
|
+
*/
|
|
274
|
+
export const listLoadBalancerActionsResponseSchema = z.object({
|
|
275
|
+
actions: z.array(actionSchema),
|
|
276
|
+
meta: z
|
|
277
|
+
.object({
|
|
278
|
+
pagination: paginationMetaSchema,
|
|
279
|
+
})
|
|
280
|
+
.optional(),
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Get Load Balancer Action response schema
|
|
285
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-get-an-action-for-a-load-balancer
|
|
286
|
+
*/
|
|
287
|
+
export const getLoadBalancerActionResponseSchema = z.object({
|
|
288
|
+
action: actionSchema,
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Add Load Balancer Service request schema
|
|
293
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-add-service
|
|
294
|
+
*/
|
|
295
|
+
export const addLoadBalancerServiceRequestSchema = z.object({
|
|
296
|
+
protocol: loadBalancerServiceProtocolSchema,
|
|
297
|
+
listen_port: z.number(),
|
|
298
|
+
destination_port: z.number(),
|
|
299
|
+
proxyprotocol: z.boolean().optional(),
|
|
300
|
+
http: loadBalancerServiceHttpConfigSchema.optional(),
|
|
301
|
+
health_check: loadBalancerServiceHealthCheckSchema,
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Add Load Balancer Service response schema
|
|
306
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-add-service
|
|
307
|
+
*/
|
|
308
|
+
export const addLoadBalancerServiceResponseSchema = z.object({
|
|
309
|
+
action: actionSchema,
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Update Load Balancer Service request schema
|
|
314
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-update-service
|
|
315
|
+
*/
|
|
316
|
+
export const updateLoadBalancerServiceRequestSchema = z.object({
|
|
317
|
+
destination_port: z.number().optional(),
|
|
318
|
+
proxyprotocol: z.boolean().optional(),
|
|
319
|
+
http: loadBalancerServiceHttpConfigSchema.optional(),
|
|
320
|
+
health_check: loadBalancerServiceHealthCheckSchema.optional(),
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Update Load Balancer Service response schema
|
|
325
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-update-service
|
|
326
|
+
*/
|
|
327
|
+
export const updateLoadBalancerServiceResponseSchema = z.object({
|
|
328
|
+
action: actionSchema,
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Delete Load Balancer Service request schema
|
|
333
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-delete-service
|
|
334
|
+
*/
|
|
335
|
+
export const deleteLoadBalancerServiceRequestSchema = z.object({});
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Delete Load Balancer Service response schema
|
|
339
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-delete-service
|
|
340
|
+
*/
|
|
341
|
+
export const deleteLoadBalancerServiceResponseSchema = z.object({
|
|
342
|
+
action: actionSchema,
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Add Load Balancer Target request schema
|
|
347
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-add-target
|
|
348
|
+
*/
|
|
349
|
+
export const addLoadBalancerTargetRequestSchema = z.object({
|
|
350
|
+
type: loadBalancerTargetTypeSchema,
|
|
351
|
+
server: loadBalancerTargetServerSchema.optional(),
|
|
352
|
+
label_selector: loadBalancerTargetLabelSelectorSchema.optional(),
|
|
353
|
+
ip: loadBalancerTargetIpSchema.optional(),
|
|
354
|
+
use_private_ip: z.boolean().optional(),
|
|
355
|
+
targets: z
|
|
356
|
+
.array(
|
|
357
|
+
z.object({
|
|
358
|
+
type: loadBalancerTargetTypeSchema,
|
|
359
|
+
server: loadBalancerTargetServerSchema.optional(),
|
|
360
|
+
label_selector: loadBalancerTargetLabelSelectorSchema.optional(),
|
|
361
|
+
ip: loadBalancerTargetIpSchema.optional(),
|
|
362
|
+
use_private_ip: z.boolean().optional(),
|
|
363
|
+
}),
|
|
364
|
+
)
|
|
365
|
+
.optional(),
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Add Load Balancer Target response schema
|
|
370
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-add-target
|
|
371
|
+
*/
|
|
372
|
+
export const addLoadBalancerTargetResponseSchema = z.object({
|
|
373
|
+
action: actionSchema,
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Remove Load Balancer Target request schema
|
|
378
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-remove-target
|
|
379
|
+
*/
|
|
380
|
+
export const removeLoadBalancerTargetRequestSchema = z.object({
|
|
381
|
+
type: loadBalancerTargetTypeSchema,
|
|
382
|
+
server: loadBalancerTargetServerSchema.optional(),
|
|
383
|
+
label_selector: loadBalancerTargetLabelSelectorSchema.optional(),
|
|
384
|
+
ip: loadBalancerTargetIpSchema.optional(),
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Remove Load Balancer Target response schema
|
|
389
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-remove-target
|
|
390
|
+
*/
|
|
391
|
+
export const removeLoadBalancerTargetResponseSchema = z.object({
|
|
392
|
+
action: actionSchema,
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Change Load Balancer Algorithm request schema
|
|
397
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-change-algorithm
|
|
398
|
+
*/
|
|
399
|
+
export const changeLoadBalancerAlgorithmRequestSchema = z.object({
|
|
400
|
+
type: loadBalancerAlgorithmTypeSchema,
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Change Load Balancer Algorithm response schema
|
|
405
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-change-algorithm
|
|
406
|
+
*/
|
|
407
|
+
export const changeLoadBalancerAlgorithmResponseSchema = z.object({
|
|
408
|
+
action: actionSchema,
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Change Load Balancer reverse DNS request schema
|
|
413
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-change-reverse-dns-entry-for-this-load-balancer
|
|
414
|
+
*/
|
|
415
|
+
export const changeLoadBalancerReverseDNSRequestSchema = z.object({
|
|
416
|
+
ip: z.string(),
|
|
417
|
+
dns_ptr: z.string().nullable(),
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Change Load Balancer reverse DNS response schema
|
|
422
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-change-reverse-dns-entry-for-this-load-balancer
|
|
423
|
+
*/
|
|
424
|
+
export const changeLoadBalancerReverseDNSResponseSchema = z.object({
|
|
425
|
+
action: actionSchema,
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Change Load Balancer Protection request schema
|
|
430
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-change-load-balancer-protection
|
|
431
|
+
*/
|
|
432
|
+
export const changeLoadBalancerProtectionRequestSchema = z.object({
|
|
433
|
+
delete: z.boolean(),
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Change Load Balancer Protection response schema
|
|
438
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-change-load-balancer-protection
|
|
439
|
+
*/
|
|
440
|
+
export const changeLoadBalancerProtectionResponseSchema = z.object({
|
|
441
|
+
action: actionSchema,
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Change Load Balancer Type request schema
|
|
446
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-change-the-type-of-a-load-balancer
|
|
447
|
+
*/
|
|
448
|
+
export const changeLoadBalancerTypeRequestSchema = z.object({
|
|
449
|
+
load_balancer_type: z.union([z.string(), z.number()]),
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Change Load Balancer Type response schema
|
|
454
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-change-the-type-of-a-load-balancer
|
|
455
|
+
*/
|
|
456
|
+
export const changeLoadBalancerTypeResponseSchema = z.object({
|
|
457
|
+
action: actionSchema,
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Attach Load Balancer to Network request schema
|
|
462
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-attach-a-load-balancer-to-a-network
|
|
463
|
+
*/
|
|
464
|
+
export const attachLoadBalancerToNetworkRequestSchema = z.object({
|
|
465
|
+
network: z.number(),
|
|
466
|
+
ip: z.string().optional(),
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Attach Load Balancer to Network response schema
|
|
471
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-attach-a-load-balancer-to-a-network
|
|
472
|
+
*/
|
|
473
|
+
export const attachLoadBalancerToNetworkResponseSchema = z.object({
|
|
474
|
+
action: actionSchema,
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Detach Load Balancer from Network request schema
|
|
479
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-detach-a-load-balancer-from-a-network
|
|
480
|
+
*/
|
|
481
|
+
export const detachLoadBalancerFromNetworkRequestSchema = z.object({});
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Detach Load Balancer from Network response schema
|
|
485
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-detach-a-load-balancer-from-a-network
|
|
486
|
+
*/
|
|
487
|
+
export const detachLoadBalancerFromNetworkResponseSchema = z.object({
|
|
488
|
+
action: actionSchema,
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Enable Load Balancer public interface request schema
|
|
493
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-enable-the-public-interface-of-a-load-balancer
|
|
494
|
+
*/
|
|
495
|
+
export const enableLoadBalancerPublicInterfaceRequestSchema = z.object({});
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Enable Load Balancer public interface response schema
|
|
499
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-enable-the-public-interface-of-a-load-balancer
|
|
500
|
+
*/
|
|
501
|
+
export const enableLoadBalancerPublicInterfaceResponseSchema = z.object({
|
|
502
|
+
action: actionSchema,
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Disable Load Balancer public interface request schema
|
|
507
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-disable-the-public-interface-of-a-load-balancer
|
|
508
|
+
*/
|
|
509
|
+
export const disableLoadBalancerPublicInterfaceRequestSchema = z.object({});
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Disable Load Balancer public interface response schema
|
|
513
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-disable-the-public-interface-of-a-load-balancer
|
|
514
|
+
*/
|
|
515
|
+
export const disableLoadBalancerPublicInterfaceResponseSchema = z.object({
|
|
516
|
+
action: actionSchema,
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Get Load Balancer Metrics request schema
|
|
521
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-get-metrics-for-a-load-balancer
|
|
522
|
+
*/
|
|
523
|
+
export const getLoadBalancerMetricsRequestSchema = z.object({
|
|
524
|
+
type: z.union([z.string(), z.array(z.string())]),
|
|
525
|
+
start: z.string(),
|
|
526
|
+
end: z.string(),
|
|
527
|
+
step: z.number().optional(),
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Load Balancer metrics time series value schema
|
|
532
|
+
*/
|
|
533
|
+
export const loadBalancerMetricsTimeSeriesValueSchema = z.tuple([z.number(), z.string()]);
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Load Balancer metrics time series schema
|
|
537
|
+
*/
|
|
538
|
+
export const loadBalancerMetricsTimeSeriesSchema = z.record(
|
|
539
|
+
z.string(),
|
|
540
|
+
z.object({
|
|
541
|
+
values: z.array(loadBalancerMetricsTimeSeriesValueSchema),
|
|
542
|
+
}),
|
|
543
|
+
);
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Load Balancer metrics schema
|
|
547
|
+
*/
|
|
548
|
+
export const loadBalancerMetricsSchema = z.object({
|
|
549
|
+
start: z.string(),
|
|
550
|
+
end: z.string(),
|
|
551
|
+
step: z.number(),
|
|
552
|
+
time_series: loadBalancerMetricsTimeSeriesSchema,
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Get Load Balancer Metrics response schema
|
|
557
|
+
* @see https://docs.hetzner.cloud/reference/cloud#load-balancers-get-metrics-for-a-load-balancer
|
|
558
|
+
*/
|
|
559
|
+
export const getLoadBalancerMetricsResponseSchema = z.object({
|
|
560
|
+
metrics: loadBalancerMetricsSchema,
|
|
561
|
+
});
|