@openshift-migration-advisor/planner-sdk 0.32.0 → 0.33.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.
Files changed (41) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/README.md +4 -2
  3. package/dist/apis/AssessmentApi.d.ts +58 -6
  4. package/dist/apis/AssessmentApi.js +53 -6
  5. package/dist/apis/ImageApi.d.ts +14 -0
  6. package/dist/apis/ImageApi.js +11 -1
  7. package/dist/esm/apis/AssessmentApi.d.ts +58 -6
  8. package/dist/esm/apis/AssessmentApi.js +53 -6
  9. package/dist/esm/apis/ImageApi.d.ts +14 -0
  10. package/dist/esm/apis/ImageApi.js +10 -0
  11. package/dist/esm/models/Host.d.ts +16 -0
  12. package/dist/esm/models/Host.js +8 -0
  13. package/dist/esm/models/Info.d.ts +4 -0
  14. package/dist/esm/models/Info.js +2 -0
  15. package/dist/esm/models/SourceType.d.ts +26 -0
  16. package/dist/esm/models/SourceType.js +44 -0
  17. package/dist/esm/models/index.d.ts +1 -0
  18. package/dist/esm/models/index.js +1 -0
  19. package/dist/esm/runtime.js +4 -3
  20. package/dist/models/Host.d.ts +16 -0
  21. package/dist/models/Host.js +8 -0
  22. package/dist/models/Info.d.ts +4 -0
  23. package/dist/models/Info.js +2 -0
  24. package/dist/models/SourceType.d.ts +26 -0
  25. package/dist/models/SourceType.js +52 -0
  26. package/dist/models/index.d.ts +1 -0
  27. package/dist/models/index.js +1 -0
  28. package/dist/runtime.js +4 -3
  29. package/docs/AssessmentApi.md +88 -3
  30. package/docs/Host.md +8 -0
  31. package/docs/ImageApi.md +5 -2
  32. package/docs/Info.md +2 -0
  33. package/docs/SourceType.md +32 -0
  34. package/package.json +1 -1
  35. package/src/apis/AssessmentApi.ts +116 -8
  36. package/src/apis/ImageApi.ts +19 -0
  37. package/src/models/Host.ts +24 -0
  38. package/src/models/Info.ts +6 -0
  39. package/src/models/SourceType.ts +54 -0
  40. package/src/models/index.ts +1 -0
  41. package/src/runtime.ts +3 -3
@@ -93,6 +93,11 @@ import {
93
93
  MigrationEstimationResponseFromJSON,
94
94
  MigrationEstimationResponseToJSON,
95
95
  } from '../models/MigrationEstimationResponse.js';
