@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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration Planner API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: undefined
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Detailed estimation result from a single calculator
|
|
14
|
+
* @export
|
|
15
|
+
* @interface EstimationDetail
|
|
16
|
+
*/
|
|
17
|
+
export interface EstimationDetail {
|
|
18
|
+
/**
|
|
19
|
+
* Estimated duration for this component (formatted as duration string)
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof EstimationDetail
|
|
22
|
+
*/
|
|
23
|
+
duration: string;
|
|
24
|
+
/**
|
|
25
|
+
* Explanation of how the estimation was calculated
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof EstimationDetail
|
|
28
|
+
*/
|
|
29
|
+
reason: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if a given object implements the EstimationDetail interface.
|
|
33
|
+
*/
|
|
34
|
+
export declare function instanceOfEstimationDetail(value: object): value is EstimationDetail;
|
|
35
|
+
export declare function EstimationDetailFromJSON(json: any): EstimationDetail;
|
|
36
|
+
export declare function EstimationDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean): EstimationDetail;
|
|
37
|
+
export declare function EstimationDetailToJSON(json: any): EstimationDetail;
|
|
38
|
+
export declare function EstimationDetailToJSONTyped(value?: EstimationDetail | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Migration Planner API
|
|
6
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: undefined
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfEstimationDetail = instanceOfEstimationDetail;
|
|
17
|
+
exports.EstimationDetailFromJSON = EstimationDetailFromJSON;
|
|
18
|
+
exports.EstimationDetailFromJSONTyped = EstimationDetailFromJSONTyped;
|
|
19
|
+
exports.EstimationDetailToJSON = EstimationDetailToJSON;
|
|
20
|
+
exports.EstimationDetailToJSONTyped = EstimationDetailToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the EstimationDetail interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfEstimationDetail(value) {
|
|
25
|
+
if (!('duration' in value) || value['duration'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('reason' in value) || value['reason'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
function EstimationDetailFromJSON(json) {
|
|
32
|
+
return EstimationDetailFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
function EstimationDetailFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
if (json == null) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
'duration': json['duration'],
|
|
40
|
+
'reason': json['reason'],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function EstimationDetailToJSON(json) {
|
|
44
|
+
return EstimationDetailToJSONTyped(json, false);
|
|
45
|
+
}
|
|
46
|
+
function EstimationDetailToJSONTyped(value, ignoreDiscriminator = false) {
|
|
47
|
+
if (value == null) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
'duration': value['duration'],
|
|
52
|
+
'reason': value['reason'],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration Planner API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: undefined
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Request payload for calculating migration time estimation
|
|
14
|
+
* @export
|
|
15
|
+
* @interface MigrationEstimationRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface MigrationEstimationRequest {
|
|
18
|
+
/**
|
|
19
|
+
* ID of the cluster to calculate migration estimation for
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof MigrationEstimationRequest
|
|
22
|
+
*/
|
|
23
|
+
clusterId: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if a given object implements the MigrationEstimationRequest interface.
|
|
27
|
+
*/
|
|
28
|
+
export declare function instanceOfMigrationEstimationRequest(value: object): value is MigrationEstimationRequest;
|
|
29
|
+
export declare function MigrationEstimationRequestFromJSON(json: any): MigrationEstimationRequest;
|
|
30
|
+
export declare function MigrationEstimationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): MigrationEstimationRequest;
|
|
31
|
+
export declare function MigrationEstimationRequestToJSON(json: any): MigrationEstimationRequest;
|
|
32
|
+
export declare function MigrationEstimationRequestToJSONTyped(value?: MigrationEstimationRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Migration Planner API
|
|
6
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: undefined
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfMigrationEstimationRequest = instanceOfMigrationEstimationRequest;
|
|
17
|
+
exports.MigrationEstimationRequestFromJSON = MigrationEstimationRequestFromJSON;
|
|
18
|
+
exports.MigrationEstimationRequestFromJSONTyped = MigrationEstimationRequestFromJSONTyped;
|
|
19
|
+
exports.MigrationEstimationRequestToJSON = MigrationEstimationRequestToJSON;
|
|
20
|
+
exports.MigrationEstimationRequestToJSONTyped = MigrationEstimationRequestToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the MigrationEstimationRequest interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfMigrationEstimationRequest(value) {
|
|
25
|
+
if (!('clusterId' in value) || value['clusterId'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
function MigrationEstimationRequestFromJSON(json) {
|
|
30
|
+
return MigrationEstimationRequestFromJSONTyped(json, false);
|
|
31
|
+
}
|
|
32
|
+
function MigrationEstimationRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
|
+
if (json == null) {
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
'clusterId': json['clusterId'],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function MigrationEstimationRequestToJSON(json) {
|
|
41
|
+
return MigrationEstimationRequestToJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
function MigrationEstimationRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
44
|
+
if (value == null) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
'clusterId': value['clusterId'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration Planner API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: undefined
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { EstimationDetail } from './EstimationDetail.js';
|
|
13
|
+
/**
|
|
14
|
+
* Migration time estimation results
|
|
15
|
+
* @export
|
|
16
|
+
* @interface MigrationEstimationResponse
|
|
17
|
+
*/
|
|
18
|
+
export interface MigrationEstimationResponse {
|
|
19
|
+
/**
|
|
20
|
+
* Total estimated migration duration (formatted as duration string, e.g., "2h30m")
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof MigrationEstimationResponse
|
|
23
|
+
*/
|
|
24
|
+
totalDuration: string;
|
|
25
|
+
/**
|
|
26
|
+
* Breakdown of estimation by calculator
|
|
27
|
+
* @type {{ [key: string]: EstimationDetail; }}
|
|
28
|
+
* @memberof MigrationEstimationResponse
|
|
29
|
+
*/
|
|
30
|
+
breakdown: {
|
|
31
|
+
[key: string]: EstimationDetail;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Check if a given object implements the MigrationEstimationResponse interface.
|
|
36
|
+
*/
|
|
37
|
+
export declare function instanceOfMigrationEstimationResponse(value: object): value is MigrationEstimationResponse;
|
|
38
|
+
export declare function MigrationEstimationResponseFromJSON(json: any): MigrationEstimationResponse;
|
|
39
|
+
export declare function MigrationEstimationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MigrationEstimationResponse;
|
|
40
|
+
export declare function MigrationEstimationResponseToJSON(json: any): MigrationEstimationResponse;
|
|
41
|
+
export declare function MigrationEstimationResponseToJSONTyped(value?: MigrationEstimationResponse | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Migration Planner API
|
|
6
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: undefined
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfMigrationEstimationResponse = instanceOfMigrationEstimationResponse;
|
|
17
|
+
exports.MigrationEstimationResponseFromJSON = MigrationEstimationResponseFromJSON;
|
|
18
|
+
exports.MigrationEstimationResponseFromJSONTyped = MigrationEstimationResponseFromJSONTyped;
|
|
19
|
+
exports.MigrationEstimationResponseToJSON = MigrationEstimationResponseToJSON;
|
|
20
|
+
exports.MigrationEstimationResponseToJSONTyped = MigrationEstimationResponseToJSONTyped;
|
|
21
|
+
const runtime_js_1 = require("../runtime.js");
|
|
22
|
+
const EstimationDetail_js_1 = require("./EstimationDetail.js");
|
|
23
|
+
/**
|
|
24
|
+
* Check if a given object implements the MigrationEstimationResponse interface.
|
|
25
|
+
*/
|
|
26
|
+
function instanceOfMigrationEstimationResponse(value) {
|
|
27
|
+
if (!('totalDuration' in value) || value['totalDuration'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
if (!('breakdown' in value) || value['breakdown'] === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
function MigrationEstimationResponseFromJSON(json) {
|
|
34
|
+
return MigrationEstimationResponseFromJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
function MigrationEstimationResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
37
|
+
if (json == null) {
|
|
38
|
+
return json;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'totalDuration': json['totalDuration'],
|
|
42
|
+
'breakdown': ((0, runtime_js_1.mapValues)(json['breakdown'], EstimationDetail_js_1.EstimationDetailFromJSON)),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function MigrationEstimationResponseToJSON(json) {
|
|
46
|
+
return MigrationEstimationResponseToJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
function MigrationEstimationResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
49
|
+
if (value == null) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
'totalDuration': value['totalDuration'],
|
|
54
|
+
'breakdown': ((0, runtime_js_1.mapValues)(value['breakdown'], EstimationDetail_js_1.EstimationDetailToJSON)),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -21,12 +21,6 @@ export interface ModelError {
|
|
|
21
21
|
* @memberof ModelError
|
|
22
22
|
*/
|
|
23
23
|
message: string;
|
|
24
|
-
/**
|
|
25
|
-
* Id of the request generating the error
|
|
26
|
-
* @type {string}
|
|
27
|
-
* @memberof ModelError
|
|
28
|
-
*/
|
|
29
|
-
requestId?: string;
|
|
30
24
|
}
|
|
31
25
|
/**
|
|
32
26
|
* Check if a given object implements the ModelError interface.
|
|
@@ -35,7 +35,6 @@ function ModelErrorFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
35
35
|
}
|
|
36
36
|
return {
|
|
37
37
|
'message': json['message'],
|
|
38
|
-
'requestId': json['requestId'] == null ? undefined : json['requestId'],
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
40
|
function ModelErrorToJSON(json) {
|
|
@@ -47,6 +46,5 @@ function ModelErrorToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
47
46
|
}
|
|
48
47
|
return {
|
|
49
48
|
'message': value['message'],
|
|
50
|
-
'requestId': value['requestId'],
|
|
51
49
|
};
|
|
52
50
|
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './ClusterSizing.js';
|
|
|
9
9
|
export * from './Datastore.js';
|
|
10
10
|
export * from './DiskSizeTierSummary.js';
|
|
11
11
|
export * from './DiskTypeSummary.js';
|
|
12
|
+
export * from './EstimationDetail.js';
|
|
12
13
|
export * from './Histogram.js';
|
|
13
14
|
export * from './Host.js';
|
|
14
15
|
export * from './Info.js';
|
|
@@ -20,6 +21,8 @@ export * from './Ipv4Config.js';
|
|
|
20
21
|
export * from './Job.js';
|
|
21
22
|
export * from './JobStatus.js';
|
|
22
23
|
export * from './Label.js';
|
|
24
|
+
export * from './MigrationEstimationRequest.js';
|
|
25
|
+
export * from './MigrationEstimationResponse.js';
|
|
23
26
|
export * from './MigrationIssue.js';
|
|
24
27
|
export * from './ModelError.js';
|
|
25
28
|
export * from './Network.js';
|
package/dist/models/index.js
CHANGED
|
@@ -27,6 +27,7 @@ __exportStar(require("./ClusterSizing.js"), exports);
|
|
|
27
27
|
__exportStar(require("./Datastore.js"), exports);
|
|
28
28
|
__exportStar(require("./DiskSizeTierSummary.js"), exports);
|
|
29
29
|
__exportStar(require("./DiskTypeSummary.js"), exports);
|
|
30
|
+
__exportStar(require("./EstimationDetail.js"), exports);
|
|
30
31
|
__exportStar(require("./Histogram.js"), exports);
|
|
31
32
|
__exportStar(require("./Host.js"), exports);
|
|
32
33
|
__exportStar(require("./Info.js"), exports);
|
|
@@ -38,6 +39,8 @@ __exportStar(require("./Ipv4Config.js"), exports);
|
|
|
38
39
|
__exportStar(require("./Job.js"), exports);
|
|
39
40
|
__exportStar(require("./JobStatus.js"), exports);
|
|
40
41
|
__exportStar(require("./Label.js"), exports);
|
|
42
|
+
__exportStar(require("./MigrationEstimationRequest.js"), exports);
|
|
43
|
+
__exportStar(require("./MigrationEstimationResponse.js"), exports);
|
|
41
44
|
__exportStar(require("./MigrationIssue.js"), exports);
|
|
42
45
|
__exportStar(require("./ModelError.js"), exports);
|
|
43
46
|
__exportStar(require("./Network.js"), exports);
|
package/docs/AssessmentApi.md
CHANGED
|
@@ -5,6 +5,7 @@ All URIs are relative to *https://raw.githubusercontent.com*
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
7
|
| [**calculateAssessmentClusterRequirements**](AssessmentApi.md#calculateassessmentclusterrequirements) | **POST** /api/v1/assessments/{id}/cluster-requirements | |
|
|
8
|
+
| [**calculateMigrationEstimation**](AssessmentApi.md#calculatemigrationestimation) | **POST** /api/v1/assessments/{id}/migration-estimation | |
|
|
8
9
|
| [**createAssessment**](AssessmentApi.md#createassessment) | **POST** /api/v1/assessments | |
|
|
9
10
|
| [**deleteAssessment**](AssessmentApi.md#deleteassessment) | **DELETE** /api/v1/assessments/{id} | |
|
|
10
11
|
| [**getAssessment**](AssessmentApi.md#getassessment) | **GET** /api/v1/assessments/{id} | |
|
|
@@ -89,6 +90,81 @@ No authorization required
|
|
|
89
90
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
90
91
|
|
|
91
92
|
|
|
93
|
+
## calculateMigrationEstimation
|
|
94
|
+
|
|
95
|
+
> MigrationEstimationResponse calculateMigrationEstimation(id, migrationEstimationRequest)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
Calculate migration time estimation for an assessment
|
|
100
|
+
|
|
101
|
+
### Example
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import {
|
|
105
|
+
Configuration,
|
|
106
|
+
AssessmentApi,
|
|
107
|
+
} from '@openshift-migration-advisor/planner-sdk';
|
|
108
|
+
import type { CalculateMigrationEstimationRequest } from '@openshift-migration-advisor/planner-sdk';
|
|
109
|
+
|
|
110
|
+
async function example() {
|
|
111
|
+
console.log("🚀 Testing @openshift-migration-advisor/planner-sdk SDK...");
|
|
112
|
+
const api = new AssessmentApi();
|
|
113
|
+
|
|
114
|
+
const body = {
|
|
115
|
+
// string | ID of the assessment
|
|
116
|
+
id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
117
|
+
// MigrationEstimationRequest
|
|
118
|
+
migrationEstimationRequest: {"clusterId":"domain-c8"},
|
|
119
|
+
} satisfies CalculateMigrationEstimationRequest;
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
const data = await api.calculateMigrationEstimation(body);
|
|
123
|
+
console.log(data);
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error(error);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Run the test
|
|
130
|
+
example().catch(console.error);
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Parameters
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
| Name | Type | Description | Notes |
|
|
137
|
+
|------------- | ------------- | ------------- | -------------|
|
|
138
|
+
| **id** | `string` | ID of the assessment | [Defaults to `undefined`] |
|
|
139
|
+
| **migrationEstimationRequest** | [MigrationEstimationRequest](MigrationEstimationRequest.md) | | |
|
|
140
|
+
|
|
141
|
+
### Return type
|
|
142
|
+
|
|
143
|
+
[**MigrationEstimationResponse**](MigrationEstimationResponse.md)
|
|
144
|
+
|
|
145
|
+
### Authorization
|
|
146
|
+
|
|
147
|
+
No authorization required
|
|
148
|
+
|
|
149
|
+
### HTTP request headers
|
|
150
|
+
|
|
151
|
+
- **Content-Type**: `application/json`
|
|
152
|
+
- **Accept**: `application/json`
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
### HTTP response details
|
|
156
|
+
| Status code | Description | Response headers |
|
|
157
|
+
|-------------|-------------|------------------|
|
|
158
|
+
| **200** | Migration estimation calculation successful | - |
|
|
159
|
+
| **400** | Bad Request | - |
|
|
160
|
+
| **401** | Unauthorized | - |
|
|
161
|
+
| **403** | Forbidden | - |
|
|
162
|
+
| **404** | Assessment not found | - |
|
|
163
|
+
| **500** | Internal error | - |
|
|
164
|
+
|
|
165
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
166
|
+
|
|
167
|
+
|
|
92
168
|
## createAssessment
|
|
93
169
|
|
|
94
170
|
> Assessment createAssessment(assessmentForm)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# EstimationDetail
|
|
3
|
+
|
|
4
|
+
Detailed estimation result from a single calculator
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`duration` | string
|
|
11
|
+
`reason` | string
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { EstimationDetail } from '@openshift-migration-advisor/planner-sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"duration": 3h40m0s,
|
|
21
|
+
"reason": 1000.00 GB at 110 minutes per 500GB,
|
|
22
|
+
} satisfies EstimationDetail
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as EstimationDetail
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# MigrationEstimationRequest
|
|
3
|
+
|
|
4
|
+
Request payload for calculating migration time estimation
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`clusterId` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { MigrationEstimationRequest } from '@openshift-migration-advisor/planner-sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"clusterId": domain-c8,
|
|
20
|
+
} satisfies MigrationEstimationRequest
|
|
21
|
+
|
|
22
|
+
console.log(example)
|
|
23
|
+
|
|
24
|
+
// Convert the instance to a JSON string
|
|
25
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
26
|
+
console.log(exampleJSON)
|
|
27
|
+
|
|
28
|
+
// Parse the JSON string back to an object
|
|
29
|
+
const exampleParsed = JSON.parse(exampleJSON) as MigrationEstimationRequest
|
|
30
|
+
console.log(exampleParsed)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
34
|
+
|
|
35
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# MigrationEstimationResponse
|
|
3
|
+
|
|
4
|
+
Migration time estimation results
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`totalDuration` | string
|
|
11
|
+
`breakdown` | [{ [key: string]: EstimationDetail; }](EstimationDetail.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { MigrationEstimationResponse } from '@openshift-migration-advisor/planner-sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"totalDuration": 4h30m0s,
|
|
21
|
+
"breakdown": null,
|
|
22
|
+
} satisfies MigrationEstimationResponse
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as MigrationEstimationResponse
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
package/docs/ModelError.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
Name | Type
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`message` | string
|
|
10
|
-
`requestId` | string
|
|
11
10
|
|
|
12
11
|
## Example
|
|
13
12
|
|
|
@@ -17,7 +16,6 @@ import type { ModelError } from '@openshift-migration-advisor/planner-sdk'
|
|
|
17
16
|
// TODO: Update the object below with actual values
|
|
18
17
|
const example = {
|
|
19
18
|
"message": null,
|
|
20
|
-
"requestId": null,
|
|
21
19
|
} satisfies ModelError
|
|
22
20
|
|
|
23
21
|
console.log(example)
|
package/package.json
CHANGED