@homeflare/distilled-proxmox 0.3.0 → 0.3.1

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.
@@ -1,6 +1,7 @@
1
1
  // AUTO-GENERATED by scripts/generate.ts from .generated-specs (apidata.js, via scripts/apidoc.ts — see its header). Do not edit.
2
2
  import * as S from "@distilled.cloud/core/schema";
3
3
  import * as API from "@distilled.cloud/core/api";
4
+ import * as C from "@distilled.cloud/core/category";
4
5
  import * as T from "../traits.ts";
5
6
  import {
6
7
  ProxmoxProtocol,
@@ -11,6 +12,35 @@ import * as Retry from "../retry.ts";
11
12
 
12
13
  export type { ProxmoxOpError, ProxmoxOpContext };
13
14
 
15
+ /** The backup job does not exist. pve-manager 9.2.11, f6997e698c7933ea8e62319e2bf1bf7262daa56a, PVE/API2/Backup.pm:406,458,755 raises a 400 parameter exception with exactly errors.id = No such job '<id>'. The Proxmox protocol extracts that sole precise detail for matching; unrelated or multi-field validation errors never become absence. Update uses a different exception and is deliberately not attached. */
16
+ export class BackupJobNotFound
17
+ extends /*@__PURE__*/ T.applyErrorMatchers(
18
+ /*@__PURE__*/ S.TaggedError<BackupJobNotFound>()("BackupJobNotFound", {
19
+ message: S.String,
20
+ }).pipe(C.withBadRequestError),
21
+ [{ status: 400, message: { matches: "^No such job '[^']+'$" } }],
22
+ ) {}
23
+
24
+ /** The metrics server does not exist. pve-manager 9.2.11, f6997e698c7933ea8e62319e2bf1bf7262daa56a, PVE/API2/Cluster/MetricServer.pm:136 throws status server entry '<id>' does not exist on GET, and line 228 throws no such server '<id>' on PUT. Both are wire 500. DELETE dereferences the plugin config without an explicit absence check and is not declared to return this tag. */
25
+ export class MetricServerNotFound
26
+ extends /*@__PURE__*/ T.applyErrorMatchers(
27
+ /*@__PURE__*/ S.TaggedError<MetricServerNotFound>()(
28
+ "MetricServerNotFound",
29
+ {
30
+ message: S.String,
31
+ },
32
+ ).pipe(C.withBadRequestError),
33
+ [
34
+ {
35
+ status: 500,
36
+ message: {
37
+ matches: "^status server entry '[^']+' does not exist\\n?$",
38
+ },
39
+ },
40
+ { status: 500, message: { matches: "^no such server '[^']+'\\n?$" } },
41
+ ],
42
+ ) {}
43
+
14
44
  export interface CreateClusterAcmeAccountRequest {
15
45
  /** Contact email addresses. */
16
46
  contact: string;
@@ -15170,7 +15200,7 @@ export const deleteClusterAcmePlugin: API.OperationMethod<
15170
15200
  retry: Retry.Retry,
15171
15201
  }));
15172
15202
 
15173
- export type DeleteClusterBackupError = ProxmoxOpError;
15203
+ export type DeleteClusterBackupError = BackupJobNotFound | ProxmoxOpError;
15174
15204
  /** Delete vzdump backup job definition. (root-privileged endpoint) */
15175
15205
  export const deleteClusterBackup: API.OperationMethod<
15176
15206
  DeleteClusterBackupRequest,
@@ -15180,7 +15210,7 @@ export const deleteClusterBackup: API.OperationMethod<
15180
15210
  > = /*@__PURE__*/ API.make(() => ({
15181
15211
  input: DeleteClusterBackupRequest,
15182
15212
  output: DeleteClusterBackupResponse,
15183
- errors: [],
15213
+ errors: [BackupJobNotFound],
15184
15214
  protocol: ProxmoxProtocol,
15185
15215
  retry: Retry.Retry,
15186
15216
  }));
@@ -15785,7 +15815,7 @@ export const getClusterAcmeTos: API.OperationMethod<
15785
15815
  retry: Retry.Retry,
15786
15816
  }));
15787
15817
 
15788
- export type GetClusterBackupError = ProxmoxOpError;
15818
+ export type GetClusterBackupError = BackupJobNotFound | ProxmoxOpError;
15789
15819
  /** Read vzdump backup job definition. */
15790
15820
  export const getClusterBackup: API.OperationMethod<
15791
15821
  GetClusterBackupRequest,
@@ -15795,12 +15825,14 @@ export const getClusterBackup: API.OperationMethod<
15795
15825
  > = /*@__PURE__*/ API.make(() => ({
15796
15826
  input: GetClusterBackupRequest,
15797
15827
  output: GetClusterBackupResponse,
15798
- errors: [],
15828
+ errors: [BackupJobNotFound],
15799
15829
  protocol: ProxmoxProtocol,
15800
15830
  retry: Retry.Retry,
15801
15831
  }));
