@openshift-migration-advisor/planner-sdk 0.22.0 → 0.26.0-27992947c82e

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.
Files changed (50) hide show
  1. package/README.md +3 -2
  2. package/dist/apis/AssessmentApi.d.ts +6 -14
  3. package/dist/apis/AssessmentApi.js +6 -9
  4. package/dist/apis/SourceApi.d.ts +47 -4
  5. package/dist/apis/SourceApi.js +63 -2
  6. package/dist/esm/apis/AssessmentApi.d.ts +6 -14
  7. package/dist/esm/apis/AssessmentApi.js +6 -9
  8. package/dist/esm/apis/SourceApi.d.ts +47 -4
  9. package/dist/esm/apis/SourceApi.js +63 -2
  10. package/dist/esm/models/ClusterRequirementsRequest.d.ts +1 -1
  11. package/dist/esm/models/Datastore.d.ts +17 -0
  12. package/dist/esm/models/Datastore.js +12 -0
  13. package/dist/esm/models/Infra.d.ts +4 -0
  14. package/dist/esm/models/Infra.js +2 -0
  15. package/dist/esm/models/MigrationComplexityRequest.d.ts +3 -2
  16. package/dist/esm/models/MigrationComplexityRequest.js +1 -3
  17. package/dist/esm/models/MigrationEstimationRequest.d.ts +3 -2
  18. package/dist/esm/models/MigrationEstimationRequest.js +1 -3
  19. package/dist/esm/models/VMs.d.ts +8 -0
  20. package/dist/esm/models/VMs.js +4 -0
  21. package/dist/esm/runtime.d.ts +22 -1
  22. package/dist/esm/runtime.js +61 -1
  23. package/dist/models/ClusterRequirementsRequest.d.ts +1 -1
  24. package/dist/models/Datastore.d.ts +17 -0
  25. package/dist/models/Datastore.js +13 -0
  26. package/dist/models/Infra.d.ts +4 -0
  27. package/dist/models/Infra.js +2 -0
  28. package/dist/models/MigrationComplexityRequest.d.ts +3 -2
  29. package/dist/models/MigrationComplexityRequest.js +1 -3
  30. package/dist/models/MigrationEstimationRequest.d.ts +3 -2
  31. package/dist/models/MigrationEstimationRequest.js +1 -3
  32. package/dist/models/VMs.d.ts +8 -0
  33. package/dist/models/VMs.js +4 -0
  34. package/dist/runtime.d.ts +22 -1
  35. package/dist/runtime.js +62 -1
  36. package/docs/AssessmentApi.md +3 -11
  37. package/docs/Datastore.md +4 -0
  38. package/docs/Infra.md +2 -0
  39. package/docs/SourceApi.md +77 -1
  40. package/docs/VMs.md +4 -0
  41. package/package.json +1 -1
  42. package/src/apis/AssessmentApi.ts +8 -21
  43. package/src/apis/SourceApi.ts +112 -4
  44. package/src/models/ClusterRequirementsRequest.ts +1 -1
  45. package/src/models/Datastore.ts +24 -0
  46. package/src/models/Infra.ts +6 -0
  47. package/src/models/MigrationComplexityRequest.ts +4 -4
  48. package/src/models/MigrationEstimationRequest.ts +4 -4
  49. package/src/models/VMs.ts +12 -0
  50. package/src/runtime.ts +69 -2
