@openshift-migration-advisor/planner-sdk 0.5.0 → 0.5.1-b1cf34547cfc
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/.openapi-generator/FILES +6 -0
- package/README.md +6 -2
- package/dist/apis/AssessmentApi.d.ts +38 -1
- package/dist/apis/AssessmentApi.js +44 -0
- package/dist/esm/apis/AssessmentApi.d.ts +38 -1
- package/dist/esm/apis/AssessmentApi.js +45 -1
- package/dist/esm/models/EstimationDetail.d.ts +38 -0
- package/dist/esm/models/EstimationDetail.js +47 -0
- package/dist/esm/models/MigrationEstimationRequest.d.ts +32 -0
- package/dist/esm/models/MigrationEstimationRequest.js +43 -0
- package/dist/esm/models/MigrationEstimationResponse.d.ts +41 -0
- package/dist/esm/models/MigrationEstimationResponse.js +49 -0
- package/dist/esm/models/ModelError.d.ts +0 -6
- package/dist/esm/models/ModelError.js +0 -2
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.js +3 -0
- package/dist/models/EstimationDetail.d.ts +38 -0
- package/dist/models/EstimationDetail.js +54 -0
- package/dist/models/MigrationEstimationRequest.d.ts +32 -0
- package/dist/models/MigrationEstimationRequest.js +50 -0
- package/dist/models/MigrationEstimationResponse.d.ts +41 -0
- package/dist/models/MigrationEstimationResponse.js +56 -0
- package/dist/models/ModelError.d.ts +0 -6
- package/dist/models/ModelError.js +0 -2
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/docs/AssessmentApi.md +76 -0
- package/docs/EstimationDetail.md +37 -0
- package/docs/MigrationEstimationRequest.md +35 -0
- package/docs/MigrationEstimationResponse.md +37 -0
- package/docs/ModelError.md +0 -2
- package/package.json +1 -1
- package/src/apis/AssessmentApi.ts +90 -0
- package/src/models/EstimationDetail.ts +75 -0
- package/src/models/MigrationEstimationRequest.ts +66 -0
- package/src/models/MigrationEstimationResponse.ts +83 -0
- package/src/models/ModelError.ts +0 -8
- package/src/models/index.ts +3 -0
|
@@ -20,6 +20,8 @@ import type {
|
|
|
20
20
|
AssessmentUpdate,
|
|
21
21
|
ClusterRequirementsRequest,
|
|
22
22
|
ClusterRequirementsResponse,
|
|
23
|
+
MigrationEstimationRequest,
|
|
24
|
+
MigrationEstimationResponse,
|
|
23
25
|
} from '../models/index.js';
|
|
24
26
|
import {
|
|
25
27
|
AssessmentFromJSON,
|
|
@@ -32,6 +34,10 @@ import {
|
|
|
32
34
|
ClusterRequirementsRequestToJSON,
|
|
33
35
|
ClusterRequirementsResponseFromJSON,
|
|
34
36
|
ClusterRequirementsResponseToJSON,
|
|
37
|
+
MigrationEstimationRequestFromJSON,
|
|
38
|
+
MigrationEstimationRequestToJSON,
|
|
39
|
+
MigrationEstimationResponseFromJSON,
|
|
40
|
+
MigrationEstimationResponseToJSON,
|
|
35
41
|
} from '../models/index.js';
|
|
36
42
|
|
|
37
43
|
export interface CalculateAssessmentClusterRequirementsRequest {
|
|
@@ -39,6 +45,11 @@ export interface CalculateAssessmentClusterRequirementsRequest {
|
|
|
39
45
|
clusterRequirementsRequest: ClusterRequirementsRequest;
|
|
40
46
|
}
|
|
41
47
|
|
|
48
|
+
export interface CalculateMigrationEstimationRequest {
|
|
49
|
+
id: string;
|
|
50
|
+
migrationEstimationRequest: MigrationEstimationRequest;
|
|
51
|
+
}
|
|
52
|
+
|
|
42
53
|
export interface CreateAssessmentRequest {
|
|
43
54
|
assessmentForm: AssessmentForm;
|
|
44
55
|
}
|
|
@@ -91,6 +102,30 @@ export interface AssessmentApiInterface {
|
|
|
91
102
|
*/
|
|
92
103
|
calculateAssessmentClusterRequirements(requestParameters: CalculateAssessmentClusterRequirementsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClusterRequirementsResponse>;
|
|
93
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Creates request options for calculateMigrationEstimation without sending the request
|
|
107
|
+
* @param {string} id ID of the assessment
|
|
108
|
+
* @param {MigrationEstimationRequest} migrationEstimationRequest
|
|
109
|
+
* @throws {RequiredError}
|
|
110
|
+
* @memberof AssessmentApiInterface
|
|
111
|
+
*/
|
|
112
|
+
calculateMigrationEstimationRequestOpts(requestParameters: CalculateMigrationEstimationRequest): Promise<runtime.RequestOpts>;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Calculate migration time estimation for an assessment
|
|
116
|
+
* @param {string} id ID of the assessment
|
|
117
|
+
* @param {MigrationEstimationRequest} migrationEstimationRequest
|
|
118
|
+
* @param {*} [options] Override http request option.
|
|
119
|
+
* @throws {RequiredError}
|
|
120
|
+
* @memberof AssessmentApiInterface
|
|
121
|
+
*/
|
|
122
|
+
calculateMigrationEstimationRaw(requestParameters: CalculateMigrationEstimationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MigrationEstimationResponse>>;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Calculate migration time estimation for an assessment
|
|
126
|
+
*/
|
|
127
|
+
calculateMigrationEstimation(requestParameters: CalculateMigrationEstimationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MigrationEstimationResponse>;
|
|
128
|
+
|
|
94
129
|
/**
|
|
95
130
|
* Creates request options for createAssessment without sending the request
|
|
96
131
|
* @param {AssessmentForm} assessmentForm
|
|
@@ -265,6 +300,61 @@ export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInter
|
|
|
265
300
|
return await response.value();
|
|
266
301
|
}
|
|
267
302
|
|
|
303
|
+
/**
|
|
304
|
+
* Creates request options for calculateMigrationEstimation without sending the request
|
|
305
|
+
*/
|
|
306
|
+
async calculateMigrationEstimationRequestOpts(requestParameters: CalculateMigrationEstimationRequest): Promise<runtime.RequestOpts> {
|
|
307
|
+
if (requestParameters['id'] == null) {
|
|
308
|
+
throw new runtime.RequiredError(
|
|
309
|
+
'id',
|
|
310
|
+
'Required parameter "id" was null or undefined when calling calculateMigrationEstimation().'
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (requestParameters['migrationEstimationRequest'] == null) {
|
|
315
|
+
throw new runtime.RequiredError(
|
|
316
|
+
'migrationEstimationRequest',
|
|
317
|
+
'Required parameter "migrationEstimationRequest" was null or undefined when calling calculateMigrationEstimation().'
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const queryParameters: any = {};
|
|
322
|
+
|
|
323
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
324
|
+
|
|
325
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
let urlPath = `/api/v1/assessments/{id}/migration-estimation`;
|
|
329
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
330
|
+
|
|
331
|
+
return {
|
|
332
|
+
path: urlPath,
|
|
333
|
+
method: 'POST',
|
|
334
|
+
headers: headerParameters,
|
|
335
|
+
query: queryParameters,
|
|
336
|
+
body: MigrationEstimationRequestToJSON(requestParameters['migrationEstimationRequest']),
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Calculate migration time estimation for an assessment
|
|
342
|
+
*/
|
|
343
|
+
async calculateMigrationEstimationRaw(requestParameters: CalculateMigrationEstimationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MigrationEstimationResponse>> {
|
|
344
|
+
const requestOptions = await this.calculateMigrationEstimationRequestOpts(requestParameters);
|
|
345
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
346
|
+
|
|
347
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MigrationEstimationResponseFromJSON(jsonValue));
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Calculate migration time estimation for an assessment
|
|
352
|
+
*/
|
|
353
|
+
async calculateMigrationEstimation(requestParameters: CalculateMigrationEstimationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MigrationEstimationResponse> {
|
|
354
|
+
const response = await this.calculateMigrationEstimationRaw(requestParameters, initOverrides);
|
|
355
|
+
return await response.value();
|
|
356
|
+
}
|
|
357
|
+
|
|
268
358
|
/**
|
|
269
359
|
* Creates request options for createAssessment without sending the request
|
|
270
360
|
*/
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Migration Planner API
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: undefined
|
|
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
|
+
import { mapValues } from '../runtime.js';
|
|
16
|
+
/**
|
|
17
|
+
* Detailed estimation result from a single calculator
|
|
18
|
+
* @export
|
|
19
|
+
* @interface EstimationDetail
|
|
20
|
+
*/
|
|
21
|
+
export interface EstimationDetail {
|
|
22
|
+
/**
|
|
23
|
+
* Estimated duration for this component (formatted as duration string)
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof EstimationDetail
|
|
26
|
+
*/
|
|
27
|
+
duration: string;
|
|
28
|
+
/**
|
|
29
|
+
* Explanation of how the estimation was calculated
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof EstimationDetail
|
|
32
|
+
*/
|
|
33
|
+
reason: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a given object implements the EstimationDetail interface.
|
|
38
|
+
*/
|
|
39
|
+
export function instanceOfEstimationDetail(value: object): value is EstimationDetail {
|
|
40
|
+
if (!('duration' in value) || value['duration'] === undefined) return false;
|
|
41
|
+
if (!('reason' in value) || value['reason'] === undefined) return false;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function EstimationDetailFromJSON(json: any): EstimationDetail {
|
|
46
|
+
return EstimationDetailFromJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function EstimationDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean): EstimationDetail {
|
|
50
|
+
if (json == null) {
|
|
51
|
+
return json;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
|
|
55
|
+
'duration': json['duration'],
|
|
56
|
+
'reason': json['reason'],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function EstimationDetailToJSON(json: any): EstimationDetail {
|
|
61
|
+
return EstimationDetailToJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function EstimationDetailToJSONTyped(value?: EstimationDetail | null, ignoreDiscriminator: boolean = false): any {
|
|
65
|
+
if (value == null) {
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
|
|
71
|
+
'duration': value['duration'],
|
|
72
|
+
'reason': value['reason'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Migration Planner API
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: undefined
|
|
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
|
+
import { mapValues } from '../runtime.js';
|
|
16
|
+
/**
|
|
17
|
+
* Request payload for calculating migration time estimation
|
|
18
|
+
* @export
|
|
19
|
+
* @interface MigrationEstimationRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface MigrationEstimationRequest {
|
|
22
|
+
/**
|
|
23
|
+
* ID of the cluster to calculate migration estimation for
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof MigrationEstimationRequest
|
|
26
|
+
*/
|
|
27
|
+
clusterId: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the MigrationEstimationRequest interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfMigrationEstimationRequest(value: object): value is MigrationEstimationRequest {
|
|
34
|
+
if (!('clusterId' in value) || value['clusterId'] === undefined) return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function MigrationEstimationRequestFromJSON(json: any): MigrationEstimationRequest {
|
|
39
|
+
return MigrationEstimationRequestFromJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function MigrationEstimationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): MigrationEstimationRequest {
|
|
43
|
+
if (json == null) {
|
|
44
|
+
return json;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
|
|
48
|
+
'clusterId': json['clusterId'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function MigrationEstimationRequestToJSON(json: any): MigrationEstimationRequest {
|
|
53
|
+
return MigrationEstimationRequestToJSONTyped(json, false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function MigrationEstimationRequestToJSONTyped(value?: MigrationEstimationRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
57
|
+
if (value == null) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'clusterId': value['clusterId'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Migration Planner API
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: undefined
|
|
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
|
+
import { mapValues } from '../runtime.js';
|
|
16
|
+
import type { EstimationDetail } from './EstimationDetail.js';
|
|
17
|
+
import {
|
|
18
|
+
EstimationDetailFromJSON,
|
|
19
|
+
EstimationDetailFromJSONTyped,
|
|
20
|
+
EstimationDetailToJSON,
|
|
21
|
+
EstimationDetailToJSONTyped,
|
|
22
|
+
} from './EstimationDetail.js';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Migration time estimation results
|
|
26
|
+
* @export
|
|
27
|
+
* @interface MigrationEstimationResponse
|
|
28
|
+
*/
|
|
29
|
+
export interface MigrationEstimationResponse {
|
|
30
|
+
/**
|
|
31
|
+
* Total estimated migration duration (formatted as duration string, e.g., "2h30m")
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof MigrationEstimationResponse
|
|
34
|
+
*/
|
|
35
|
+
totalDuration: string;
|
|
36
|
+
/**
|
|
37
|
+
* Breakdown of estimation by calculator
|
|
38
|
+
* @type {{ [key: string]: EstimationDetail; }}
|
|
39
|
+
* @memberof MigrationEstimationResponse
|
|
40
|
+
*/
|
|
41
|
+
breakdown: { [key: string]: EstimationDetail; };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check if a given object implements the MigrationEstimationResponse interface.
|
|
46
|
+
*/
|
|
47
|
+
export function instanceOfMigrationEstimationResponse(value: object): value is MigrationEstimationResponse {
|
|
48
|
+
if (!('totalDuration' in value) || value['totalDuration'] === undefined) return false;
|
|
49
|
+
if (!('breakdown' in value) || value['breakdown'] === undefined) return false;
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function MigrationEstimationResponseFromJSON(json: any): MigrationEstimationResponse {
|
|
54
|
+
return MigrationEstimationResponseFromJSONTyped(json, false);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function MigrationEstimationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MigrationEstimationResponse {
|
|
58
|
+
if (json == null) {
|
|
59
|
+
return json;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'totalDuration': json['totalDuration'],
|
|
64
|
+
'breakdown': (mapValues(json['breakdown'], EstimationDetailFromJSON)),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function MigrationEstimationResponseToJSON(json: any): MigrationEstimationResponse {
|
|
69
|
+
return MigrationEstimationResponseToJSONTyped(json, false);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function MigrationEstimationResponseToJSONTyped(value?: MigrationEstimationResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
73
|
+
if (value == null) {
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
|
|
79
|
+
'totalDuration': value['totalDuration'],
|
|
80
|
+
'breakdown': (mapValues(value['breakdown'], EstimationDetailToJSON)),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
package/src/models/ModelError.ts
CHANGED
|
@@ -25,12 +25,6 @@ export interface ModelError {
|
|
|
25
25
|
* @memberof ModelError
|
|
26
26
|
*/
|
|
27
27
|
message: string;
|
|
28
|
-
/**
|
|
29
|
-
* Id of the request generating the error
|
|
30
|
-
* @type {string}
|
|
31
|
-
* @memberof ModelError
|
|
32
|
-
*/
|
|
33
|
-
requestId?: string;
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
/**
|
|
@@ -52,7 +46,6 @@ export function ModelErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean)
|
|
|
52
46
|
return {
|
|
53
47
|
|
|
54
48
|
'message': json['message'],
|
|
55
|
-
'requestId': json['requestId'] == null ? undefined : json['requestId'],
|
|
56
49
|
};
|
|
57
50
|
}
|
|
58
51
|
|
|
@@ -68,7 +61,6 @@ export function ModelErrorToJSONTyped(value?: ModelError | null, ignoreDiscrimin
|
|
|
68
61
|
return {
|
|
69
62
|
|
|
70
63
|
'message': value['message'],
|
|
71
|
-
'requestId': value['requestId'],
|
|
72
64
|
};
|
|
73
65
|
}
|
|
74
66
|
|
package/src/models/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './ClusterSizing.js';
|
|
|
11
11
|
export * from './Datastore.js';
|
|
12
12
|
export * from './DiskSizeTierSummary.js';
|
|
13
13
|
export * from './DiskTypeSummary.js';
|
|
14
|
+
export * from './EstimationDetail.js';
|
|
14
15
|
export * from './Histogram.js';
|
|
15
16
|
export * from './Host.js';
|
|
16
17
|
export * from './Info.js';
|
|
@@ -22,6 +23,8 @@ export * from './Ipv4Config.js';
|
|
|
22
23
|
export * from './Job.js';
|
|
23
24
|
export * from './JobStatus.js';
|
|
24
25
|
export * from './Label.js';
|
|
26
|
+
export * from './MigrationEstimationRequest.js';
|
|
27
|
+
export * from './MigrationEstimationResponse.js';
|
|
25
28
|
export * from './MigrationIssue.js';
|
|
26
29
|
export * from './ModelError.js';
|
|
27
30
|
export * from './Network.js';
|