15802
15832
 
15803
- export type GetClusterBackupIncludedVolumesError = ProxmoxOpError;
15833
+ export type GetClusterBackupIncludedVolumesError =
15834
+ | BackupJobNotFound
15835
+ | ProxmoxOpError;
15804
15836
  /** Returns included guests and the backup status of their disks. Optimized to be used in ExtJS tree views. (root-privileged endpoint) */
15805
15837
  export const getClusterBackupIncludedVolumes: API.OperationMethod<
15806
15838
  GetClusterBackupIncludedVolumesRequest,
@@ -15810,7 +15842,7 @@ export const getClusterBackupIncludedVolumes: API.OperationMethod<
15810
15842
  > = /*@__PURE__*/ API.make(() => ({
15811
15843
  input: GetClusterBackupIncludedVolumesRequest,
15812
15844
  output: GetClusterBackupIncludedVolumesResponse,
15813
- errors: [],
15845
+ errors: [BackupJobNotFound],
15814
15846
  protocol: ProxmoxProtocol,
15815
15847
  retry: Retry.Retry,
15816
15848
  }));
@@ -16160,7 +16192,9 @@ export const getClusterMetricsExport: API.OperationMethod<
16160
16192
  retry: Retry.Retry,
16161
16193
  }));
16162
16194
 
16163
- export type GetClusterMetricsServerError = ProxmoxOpError;
16195
+ export type GetClusterMetricsServerError =
16196
+ | MetricServerNotFound
16197
+ | ProxmoxOpError;
16164
16198
  /** Read metric server configuration. */
16165
16199
  export const getClusterMetricsServer: API.OperationMethod<
16166
16200
  GetClusterMetricsServerRequest,
@@ -16170,7 +16204,7 @@ export const getClusterMetricsServer: API.OperationMethod<
16170
16204
  > = /*@__PURE__*/ API.make(() => ({
16171
16205
  input: GetClusterMetricsServerRequest,
16172
16206
  output: GetClusterMetricsServerResponse,
16173
- errors: [],
16207
+ errors: [MetricServerNotFound],
16174
16208
  protocol: ProxmoxProtocol,
16175
16209
  retry: Retry.Retry,
16176
16210
  }));
@@ -17990,7 +18024,9 @@ export const putClusterMappingUsb: API.OperationMethod<
17990
18024
  retry: Retry.Retry,
17991
18025
  }));
17992
18026
 
17993
- export type PutClusterMetricsServerError = ProxmoxOpError;
18027
+ export type PutClusterMetricsServerError =
18028
+ | MetricServerNotFound
18029
+ | ProxmoxOpError;
17994
18030
  /** Update metric server configuration. (root-privileged endpoint) */
17995
18031
  export const putClusterMetricsServer: API.OperationMethod<
17996
18032
  PutClusterMetricsServerRequest,
@@ -18000,7 +18036,7 @@ export const putClusterMetricsServer: API.OperationMethod<
18000
18036
  > = /*@__PURE__*/ API.make(() => ({
18001
18037
  input: PutClusterMetricsServerRequest,
18002
18038
  output: PutClusterMetricsServerResponse,
18003
- errors: [],
18039
+ errors: [MetricServerNotFound],
18004
18040
  protocol: ProxmoxProtocol,
18005
18041
  retry: Retry.Retry,
18006
18042
  }));
@@ -1,6 +1,7 @@
1
1
  // AUTO-GENERATED by scripts/generate.ts from .generated-specs (apidata.js, via scripts/apidoc.ts — see its header). Do not edit.
2
2
  import * as S from "@distilled.cloud/core/schema";
3
3
  import * as API from "@distilled.cloud/core/api";
4
+ import * as C from "@distilled.cloud/core/category";
4
5
  import * as T from "../traits.ts";
5
6
  import {
6
7
  ProxmoxProtocol,
@@ -11,6 +12,20 @@ import * as Retry from "../retry.ts";
11
12
 
12
13
  export type { ProxmoxOpError, ProxmoxOpContext };
13
14
 
15
+ /** The resource pool does not exist. pve-manager 9.2.11, f6997e698c7933ea8e62319e2bf1bf7262daa56a, PVE/API2/Pool.pm:106,327,512 throws pool '<poolid>' does not exist in the read, update and delete handlers. Deprecated item routes delegate to them. The wire status is 500; a nonempty pool refusal or missing parent during create is a different error and must not match. */
16
+ export class PoolNotFound
17
+ extends /*@__PURE__*/ T.applyErrorMatchers(
18
+ /*@__PURE__*/ S.TaggedError<PoolNotFound>()("PoolNotFound", {
19
+ message: S.String,
20
+ }).pipe(C.withBadRequestError),
21
+ [
22
+ {
23
+ status: 500,
24
+ message: { matches: "^pool '[^']+' does not exist\\n?$" },
25
+ },
26
+ ],
27
+ ) {}
28
+
14
29
  export interface CreatePoolRequest {
15
30
  comment?: string;
16
31
  poolid: string;
@@ -299,7 +314,7 @@ export const createPool: API.OperationMethod<
299
314
  retry: Retry.Retry,
300
315
  }));