package/docs/SourceApi.md CHANGED
@@ -10,6 +10,7 @@ All URIs are relative to *https://raw.githubusercontent.com*
10
10
  | [**listSources**](SourceApi.md#listsources) | **GET** /api/v1/sources | |
11
11
  | [**updateInventory**](SourceApi.md#updateinventory) | **PUT** /api/v1/sources/{id}/inventory | |
12
12
  | [**updateSource**](SourceApi.md#updatesource) | **PUT** /api/v1/sources/{id} | |
13
+ | [**uploadSourceInventoryFile**](SourceApi.md#uploadsourceinventoryfile) | **PUT** /api/v1/sources/{id}/inventory/file | |
13
14
 
14
15
 
15
16
 
@@ -294,7 +295,7 @@ No authorization required
294
295
 
295
296
 
296
297
 
297
- Update inventory
298
+ Upload source inventory as a single JSON inventory file. Replaces the main inventory and clears all subset inventories. To upload a full disconnected bundle (inventory.json + subsets/_*.json), use PUT /api/v1/sources/{id}/inventory/file.
298
299
 
299
300
  ### Example
300
301
 
@@ -437,3 +438,78 @@ No authorization required
437
438
 
438
439
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
439
440
 
441
+
442
+ ## uploadSourceInventoryFile
443
+
444
+ > Source uploadSourceInventoryFile(id, file)
445
+
446
+
447
+
448
+ Upload a full disconnected inventory for the source as a file. Accepts either a single `.json` inventory file (clears subset inventories) or a `.zip` bundle from the disconnected agent (`inventory.json` plus `subsets/<groupId>.json`). Replaces the main inventory and all subset inventories.
449
+
450
+ ### Example
451
+
452
+ ```ts
453
+ import {
454
+ Configuration,
455
+ SourceApi,
456
+ } from '@openshift-migration-advisor/planner-sdk';
457
+ import type { UploadSourceInventoryFileRequest } from '@openshift-migration-advisor/planner-sdk';
458
+
459
+ async function example() {
460
+ console.log("🚀 Testing @openshift-migration-advisor/planner-sdk SDK...");
461
+ const api = new SourceApi();
462
+
463
+ const body = {
464
+ // string | ID of the source
465
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
466
+ // Blob | Full disconnected inventory for the source. Either a single `.json` inventory file (clears subset inventories) or a `.zip` from the disconnected agent (`inventory.json` plus `subsets/<groupId>.json`).
467
+ file: BINARY_DATA_HERE,
468
+ } satisfies UploadSourceInventoryFileRequest;
469
+
470
+ try {
471
+ const data = await api.uploadSourceInventoryFile(body);
472
+ console.log(data);
473
+ } catch (error) {
474
+ console.error(error);
475
+ }
476
+ }
477
+
478
+ // Run the test
479
+ example().catch(console.error);
480
+ ```
481
+
482
+ ### Parameters
483
+
484
+
485
+ | Name | Type | Description | Notes |
486
+ |------------- | ------------- | ------------- | -------------|
487
+ | **id** | `string` | ID of the source | [Defaults to `undefined`] |
488
+ | **file** | `Blob` | Full disconnected inventory for the source. Either a single &#x60;.json&#x60; inventory file (clears subset inventories) or a &#x60;.zip&#x60; from the disconnected agent (&#x60;inventory.json&#x60; plus &#x60;subsets/&lt;groupId&gt;.json&#x60;). | [Defaults to `undefined`] |
489
+
490
+ ### Return type
491
+
492
+ [**Source**](Source.md)
493
+
494
+ ### Authorization
495
+
496
+ No authorization required
497
+
498
+ ### HTTP request headers
499
+
500
+ - **Content-Type**: `multipart/form-data`
501
+ - **Accept**: `application/json`
502
+
503
+
504
+ ### HTTP response details
505
+ | Status code | Description | Response headers |
506
+ |-------------|-------------|------------------|
507
+ | **200** | Updated source inventory | - |
508
+ | **400** | Bad Request | - |
509
+ | **401** | Unauthorized | - |
510
+ | **403** | Forbidden | - |
511
+ | **404** | NotFound | - |
512
+ | **500** | Internal Server Error | - |
513
+
514
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
515
+
package/docs/VMs.md CHANGED
@@ -10,6 +10,8 @@ Name | Type
10
10
  `totalMigratable` | number
11
11
  `totalMigratableWithWarnings` | number
12
12
  `totalWithSharedDisks` | number
13
+ `totalWithRDM` | number
14
+ `totalWithFaultTolerance` | number
13
15
  `cpuCores` | [VMResourceBreakdown](VMResourceBreakdown.md)
14
16
  `diskSizeTier` | [{ [key: string]: DiskSizeTierSummary; }](DiskSizeTierSummary.md)
15
17
  `diskComplexityTier` | [{ [key: string]: DiskSizeTierSummary; }](DiskSizeTierSummary.md)
@@ -41,6 +43,8 @@ const example = {
41
43
  "totalMigratable": null,
42
44
  "totalMigratableWithWarnings": null,
43
45
  "totalWithSharedDisks": null,
46
+ "totalWithRDM": null,
47
+ "totalWithFaultTolerance": null,
44
48
  "cpuCores": null,
45
49
  "diskSizeTier": null,
46
50
  "diskComplexityTier": null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openshift-migration-advisor/planner-sdk",
3
- "version": "0.22.0",
3
+ "version": "0.26.0-27992947c82e",
4
4
  "description": "OpenAPI client for @openshift-migration-advisor/planner-sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -162,13 +162,6 @@ export interface GetAssessmentEnhancementDataRequest {
162
162
  id: string;
163
163
  }
164
164
 
165
- export interface ListAssessmentsRequest {
166
- /**
167
- * Filter assessments by source ID
168
- */
169
- sourceId?: string;
170
- }
171
-
172
165
  export interface SaveAssessmentEnhancementDataRequest {
173
166
  /**
174
167
  * ID of the assessment
@@ -422,25 +415,23 @@ export interface AssessmentApiInterface {
422
415
 
423
416
  /**
424
417
  * Creates request options for listAssessments without sending the request
425
- * @param {string} [sourceId] Filter assessments by source ID
426
418
  * @throws {RequiredError}
427
419
  * @memberof AssessmentApiInterface
428
420
  */
429
- listAssessmentsRequestOpts(requestParameters: ListAssessmentsRequest): Promise<runtime.RequestOpts>;
421
+ listAssessmentsRequestOpts(): Promise<runtime.RequestOpts>;
430
422
 
431
423
  /**
432
424
  * List assessments
433
- * @param {string} [sourceId] Filter assessments by source ID
434
425
  * @param {*} [options] Override http request option.
435
426
  * @throws {RequiredError}
436
427
  * @memberof AssessmentApiInterface
437
428
  */
438
- listAssessmentsRaw(requestParameters: ListAssessmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Assessment>>>;
429
+ listAssessmentsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Assessment>>>;
439
430
 
440
431
  /**
441
432
  * List assessments
442
433
  */
443
- listAssessments(requestParameters: ListAssessmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Assessment>>;
434
+ listAssessments(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Assessment>>;
444
435
 
445
436
  /**
446
437
  * Creates request options for saveAssessmentEnhancementData without sending the request
@@ -1002,13 +993,9 @@ export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInter
1002
993
  /**
1003
994
  * Creates request options for listAssessments without sending the request
1004
995
  */
1005
- async listAssessmentsRequestOpts(requestParameters: ListAssessmentsRequest): Promise<runtime.RequestOpts> {
996
+ async listAssessmentsRequestOpts(): Promise<runtime.RequestOpts> {
1006
997
  const queryParameters: any = {};
1007
998
 
1008
- if (requestParameters['sourceId'] != null) {
1009
- queryParameters['sourceId'] = requestParameters['sourceId'];
1010
- }
1011
-
1012
999
  const headerParameters: runtime.HTTPHeaders = {};
1013
1000
 
1014
1001
 
@@ -1025,8 +1012,8 @@ export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInter
1025
1012
  /**
1026
1013
  * List assessments
1027
1014
  */
1028
- async listAssessmentsRaw(requestParameters: ListAssessmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Assessment>>> {
1029
- const requestOptions = await this.listAssessmentsRequestOpts(requestParameters);
1015
+ async listAssessmentsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Assessment>>> {
1016
+ const requestOptions = await this.listAssessmentsRequestOpts();
1030
1017
  const response = await this.request(requestOptions, initOverrides);
1031
1018
 
1032
1019
  return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AssessmentFromJSON));
@@ -1035,8 +1022,8 @@ export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInter
1035
1022
  /**
1036
1023
  * List assessments
1037
1024
  */
1038
- async listAssessments(requestParameters: ListAssessmentsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Assessment>> {
1039
- const response = await this.listAssessmentsRaw(requestParameters, initOverrides);
1025
+ async listAssessments(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Assessment>> {
1026
+ const response = await this.listAssessmentsRaw(initOverrides);
1040
1027
  return await response.value();
1041
1028
  }
1042
1029
 
@@ -77,6 +77,17 @@ export interface UpdateSourceRequest {
77
77
  sourceUpdate: SourceUpdate;
78
78
  }
79
79
 
80
+ export interface UploadSourceInventoryFileRequest {
81
+ /**
82
+ * ID of the source
83
+ */
84
+ id: string;
85
+ /**
86
+ * Full disconnected inventory for the source. Either a single `.json` inventory file (clears subset inventories) or a `.zip` from the disconnected agent (`inventory.json` plus `subsets/<groupId>.json`).
87
+ */
88
+ file: Blob;
89
+ }
90
+
80
91
  /**
81
92
  * SourceApi - interface
82
93
  *
@@ -180,7 +191,7 @@ export interface SourceApiInterface {
180
191
  updateInventoryRequestOpts(requestParameters: UpdateInventoryRequest): Promise<runtime.RequestOpts>;
181
192
 
182
193
  /**
183
- * Update inventory
194
+ * Upload source inventory as a single JSON inventory file. Replaces the main inventory and clears all subset inventories. To upload a full disconnected bundle (inventory.json + subsets/_*.json), use PUT /api/v1/sources/{id}/inventory/file.
184
195
  * @param {string} id ID of the source
185
196
  * @param {UpdateInventory} updateInventory
186
197
  * @param {*} [options] Override http request option.
@@ -190,7 +201,7 @@ export interface SourceApiInterface {
190
201
  updateInventoryRaw(requestParameters: UpdateInventoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Source>>;
191
202
 
192
203
  /**
193
- * Update inventory
204
+ * Upload source inventory as a single JSON inventory file. Replaces the main inventory and clears all subset inventories. To upload a full disconnected bundle (inventory.json + subsets/_*.json), use PUT /api/v1/sources/{id}/inventory/file.
194
205
  */
195
206
  updateInventory(requestParameters: UpdateInventoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source>;
196
207
 
@@ -218,6 +229,30 @@ export interface SourceApiInterface {
218
229
  */
219
230
  updateSource(requestParameters: UpdateSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source>;
220
231
 
232
+ /**
233
+ * Creates request options for uploadSourceInventoryFile without sending the request
234
+ * @param {string} id ID of the source
235
+ * @param {Blob} file Full disconnected inventory for the source. Either a single &#x60;.json&#x60; inventory file (clears subset inventories) or a &#x60;.zip&#x60; from the disconnected agent (&#x60;inventory.json&#x60; plus &#x60;subsets/&lt;groupId&gt;.json&#x60;).
236
+ * @throws {RequiredError}
237
+ * @memberof SourceApiInterface
238
+ */
239
+ uploadSourceInventoryFileRequestOpts(requestParameters: UploadSourceInventoryFileRequest): Promise<runtime.RequestOpts>;
240
+
241
+ /**
242
+ * Upload a full disconnected inventory for the source as a file. Accepts either a single `.json` inventory file (clears subset inventories) or a `.zip` bundle from the disconnected agent (`inventory.json` plus `subsets/<groupId>.json`). Replaces the main inventory and all subset inventories.
243
+ * @param {string} id ID of the source
244
+ * @param {Blob} file Full disconnected inventory for the source. Either a single &#x60;.json&#x60; inventory file (clears subset inventories) or a &#x60;.zip&#x60; from the disconnected agent (&#x60;inventory.json&#x60; plus &#x60;subsets/&lt;groupId&gt;.json&#x60;).
245
+ * @param {*} [options] Override http request option.
246
+ * @throws {RequiredError}
247
+ * @memberof SourceApiInterface
248
+ */
249
+ uploadSourceInventoryFileRaw(requestParameters: UploadSourceInventoryFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Source>>;
250
+
251
+ /**
252
+ * Upload a full disconnected inventory for the source as a file. Accepts either a single `.json` inventory file (clears subset inventories) or a `.zip` bundle from the disconnected agent (`inventory.json` plus `subsets/<groupId>.json`). Replaces the main inventory and all subset inventories.
253
+ */
254
+ uploadSourceInventoryFile(requestParameters: UploadSourceInventoryFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source>;
255
+
221
256
  }
222
257
 
223
258
  /**
@@ -437,7 +472,7 @@ export class SourceApi extends runtime.BaseAPI implements SourceApiInterface {
437
472
  }
438
473
 
439
474
  /**
440
- * Update inventory
475
+ * Upload source inventory as a single JSON inventory file. Replaces the main inventory and clears all subset inventories. To upload a full disconnected bundle (inventory.json + subsets/_*.json), use PUT /api/v1/sources/{id}/inventory/file.
441
476
  */
442
477
  async updateInventoryRaw(requestParameters: UpdateInventoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Source>> {
443
478
  const requestOptions = await this.updateInventoryRequestOpts(requestParameters);
@@ -447,7 +482,7 @@ export class SourceApi extends runtime.BaseAPI implements SourceApiInterface {
447
482
  }
448
483
 
449
484
  /**
450
- * Update inventory
485
+ * Upload source inventory as a single JSON inventory file. Replaces the main inventory and clears all subset inventories. To upload a full disconnected bundle (inventory.json + subsets/_*.json), use PUT /api/v1/sources/{id}/inventory/file.
451
486
  */
452
487
  async updateInventory(requestParameters: UpdateInventoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source> {
453
488
  const response = await this.updateInventoryRaw(requestParameters, initOverrides);
@@ -509,4 +544,77 @@ export class SourceApi extends runtime.BaseAPI implements SourceApiInterface {
509
544
  return await response.value();
510
545
  }
511
546
 
547
+ /**
548
+ * Creates request options for uploadSourceInventoryFile without sending the request
549
+ */
550
+ async uploadSourceInventoryFileRequestOpts(requestParameters: UploadSourceInventoryFileRequest): Promise<runtime.RequestOpts> {
551
+ if (requestParameters['id'] == null) {
552
+ throw new runtime.RequiredError(
553
+ 'id',
554
+ 'Required parameter "id" was null or undefined when calling uploadSourceInventoryFile().'
555
+ );
556
+ }
557
+
558
+ if (requestParameters['file'] == null) {
559
+ throw new runtime.RequiredError(
560
+ 'file',
561
+ 'Required parameter "file" was null or undefined when calling uploadSourceInventoryFile().'
562
+ );
563
+ }
564
+
565
+ const queryParameters: any = {};
566
+
567
+ const headerParameters: runtime.HTTPHeaders = {};
568
+
569
+ const consumes: runtime.Consume[] = [
570
+ { contentType: 'multipart/form-data' },
571
+ ];
572
+ // @ts-ignore: canConsumeForm may be unused
573
+ const canConsumeForm = runtime.canConsumeForm(consumes);
574
+
575
+ let formParams: { append(param: string, value: any): any };
576
+ let useForm = false;
577
+ // use FormData to transmit files using content-type "multipart/form-data"
578
+ useForm = canConsumeForm;
579
+ if (useForm) {
580
+ formParams = new FormData();
581
+ } else {
582
+ formParams = new URLSearchParams();
583
+ }
584
+
585
+ if (requestParameters['file'] != null) {
586
+ formParams.append('file', requestParameters['file'] as any);
587
+ }
588
+
589
+
590
+ let urlPath = `/api/v1/sources/{id}/inventory/file`;
591
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
592
+
593
+ return {
594
+ path: urlPath,
595
+ method: 'PUT',
596
+ headers: headerParameters,
597
+ query: queryParameters,
598
+ body: formParams,
599
+ };
600
+ }
601
+
602
+ /**
603
+ * Upload a full disconnected inventory for the source as a file. Accepts either a single `.json` inventory file (clears subset inventories) or a `.zip` bundle from the disconnected agent (`inventory.json` plus `subsets/<groupId>.json`). Replaces the main inventory and all subset inventories.
604
+ */
605
+ async uploadSourceInventoryFileRaw(requestParameters: UploadSourceInventoryFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Source>> {
606
+ const requestOptions = await this.uploadSourceInventoryFileRequestOpts(requestParameters);
607
+ const response = await this.request(requestOptions, initOverrides);
608
+
609
+ return new runtime.JSONApiResponse(response, (jsonValue) => SourceFromJSON(jsonValue));
610
+ }
611
+
612
+ /**
613
+ * Upload a full disconnected inventory for the source as a file. Accepts either a single `.json` inventory file (clears subset inventories) or a `.zip` bundle from the disconnected agent (`inventory.json` plus `subsets/<groupId>.json`). Replaces the main inventory and all subset inventories.
614
+ */
615
+ async uploadSourceInventoryFile(requestParameters: UploadSourceInventoryFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source> {
616
+ const response = await this.uploadSourceInventoryFileRaw(requestParameters, initOverrides);
617
+ return await response.value();
618
+ }
619
+
512
620
  }
@@ -35,7 +35,7 @@ import {
35
35
  */
36
36
  export interface ClusterRequirementsRequest {
37
37
  /**
38
- * ID of the cluster to calculate requirements for
38
+ * ID of the cluster to calculate requirements for. An empty value uses the vCenter-wide aggregate.
39
39
  */
40
40
  clusterId: string;
41
41
  /**
@@ -31,6 +31,14 @@ export interface Datastore {
31
31
  *
32
32
  */
33
33
  type: string;
34
+ /**
35
+ * Storage access category derived from Datastore.Type
36
+ */
37
+ storageProtocol?: DatastoreStorageProtocolEnum;
38
+ /**
39
+ * Whether this datastore supports vSAN point-in-time snapshots
40
+ */
41
+ vsanSnapshotSupport?: boolean;
34
42
  /**
35
43
  *
36
44
  */
@@ -69,6 +77,18 @@ export interface Datastore {
69
77
  storageIoConfiguration?: StorageIoConfiguration;
70
78
  }
71
79
 
80
+
81
+ /**
82
+ * @export
83
+ */
84
+ export const DatastoreStorageProtocolEnum = {
85
+ Block: 'Block',
86
+ File: 'File',
87
+ Object: 'Object',
88
+ } as const;
89
+ export type DatastoreStorageProtocolEnum = typeof DatastoreStorageProtocolEnum[keyof typeof DatastoreStorageProtocolEnum];
90
+
91
+
72
92
  /**
73
93
  * Check if a given object implements the Datastore interface.
74
94
  */
@@ -95,6 +115,8 @@ export function DatastoreFromJSONTyped(json: any, ignoreDiscriminator: boolean):
95
115
  return {
96
116
 
97
117
  'type': json['type'],
118
+ 'storageProtocol': json['storageProtocol'] == null ? undefined : json['storageProtocol'],
119
+ 'vsanSnapshotSupport': json['vsanSnapshotSupport'] == null ? undefined : json['vsanSnapshotSupport'],
98
120
  'totalCapacityGB': json['totalCapacityGB'],
99
121
  'freeCapacityGB': json['freeCapacityGB'],
100
122
  'vendor': json['vendor'],
@@ -119,6 +141,8 @@ export function DatastoreToJSONTyped(value?: Datastore | null, ignoreDiscriminat
119
141
  return {
120
142
 
121
143
  'type': value['type'],
144
+ 'storageProtocol': value['storageProtocol'],
145
+ 'vsanSnapshotSupport': value['vsanSnapshotSupport'],
122
146
  'totalCapacityGB': value['totalCapacityGB'],
123
147
  'freeCapacityGB': value['freeCapacityGB'],
124
148
  'vendor': value['vendor'],
@@ -45,6 +45,10 @@ export interface Infra {
45
45
  *
46
46
  */
47
47
  totalHosts: number;
48
+ /**
49
+ * Whether any hosts run without vCenter cluster management (not part of any cluster)
50
+ */
51
+ standaloneHostsDetected?: boolean;
48
52
  /**
49
53
  *
50
54
  */
@@ -120,6 +124,7 @@ export function InfraFromJSONTyped(json: any, ignoreDiscriminator: boolean): Inf
120
124
  return {
121
125
 
122
126
  'totalHosts': json['totalHosts'],
127
+ 'standaloneHostsDetected': json['standaloneHostsDetected'] == null ? undefined : json['standaloneHostsDetected'],
123
128
  'totalDatacenters': json['totalDatacenters'] == null ? undefined : json['totalDatacenters'],
124
129
  'totalClusters': json['totalClusters'] == null ? undefined : json['totalClusters'],
125
130
  'clustersPerDatacenter': json['clustersPerDatacenter'] == null ? undefined : json['clustersPerDatacenter'],
@@ -147,6 +152,7 @@ export function InfraToJSONTyped(value?: Infra | null, ignoreDiscriminator: bool
147
152
  return {
148
153
 
149
154
  'totalHosts': value['totalHosts'],
155
+ 'standaloneHostsDetected': value['standaloneHostsDetected'],
150
156
  'totalDatacenters': value['totalDatacenters'],
151
157
  'totalClusters': value['totalClusters'],
152
158
  'clustersPerDatacenter': value['clustersPerDatacenter'],
@@ -20,16 +20,16 @@ import { mapValues } from '../runtime.js';
20
20
  */
21
21
  export interface MigrationComplexityRequest {
22
22
  /**
23
- * ID of the cluster to calculate complexity estimation for
23
+ * ID of the cluster to calculate complexity estimation for. When omitted or empty, the vCenter-level aggregate is used.
24
+ *
24
25
  */
25
- clusterId: string;
26
+ clusterId?: string;
26
27
  }
27
28
 
28
29
  /**
29
30
  * Check if a given object implements the MigrationComplexityRequest interface.
30
31
  */
31
32
  export function instanceOfMigrationComplexityRequest(value: object): value is MigrationComplexityRequest {
32
- if (!('clusterId' in value) || value['clusterId'] === undefined) return false;
33
33
  return true;
34
34
  }
35
35
 
@@ -43,7 +43,7 @@ export function MigrationComplexityRequestFromJSONTyped(json: any, ignoreDiscrim
43
43
  }
44
44
  return {
45
45
 
46
- 'clusterId': json['clusterId'],
46
+ 'clusterId': json['clusterId'] == null ? undefined : json['clusterId'],
47
47
  };
48
48
  }
49
49
 
@@ -20,9 +20,10 @@ import { mapValues } from '../runtime.js';
20
20
  */
21
21
  export interface MigrationEstimationRequest {
22
22
  /**
23
- * ID of the cluster to calculate migration estimation for
23
+ * ID of the cluster to calculate migration estimation for. When omitted or empty, the vCenter-level aggregate is used.
24
+ *
24
25
  */
25
- clusterId: string;
26
+ clusterId?: string;
26
27
  /**
27
28
  * Schemas to run. Valid values: "network-based", "storage-offload". If omitted, all schemas are run.
28
29
  *
@@ -39,7 +40,6 @@ export interface MigrationEstimationRequest {
39
40
  * Check if a given object implements the MigrationEstimationRequest interface.
40
41
  */
41
42
  export function instanceOfMigrationEstimationRequest(value: object): value is MigrationEstimationRequest {
42
- if (!('clusterId' in value) || value['clusterId'] === undefined) return false;
43
43
  return true;
44
44
  }
45
45
 
@@ -53,7 +53,7 @@ export function MigrationEstimationRequestFromJSONTyped(json: any, ignoreDiscrim
53
53
  }
54
54
  return {
55
55
 
56
- 'clusterId': json['clusterId'],
56
+ 'clusterId': json['clusterId'] == null ? undefined : json['clusterId'],
57
57
  'estimationSchema': json['estimationSchema'] == null ? undefined : json['estimationSchema'],
58
58
  'params': json['params'] == null ? undefined : json['params'],
59
59
  };
package/src/models/VMs.ts CHANGED
@@ -78,6 +78,14 @@ export interface VMs {
78
78
  * Number of VMs that have at least one shared disk
79
79
  */
80
80
  totalWithSharedDisks?: number;
81
+ /**
82
+ * Number of VMs that have at least one raw device mapping (RDM) disk
83
+ */
84
+ totalWithRDM?: number;
85
+ /**
86
+ * Number of VMs that have Fault Tolerance enabled
87
+ */
88
+ totalWithFaultTolerance?: number;
81
89
  /**
82
90
  *
83
91
  */
@@ -189,6 +197,8 @@ export function VMsFromJSONTyped(json: any, ignoreDiscriminator: boolean): VMs {
189
197
  'totalMigratable': json['totalMigratable'],
190
198
  'totalMigratableWithWarnings': json['totalMigratableWithWarnings'] == null ? undefined : json['totalMigratableWithWarnings'],
191
199
  'totalWithSharedDisks': json['totalWithSharedDisks'] == null ? undefined : json['totalWithSharedDisks'],
200
+ 'totalWithRDM': json['totalWithRDM'] == null ? undefined : json['totalWithRDM'],
201
+ 'totalWithFaultTolerance': json['totalWithFaultTolerance'] == null ? undefined : json['totalWithFaultTolerance'],
192
202
  'cpuCores': VMResourceBreakdownFromJSON(json['cpuCores']),
193
203
  'diskSizeTier': json['diskSizeTier'] == null ? undefined : (mapValues(json['diskSizeTier'], DiskSizeTierSummaryFromJSON)),
194
204
  'diskComplexityTier': json['diskComplexityTier'] == null ? undefined : (mapValues(json['diskComplexityTier'], DiskSizeTierSummaryFromJSON)),
@@ -226,6 +236,8 @@ export function VMsToJSONTyped(value?: VMs | null, ignoreDiscriminator: boolean
226
236
  'totalMigratable': value['totalMigratable'],
227
237
  'totalMigratableWithWarnings': value['totalMigratableWithWarnings'],
228
238
  'totalWithSharedDisks': value['totalWithSharedDisks'],
239
+ 'totalWithRDM': value['totalWithRDM'],
240
+ 'totalWithFaultTolerance': value['totalWithFaultTolerance'],
229
241
  'cpuCores': VMResourceBreakdownToJSON(value['cpuCores']),
230
242
  'diskSizeTier': value['diskSizeTier'] == null ? undefined : (mapValues(value['diskSizeTier'], DiskSizeTierSummaryToJSON)),
231
243
  'diskComplexityTier': value['diskComplexityTier'] == null ? undefined : (mapValues(value['diskComplexityTier'], DiskSizeTierSummaryToJSON)),
package/src/runtime.ts CHANGED
@@ -488,14 +488,81 @@ export class VoidApiResponse {
488
488
  }
489
489
  }
490
490
 
491
+ /**
492
+ * A Blob carrying the file name the server advertised, empty when it did not send one. It is a File
493
+ * wherever one can be built, and the bare Blob given a name otherwise. Same name and shape as the
494
+ * `typescript` generator's browser HttpFile.
495
+ */
496
+ export type HttpFile = Blob & { readonly name: string };
497
+
491
498
  export class BlobApiResponse {
492
499
  constructor(public raw: Response) {}
493
500
 
494
- async value(): Promise<Blob> {
495
- return await this.raw.blob();
501
+ /**
502
+ * The body named after the Content-Disposition header, so that a download keeps the name the
503
+ * server gave it. A File is built from a native Blob; the Blob itself is named where there is no
504
+ * global File (Node.js before 20), where File cannot be constructed, or where the Blob is not the
505
+ * native one, as returned by an injected fetch implementation such as node-fetch, which a File
506
+ * would stringify instead of wrapping.
507
+ */
508
+ async value(): Promise<HttpFile> {
509
+ const blob = await this.raw.blob();
510
+ const name = parseContentDispositionFilename(this.raw.headers) ?? '';
511
+ if (typeof File !== 'undefined' && blob instanceof Blob) {
512
+ try {
513
+ return new File([blob], name, { type: blob.type });
514
+ } catch {
515
+ // File cannot be constructed: name the Blob itself
516
+ }
517
+ }
518
+ return Object.assign(blob, { name });
496
519
  };
497
520
  }
498
521
 
522
+ /**
523
+ * The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
524
+ * `filename*` parameter first, falling back to the plain `filename` when it is malformed, not UTF-8
525
+ * or has no usable name. Any directory part is dropped; undefined when no usable name is advertised.
526
+ */
527
+ export function parseContentDispositionFilename(headers: Headers): string | undefined {
528
+ const params = parseHeaderParameters(headers.get('Content-Disposition') ?? '');
529
+ return basename(decodeExtValue(params.get('filename*'))) ?? basename(params.get('filename'));
530
+ }
531
+
532
+ /** The decoded RFC 5987 ext-value, or undefined when it is not UTF-8 or its percent-encoding is malformed. */
533
+ function decodeExtValue(value: string | undefined): string | undefined {
534
+ const match = value === undefined ? null : /^utf-8'[^']*'(.*)$/i.exec(value);
535
+ try {
536
+ return match ? decodeURIComponent(match[1]) : undefined;
537
+ } catch {
538
+ return undefined;
539
+ }
540
+ }
541
+
542
+ /**
543
+ * The `name=value` parameters of a header value, consumed one at a time so that a quoted-string is
544
+ * taken whole, `;` included. Names are lower-cased, quoted-string values are unquoted with their
545
+ * backslash escapes resolved, and the first occurrence of a name wins.
546
+ */
547
+ function parseHeaderParameters(value: string): Map<string, string> {
548
+ const params = new Map<string, string>();
549
+ const parameter = /(?:^|;)\s*([^=;]+?)\s*=\s*(?:"((?:[^"\\]|\\.)*)"?|([^;]*))/g;
550
+ let match: RegExpExecArray | null;
551
+ while ((match = parameter.exec(value)) !== null) {
552
+ const name = match[1].toLowerCase();
553
+ if (!params.has(name)) {
554
+ params.set(name, match[2] !== undefined ? match[2].replace(/\\(.)/g, '$1') : match[3].trim());
555
+ }
556
+ }
557
+ return params;
558
+ }
559
+
560
+ /** The last `/` or `\` separated segment of a file name, or undefined when it is not a file name. */
561
+ function basename(name: string | undefined): string | undefined {
562
+ const base = name?.split(/[\\/]/).pop();
563
+ return !base || base === '.' || base === '..' ? undefined : base;
564
+ }
565
+
499
566
  export class TextApiResponse {
500
567
  constructor(public raw: Response) {}
501
568