96
+ import {
97
+ type SourceType,
98
+ SourceTypeFromJSON,
99
+ SourceTypeToJSON,
100
+ } from '../models/SourceType.js';
96
101
  import {
97
102
  type Status,
98
103
  StatusFromJSON,
@@ -226,6 +231,13 @@ export interface GetVcenterClusterRequest {
226
231
  cid: string;
227
232
  }
228
233
 
234
+ export interface ListAssessmentsV2Request {
235
+ /**
236
+ * Filter assessments by their source type
237
+ */
238
+ sourceType?: SourceType;
239
+ }
240
+
229
241
  export interface SaveAssessmentEnhancementDataRequest {
230
242
  /**
231
243
  * ID of the assessment
@@ -262,6 +274,17 @@ export interface UpdateAssessmentRequest {
262
274
  assessmentUpdate: AssessmentUpdate;
263
275
  }
264
276
 
277
+ export interface UpdateAssessmentV2Request {
278
+ /**
279
+ * ID of the assessment
280
+ */
281
+ id: string;
282
+ /**
283
+ *
284
+ */
285
+ assessmentUpdate: AssessmentUpdate;
286
+ }
287
+
265
288
  /**
266
289
  * AssessmentApi - interface
267
290
  *
@@ -595,23 +618,25 @@ export interface AssessmentApiInterface {
595
618
 
596
619
  /**
597
620
  * Creates request options for listAssessmentsV2 without sending the request
621
+ * @param {SourceType} [sourceType] Filter assessments by their source type
598
622
  * @throws {RequiredError}
599
623
  * @memberof AssessmentApiInterface
600
624
  */
601
- listAssessmentsV2RequestOpts(): Promise<runtime.RequestOpts>;
625
+ listAssessmentsV2RequestOpts(requestParameters: ListAssessmentsV2Request): Promise<runtime.RequestOpts>;
602
626
 
603
627
  /**
604
628
  * List assessments
629
+ * @param {SourceType} [sourceType] Filter assessments by their source type
605
630
  * @param {*} [options] Override http request option.
606
631
  * @throws {RequiredError}
607
632
  * @memberof AssessmentApiInterface
608
633
  */
609
- listAssessmentsV2Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AssessmentV2Summary>>>;
634
+ listAssessmentsV2Raw(requestParameters: ListAssessmentsV2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AssessmentV2Summary>>>;
610
635
 
611
636
  /**
612
637
  * List assessments
613
638
  */
614
- listAssessmentsV2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AssessmentV2Summary>>;
639
+ listAssessmentsV2(requestParameters: ListAssessmentsV2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AssessmentV2Summary>>;
615
640
 
616
641
  /**
617
642
  * Creates request options for saveAssessmentEnhancementData without sending the request
@@ -705,6 +730,30 @@ export interface AssessmentApiInterface {
705
730
  */
706
731
  updateAssessment(requestParameters: UpdateAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Assessment>;
707
732
 
733
+ /**
734
+ * Creates request options for updateAssessmentV2 without sending the request
735
+ * @param {string} id ID of the assessment
736
+ * @param {AssessmentUpdate} assessmentUpdate
737
+ * @throws {RequiredError}
738
+ * @memberof AssessmentApiInterface
739
+ */
740
+ updateAssessmentV2RequestOpts(requestParameters: UpdateAssessmentV2Request): Promise<runtime.RequestOpts>;
741
+
742
+ /**
743
+ * Update the assessment name
744
+ * @param {string} id ID of the assessment
745
+ * @param {AssessmentUpdate} assessmentUpdate
746
+ * @param {*} [options] Override http request option.
747
+ * @throws {RequiredError}
748
+ * @memberof AssessmentApiInterface
749
+ */
750
+ updateAssessmentV2Raw(requestParameters: UpdateAssessmentV2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssessmentV2>>;
751
+
752
+ /**
753
+ * Update the assessment name
754
+ */
755
+ updateAssessmentV2(requestParameters: UpdateAssessmentV2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssessmentV2>;
756
+
708
757
  }
709
758
 
710
759
  /**
@@ -1421,9 +1470,13 @@ export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInter
1421
1470
  /**
1422
1471
  * Creates request options for listAssessmentsV2 without sending the request
1423
1472
  */
1424
- async listAssessmentsV2RequestOpts(): Promise<runtime.RequestOpts> {
1473
+ async listAssessmentsV2RequestOpts(requestParameters: ListAssessmentsV2Request): Promise<runtime.RequestOpts> {
1425
1474
  const queryParameters: any = {};
1426
1475
 
1476
+ if (requestParameters['sourceType'] != null) {
1477
+ queryParameters['sourceType'] = requestParameters['sourceType'];
1478
+ }
1479
+
1427
1480
  const headerParameters: runtime.HTTPHeaders = {};
1428
1481
 
1429
1482
 
@@ -1440,8 +1493,8 @@ export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInter
1440
1493
  /**
1441
1494
  * List assessments
1442
1495
  */
1443
- async listAssessmentsV2Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AssessmentV2Summary>>> {
1444
- const requestOptions = await this.listAssessmentsV2RequestOpts();
1496
+ async listAssessmentsV2Raw(requestParameters: ListAssessmentsV2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AssessmentV2Summary>>> {
1497
+ const requestOptions = await this.listAssessmentsV2RequestOpts(requestParameters);
1445
1498
  const response = await this.request(requestOptions, initOverrides);
1446
1499
 
1447
1500
  return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AssessmentV2SummaryFromJSON));
@@ -1450,8 +1503,8 @@ export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInter
1450
1503
  /**
1451
1504
  * List assessments
1452
1505
  */
1453
- async listAssessmentsV2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AssessmentV2Summary>> {
1454
- const response = await this.listAssessmentsV2Raw(initOverrides);
1506
+ async listAssessmentsV2(requestParameters: ListAssessmentsV2Request = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AssessmentV2Summary>> {
1507
+ const response = await this.listAssessmentsV2Raw(requestParameters, initOverrides);
1455
1508
  return await response.value();
1456
1509
  }
1457
1510
 
@@ -1655,4 +1708,59 @@ export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInter
1655
1708
  return await response.value();
1656
1709
  }
1657
1710
 
1711
+ /**
1712
+ * Creates request options for updateAssessmentV2 without sending the request
1713
+ */
1714
+ async updateAssessmentV2RequestOpts(requestParameters: UpdateAssessmentV2Request): Promise<runtime.RequestOpts> {
1715
+ if (requestParameters['id'] == null) {
1716
+ throw new runtime.RequiredError(
1717
+ 'id',
1718
+ 'Required parameter "id" was null or undefined when calling updateAssessmentV2().'
1719
+ );
1720
+ }
1721
+
1722
+ if (requestParameters['assessmentUpdate'] == null) {
1723
+ throw new runtime.RequiredError(
1724
+ 'assessmentUpdate',
1725
+ 'Required parameter "assessmentUpdate" was null or undefined when calling updateAssessmentV2().'
1726
+ );
1727
+ }
1728
+
1729
+ const queryParameters: any = {};
1730
+
1731
+ const headerParameters: runtime.HTTPHeaders = {};
1732
+
1733
+ headerParameters['Content-Type'] = 'application/json';
1734
+
1735
+
1736
+ let urlPath = `/api/v2/assessments/{id}`;
1737
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
1738
+
1739
+ return {
1740
+ path: urlPath,
1741
+ method: 'PATCH',
1742
+ headers: headerParameters,
1743
+ query: queryParameters,
1744
+ body: AssessmentUpdateToJSON(requestParameters['assessmentUpdate']),
1745
+ };
1746
+ }
1747
+
1748
+ /**
1749
+ * Update the assessment name
1750
+ */
1751
+ async updateAssessmentV2Raw(requestParameters: UpdateAssessmentV2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssessmentV2>> {
1752
+ const requestOptions = await this.updateAssessmentV2RequestOpts(requestParameters);
1753
+ const response = await this.request(requestOptions, initOverrides);
1754
+
1755
+ return new runtime.JSONApiResponse(response, (jsonValue) => AssessmentV2FromJSON(jsonValue));
1756
+ }
1757
+
1758
+ /**
1759
+ * Update the assessment name
1760
+ */
1761
+ async updateAssessmentV2(requestParameters: UpdateAssessmentV2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssessmentV2> {
1762
+ const response = await this.updateAssessmentV2Raw(requestParameters, initOverrides);
1763
+ return await response.value();
1764
+ }
1765
+
1658
1766
  }
@@ -24,6 +24,10 @@ export interface GetSourceDownloadURLRequest {
24
24
  * Source id
25
25
  */
26
26
  id: string;
27
+ /**
28
+ * Which image to link; the OVA or the appliance image tar for a disconnected update
29
+ */
30
+ image?: GetSourceDownloadURLImageEnum;
27
31
  }
28
32
 
29
33
  export interface HeadImageRequest {
@@ -43,6 +47,7 @@ export interface ImageApiInterface {
43
47
  /**
44
48
  * Creates request options for getSourceDownloadURL without sending the request
45
49
  * @param {string} id Source id
50
+ * @param {'ova' | 'appliance'} [image] Which image to link; the OVA or the appliance image tar for a disconnected update
46
51
  * @throws {RequiredError}
47
52
  * @memberof ImageApiInterface
48
53
  */
@@ -51,6 +56,7 @@ export interface ImageApiInterface {
51
56
  /**
52
57
  * Get the OVA image via URL
53
58
  * @param {string} id Source id
59
+ * @param {'ova' | 'appliance'} [image] Which image to link; the OVA or the appliance image tar for a disconnected update
54
60
  * @param {*} [options] Override http request option.
55
61
  * @throws {RequiredError}
56
62
  * @memberof ImageApiInterface
@@ -104,6 +110,10 @@ export class ImageApi extends runtime.BaseAPI implements ImageApiInterface {
104
110
 
105
111
  const queryParameters: any = {};
106
112
 
113
+ if (requestParameters['image'] != null) {
114
+ queryParameters['image'] = requestParameters['image'];
115
+ }
116
+
107
117
  const headerParameters: runtime.HTTPHeaders = {};
108
118
 
109
119
 
@@ -181,3 +191,12 @@ export class ImageApi extends runtime.BaseAPI implements ImageApiInterface {
181
191
  }
182
192
 
183
193
  }
194
+
195
+ /**
196
+ * @export
197
+ */
198
+ export const GetSourceDownloadURLImageEnum = {
199
+ Ova: 'ova',
200
+ Appliance: 'appliance',
201
+ } as const;
202
+ export type GetSourceDownloadURLImageEnum = typeof GetSourceDownloadURLImageEnum[keyof typeof GetSourceDownloadURLImageEnum];
@@ -46,6 +46,22 @@ export interface Host {
46
46
  *
47
47
  */
48
48
  model: string;
49
+ /**
50
+ * Source datacenter name, when available.
51
+ */
52
+ datacenter?: string;
53
+ /**
54
+ * Source cluster name; omitted for standalone hosts.
55
+ */
56
+ cluster?: string;
57
+ /**
58
+ * Source-reported CPU model, when available.
59
+ */
60
+ cpuModel?: string;
61
+ /**
62
+ * Source-reported host hardware serial or service tag, when available.
63
+ */
64
+ serialNumber?: string;
49
65
  /**
50
66
  * Number of CPU cores
51
67
  */
@@ -98,6 +114,10 @@ export function HostFromJSONTyped(json: any, ignoreDiscriminator: boolean): Host
98
114
  'id': json['id'] == null ? undefined : json['id'],
99
115
  'vendor': json['vendor'],
100
116
  'model': json['model'],
117
+ 'datacenter': json['datacenter'] == null ? undefined : json['datacenter'],
118
+ 'cluster': json['cluster'] == null ? undefined : json['cluster'],
119
+ 'cpuModel': json['cpuModel'] == null ? undefined : json['cpuModel'],
120
+ 'serialNumber': json['serialNumber'] == null ? undefined : json['serialNumber'],
101
121
  'cpuCores': json['cpuCores'] === undefined ? undefined : json['cpuCores'] === null ? null : json['cpuCores'],
102
122
  'cpuSockets': json['cpuSockets'] === undefined ? undefined : json['cpuSockets'] === null ? null : json['cpuSockets'],
103
123
  'memoryMB': json['memoryMB'] === undefined ? undefined : json['memoryMB'] === null ? null : json['memoryMB'],
@@ -122,6 +142,10 @@ export function HostToJSONTyped(value?: Host | null, ignoreDiscriminator: boolea
122
142
  'id': value['id'],
123
143
  'vendor': value['vendor'],
124
144
  'model': value['model'],
145
+ 'datacenter': value['datacenter'],
146
+ 'cluster': value['cluster'],
147
+ 'cpuModel': value['cpuModel'],
148
+ 'serialNumber': value['serialNumber'],
125
149
  'cpuCores': value['cpuCores'],
126
150
  'cpuSockets': value['cpuSockets'],
127
151
  'memoryMB': value['memoryMB'],
@@ -35,6 +35,10 @@ export interface Info {
35
35
  * Agent version name, based on git tag
36
36
  */
37
37
  agentVersionName?: string | null;
38
+ /**
39
+ * The oldest appliance version the served image supports in-place updates from; empty when no minimum is set
40
+ */
41
+ minApplianceVersion?: string | null;
38
42
  }
39
43
 
40
44
  /**
@@ -60,6 +64,7 @@ export function InfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): Info
60
64
  'versionName': json['versionName'],
61
65
  'agentGitCommit': json['agentGitCommit'] === undefined ? undefined : json['agentGitCommit'] === null ? null : json['agentGitCommit'],
62
66
  'agentVersionName': json['agentVersionName'] === undefined ? undefined : json['agentVersionName'] === null ? null : json['agentVersionName'],
67
+ 'minApplianceVersion': json['minApplianceVersion'] === undefined ? undefined : json['minApplianceVersion'] === null ? null : json['minApplianceVersion'],
63
68
  };
64
69
  }
65
70
 
@@ -78,6 +83,7 @@ export function InfoToJSONTyped(value?: Info | null, ignoreDiscriminator: boolea
78
83
  'versionName': value['versionName'],
79
84
  'agentGitCommit': value['agentGitCommit'],
80
85
  'agentVersionName': value['agentVersionName'],
86
+ 'minApplianceVersion': value['minApplianceVersion'],
81
87
  };
82
88
  }
83
89
 
@@ -0,0 +1,54 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * OpenShift Migration Advisor API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: v1alpha1
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ /**
17
+ *
18
+ * @export
19
+ */
20
+ export const SourceType = {
21
+ Inventory: 'inventory',
22
+ Rvtools: 'rvtools',
23
+ Source: 'source',
24
+ } as const;
25
+ export type SourceType = typeof SourceType[keyof typeof SourceType];
26
+
27
+
28
+ export function instanceOfSourceType(value: any): boolean {
29
+ for (const key in SourceType) {
30
+ if (Object.prototype.hasOwnProperty.call(SourceType, key)) {
31
+ if (SourceType[key as keyof typeof SourceType] === value) {
32
+ return true;
33
+ }
34
+ }
35
+ }
36
+ return false;
37
+ }
38
+
39
+ export function SourceTypeFromJSON(json: any): SourceType {
40
+ return SourceTypeFromJSONTyped(json, false);
41
+ }
42
+
43
+ export function SourceTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceType {
44
+ return json as SourceType;
45
+ }
46
+
47
+ export function SourceTypeToJSON(value?: SourceType | null): any {
48
+ return value as any;
49
+ }
50
+
51
+ export function SourceTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): SourceType {
52
+ return value as SourceType;
53
+ }
54
+
@@ -84,6 +84,7 @@ export * from './Snapshot.js';
84
84
  export * from './Source.js';
85
85
  export * from './SourceCreate.js';
86
86
  export * from './SourceInfra.js';
87
+ export * from './SourceType.js';
87
88
  export * from './SourceUpdate.js';
88
89
  export * from './StandaloneClusterRequirementsRequest.js';
89
90
  export * from './StandaloneClusterRequirementsResponse.js';
package/src/runtime.ts CHANGED
@@ -533,7 +533,7 @@ export function parseContentDispositionFilename(headers: Headers): string | unde
533
533
  function decodeExtValue(value: string | undefined): string | undefined {
534
534
  const match = value === undefined ? null : /^utf-8'[^']*'(.*)$/i.exec(value);
535
535
  try {
536
- return match ? decodeURIComponent(match[1]) : undefined;
536
+ return match?.[1] !== undefined ? decodeURIComponent(match[1]) : undefined;
537
537
  } catch {
538
538
  return undefined;
539
539
  }
@@ -549,9 +549,9 @@ function parseHeaderParameters(value: string): Map<string, string> {
549
549
  const parameter = /(?:^|;)\s*([^=;]+?)\s*=\s*(?:"((?:[^"\\]|\\.)*)"?|([^;]*))/g;
550
550
  let match: RegExpExecArray | null;
551
551
  while ((match = parameter.exec(value)) !== null) {
552
- const name = match[1].toLowerCase();
552
+ const name = (match[1] ?? '').toLowerCase();
553
553
  if (!params.has(name)) {
554
- params.set(name, match[2] !== undefined ? match[2].replace(/\\(.)/g, '$1') : match[3].trim());
554
+ params.set(name, match[2] !== undefined ? match[2].replace(/\\(.)/g, '$1') : (match[3] ?? '').trim());
555
555
  }
556
556
  }
557
557
  return params;