301
316
 
302
- export type DeletePoolError = ProxmoxOpError;
317
+ export type DeletePoolError = PoolNotFound | ProxmoxOpError;
303
318
  /** Delete pool (deprecated, no support for nested pools, use 'DELETE /pools/?poolid={poolid}'). (root-privileged endpoint) */
304
319
  export const deletePool: API.OperationMethod<
305
320
  DeletePoolRequest,
@@ -309,12 +324,12 @@ export const deletePool: API.OperationMethod<
309
324
  > = /*@__PURE__*/ API.make(() => ({
310
325
  input: DeletePoolRequest,
311
326
  output: DeletePoolResponse,
312
- errors: [],
327
+ errors: [PoolNotFound],
313
328
  protocol: ProxmoxProtocol,
314
329
  retry: Retry.Retry,
315
330
  }));
316
331
 
317
- export type DeletePoolsError = ProxmoxOpError;
332
+ export type DeletePoolsError = PoolNotFound | ProxmoxOpError;
318
333
  /** Delete pool. (root-privileged endpoint) */
319
334
  export const deletePools: API.OperationMethod<
320
335
  DeletePoolsRequest,
@@ -324,12 +339,12 @@ export const deletePools: API.OperationMethod<
324
339
  > = /*@__PURE__*/ API.make(() => ({
325
340
  input: DeletePoolsRequest,
326
341
  output: DeletePoolsResponse,
327
- errors: [],
342
+ errors: [PoolNotFound],
328
343
  protocol: ProxmoxProtocol,
329
344
  retry: Retry.Retry,
330
345
  }));
331
346
 
332
- export type GetPoolError = ProxmoxOpError;
347
+ export type GetPoolError = PoolNotFound | ProxmoxOpError;
333
348
  /** Get pool configuration (deprecated, no support for nested pools, use 'GET /pools/?poolid={poolid}'). */
334
349
  export const getPool: API.OperationMethod<
335
350
  GetPoolRequest,
@@ -339,12 +354,12 @@ export const getPool: API.OperationMethod<
339
354
  > = /*@__PURE__*/ API.make(() => ({
340
355
  input: GetPoolRequest,
341
356
  output: GetPoolResponse,
342
- errors: [],
357
+ errors: [PoolNotFound],
343
358
  protocol: ProxmoxProtocol,
344
359
  retry: Retry.Retry,
345
360
  }));
346
361
 
347
- export type ListPoolsError = ProxmoxOpError;
362
+ export type ListPoolsError = PoolNotFound | ProxmoxOpError;
348
363
  /** List pools or get pool configuration. */
349
364
  export const listPools: API.OperationMethod<
350
365
  ListPoolsRequest,
@@ -354,12 +369,12 @@ export const listPools: API.OperationMethod<
354
369
  > = /*@__PURE__*/ API.make(() => ({
355
370
  input: ListPoolsRequest,
356
371
  output: ListPoolsResponse,
357
- errors: [],
372
+ errors: [PoolNotFound],
358
373
  protocol: ProxmoxProtocol,
359
374
  retry: Retry.Retry,
360
375
  }));
361
376
 
362
- export type PutPoolError = ProxmoxOpError;
377
+ export type PutPoolError = PoolNotFound | ProxmoxOpError;
363
378
  /** Update pool data (deprecated, no support for nested pools - use 'PUT /pools/?poolid={poolid}' instead). (root-privileged endpoint) */
364
379
  export const putPool: API.OperationMethod<
365
380
  PutPoolRequest,
@@ -369,12 +384,12 @@ export const putPool: API.OperationMethod<
369
384
  > = /*@__PURE__*/ API.make(() => ({
370
385
  input: PutPoolRequest,
371
386
  output: PutPoolResponse,
372
- errors: [],
387
+ errors: [PoolNotFound],
373
388
  protocol: ProxmoxProtocol,
374
389
  retry: Retry.Retry,
375
390
  }));
376
391
 
377
- export type PutPoolsError = ProxmoxOpError;
392
+ export type PutPoolsError = PoolNotFound | ProxmoxOpError;
378
393
  /** Update pool. (root-privileged endpoint) */
379
394
  export const putPools: API.OperationMethod<
380
395
  PutPoolsRequest,
@@ -384,7 +399,7 @@ export const putPools: API.OperationMethod<
384
399
  > = /*@__PURE__*/ API.make(() => ({
385
400
  input: PutPoolsRequest,
386
401
  output: PutPoolsResponse,
387
- errors: [],
402
+ errors: [PoolNotFound],
388
403
  protocol: ProxmoxProtocol,
389
404
  retry: Retry.Retry,
390
405
  }));