@openshift-migration-advisor/planner-sdk 0.13.3 → 0.13.4
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 +14 -0
- package/README.md +9 -2
- package/dist/apis/SizingApi.d.ts +61 -0
- package/dist/apis/SizingApi.js +74 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/SizingApi.d.ts +61 -0
- package/dist/esm/apis/SizingApi.js +70 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/ClusterFeatures.d.ts +54 -0
- package/dist/esm/models/ClusterFeatures.js +54 -0
- package/dist/esm/models/ClusterRequirementsRequest.d.ts +6 -23
- package/dist/esm/models/ClusterRequirementsRequest.js +6 -21
- package/dist/esm/models/ClusterUtilization.d.ts +68 -0
- package/dist/esm/models/ClusterUtilization.js +67 -0
- package/dist/esm/models/CpuOverCommitRatio.d.ts +27 -0
- package/dist/esm/models/CpuOverCommitRatio.js +45 -0
- package/dist/esm/models/InventoryData.d.ts +14 -0
- package/dist/esm/models/InventoryData.js +6 -0
- package/dist/esm/models/MemoryOverCommitRatio.d.ts +26 -0
- package/dist/esm/models/MemoryOverCommitRatio.js +44 -0
- package/dist/esm/models/StandaloneClusterRequirementsRequest.d.ts +114 -0
- package/dist/esm/models/StandaloneClusterRequirementsRequest.js +88 -0
- package/dist/esm/models/StandaloneClusterRequirementsResponse.d.ts +40 -0
- package/dist/esm/models/StandaloneClusterRequirementsResponse.js +49 -0
- package/dist/esm/models/index.d.ts +6 -0
- package/dist/esm/models/index.js +6 -0
- package/dist/models/ClusterFeatures.d.ts +54 -0
- package/dist/models/ClusterFeatures.js +62 -0
- package/dist/models/ClusterRequirementsRequest.d.ts +6 -23
- package/dist/models/ClusterRequirementsRequest.js +7 -22
- package/dist/models/ClusterUtilization.d.ts +68 -0
- package/dist/models/ClusterUtilization.js +74 -0
- package/dist/models/CpuOverCommitRatio.d.ts +27 -0
- package/dist/models/CpuOverCommitRatio.js +53 -0
- package/dist/models/InventoryData.d.ts +14 -0
- package/dist/models/InventoryData.js +6 -0
- package/dist/models/MemoryOverCommitRatio.d.ts +26 -0
- package/dist/models/MemoryOverCommitRatio.js +52 -0
- package/dist/models/StandaloneClusterRequirementsRequest.d.ts +114 -0
- package/dist/models/StandaloneClusterRequirementsRequest.js +96 -0
- package/dist/models/StandaloneClusterRequirementsResponse.d.ts +40 -0
- package/dist/models/StandaloneClusterRequirementsResponse.js +56 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +6 -0
- package/docs/AccountApi.md +9 -0
- package/docs/ClusterFeatures.md +38 -0
- package/docs/ClusterRequirementsRequest.md +2 -2
- package/docs/ClusterUtilization.md +46 -0
- package/docs/CpuOverCommitRatio.md +33 -0
- package/docs/InventoryData.md +4 -0
- package/docs/MemoryOverCommitRatio.md +33 -0
- package/docs/SizingApi.md +80 -0
- package/docs/StandaloneClusterRequirementsRequest.md +59 -0
- package/docs/StandaloneClusterRequirementsResponse.md +37 -0
- package/package.json +1 -1
- package/src/apis/SizingApi.ts +114 -0
- package/src/apis/index.ts +1 -0
- package/src/models/ClusterFeatures.ts +94 -0
- package/src/models/ClusterRequirementsRequest.ts +23 -29
- package/src/models/ClusterUtilization.ts +120 -0
- package/src/models/CpuOverCommitRatio.ts +55 -0
- package/src/models/InventoryData.ts +30 -0
- package/src/models/MemoryOverCommitRatio.ts +54 -0
- package/src/models/StandaloneClusterRequirementsRequest.ts +194 -0
- package/src/models/StandaloneClusterRequirementsResponse.ts +90 -0
- package/src/models/index.ts +6 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# SizingApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://raw.githubusercontent.com*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**calculateClusterRequirements**](SizingApi.md#calculateclusterrequirements) | **POST** /api/v1/cluster-requirements | |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## calculateClusterRequirements
|
|
12
|
+
|
|
13
|
+
> StandaloneClusterRequirementsResponse calculateClusterRequirements(standaloneClusterRequirementsRequest)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Calculate cluster requirements for hypothetical workload with inline inventory data (no assessment required)
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
Configuration,
|
|
24
|
+
SizingApi,
|
|
25
|
+
} from '@openshift-migration-advisor/planner-sdk';
|
|
26
|
+
import type { CalculateClusterRequirementsRequest } from '@openshift-migration-advisor/planner-sdk';
|
|
27
|
+
|
|
28
|
+
async function example() {
|
|
29
|
+
console.log("🚀 Testing @openshift-migration-advisor/planner-sdk SDK...");
|
|
30
|
+
const api = new SizingApi();
|
|
31
|
+
|
|
32
|
+
const body = {
|
|
33
|
+
// StandaloneClusterRequirementsRequest
|
|
34
|
+
standaloneClusterRequirementsRequest: {"totalVMs":100,"totalCPU":400,"totalMemory":800,"cpuOverCommitRatio":"1:4","memoryOverCommitRatio":"1:2","workerNodeCPU":16,"workerNodeMemory":64},
|
|
35
|
+
} satisfies CalculateClusterRequirementsRequest;
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
const data = await api.calculateClusterRequirements(body);
|
|
39
|
+
console.log(data);
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error(error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Run the test
|
|
46
|
+
example().catch(console.error);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Parameters
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
| Name | Type | Description | Notes |
|
|
53
|
+
|------------- | ------------- | ------------- | -------------|
|
|
54
|
+
| **standaloneClusterRequirementsRequest** | [StandaloneClusterRequirementsRequest](StandaloneClusterRequirementsRequest.md) | | |
|
|
55
|
+
|
|
56
|
+
### Return type
|
|
57
|
+
|
|
58
|
+
[**StandaloneClusterRequirementsResponse**](StandaloneClusterRequirementsResponse.md)
|
|
59
|
+
|
|
60
|
+
### Authorization
|
|
61
|
+
|
|
62
|
+
No authorization required
|
|
63
|
+
|
|
64
|
+
### HTTP request headers
|
|
65
|
+
|
|
66
|
+
- **Content-Type**: `application/json`
|
|
67
|
+
- **Accept**: `application/json`
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### HTTP response details
|
|
71
|
+
| Status code | Description | Response headers |
|
|
72
|
+
|-------------|-------------|------------------|
|
|
73
|
+
| **200** | Cluster requirements calculation successful | - |
|
|
74
|
+
| **400** | Bad Request | - |
|
|
75
|
+
| **401** | Unauthorized | - |
|
|
76
|
+
| **500** | Internal error | - |
|
|
77
|
+
| **503** | Service Unavailable | - |
|
|
78
|
+
|
|
79
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
80
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
# StandaloneClusterRequirementsRequest
|
|
3
|
+
|
|
4
|
+
Request payload for calculating cluster requirements with inline inventory data (no assessment required)
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`totalVMs` | number
|
|
11
|
+
`totalCPU` | number
|
|
12
|
+
`totalMemory` | number
|
|
13
|
+
`cpuOverCommitRatio` | [CpuOverCommitRatio](CpuOverCommitRatio.md)
|
|
14
|
+
`memoryOverCommitRatio` | [MemoryOverCommitRatio](MemoryOverCommitRatio.md)
|
|
15
|
+
`workerNodeCPU` | number
|
|
16
|
+
`workerNodeMemory` | number
|
|
17
|
+
`workerNodeThreads` | number
|
|
18
|
+
`controlPlaneSchedulable` | boolean
|
|
19
|
+
`controlPlaneCPU` | number
|
|
20
|
+
`controlPlaneMemory` | number
|
|
21
|
+
`controlPlaneNodeCount` | number
|
|
22
|
+
`hostedControlPlane` | boolean
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import type { StandaloneClusterRequirementsRequest } from '@openshift-migration-advisor/planner-sdk'
|
|
28
|
+
|
|
29
|
+
// TODO: Update the object below with actual values
|
|
30
|
+
const example = {
|
|
31
|
+
"totalVMs": null,
|
|
32
|
+
"totalCPU": null,
|
|
33
|
+
"totalMemory": null,
|
|
34
|
+
"cpuOverCommitRatio": null,
|
|
35
|
+
"memoryOverCommitRatio": null,
|
|
36
|
+
"workerNodeCPU": null,
|
|
37
|
+
"workerNodeMemory": null,
|
|
38
|
+
"workerNodeThreads": null,
|
|
39
|
+
"controlPlaneSchedulable": null,
|
|
40
|
+
"controlPlaneCPU": null,
|
|
41
|
+
"controlPlaneMemory": null,
|
|
42
|
+
"controlPlaneNodeCount": null,
|
|
43
|
+
"hostedControlPlane": null,
|
|
44
|
+
} satisfies StandaloneClusterRequirementsRequest
|
|
45
|
+
|
|
46
|
+
console.log(example)
|
|
47
|
+
|
|
48
|
+
// Convert the instance to a JSON string
|
|
49
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
50
|
+
console.log(exampleJSON)
|
|
51
|
+
|
|
52
|
+
// Parse the JSON string back to an object
|
|
53
|
+
const exampleParsed = JSON.parse(exampleJSON) as StandaloneClusterRequirementsRequest
|
|
54
|
+
console.log(exampleParsed)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
58
|
+
|
|
59
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# StandaloneClusterRequirementsResponse
|
|
3
|
+
|
|
4
|
+
Sizing results; omits inventoryTotals (already in the request).
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`clusterSizing` | [ClusterSizing](ClusterSizing.md)
|
|
11
|
+
`resourceConsumption` | [SizingResourceConsumption](SizingResourceConsumption.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { StandaloneClusterRequirementsResponse } from '@openshift-migration-advisor/planner-sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"clusterSizing": null,
|
|
21
|
+
"resourceConsumption": null,
|
|
22
|
+
} satisfies StandaloneClusterRequirementsResponse
|
|
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 StandaloneClusterRequirementsResponse
|
|
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/package.json
CHANGED
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
import * as runtime from '../runtime.js';
|
|
16
|
+
import {
|
|
17
|
+
type StandaloneClusterRequirementsRequest,
|
|
18
|
+
StandaloneClusterRequirementsRequestFromJSON,
|
|
19
|
+
StandaloneClusterRequirementsRequestToJSON,
|
|
20
|
+
} from '../models/StandaloneClusterRequirementsRequest.js';
|
|
21
|
+
import {
|
|
22
|
+
type StandaloneClusterRequirementsResponse,
|
|
23
|
+
StandaloneClusterRequirementsResponseFromJSON,
|
|
24
|
+
StandaloneClusterRequirementsResponseToJSON,
|
|
25
|
+
} from '../models/StandaloneClusterRequirementsResponse.js';
|
|
26
|
+
|
|
27
|
+
export interface CalculateClusterRequirementsRequest {
|
|
28
|
+
standaloneClusterRequirementsRequest: StandaloneClusterRequirementsRequest;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* SizingApi - interface
|
|
33
|
+
*
|
|
34
|
+
* @export
|
|
35
|
+
* @interface SizingApiInterface
|
|
36
|
+
*/
|
|
37
|
+
export interface SizingApiInterface {
|
|
38
|
+
/**
|
|
39
|
+
* Creates request options for calculateClusterRequirements without sending the request
|
|
40
|
+
* @param {StandaloneClusterRequirementsRequest} standaloneClusterRequirementsRequest
|
|
41
|
+
* @throws {RequiredError}
|
|
42
|
+
* @memberof SizingApiInterface
|
|
43
|
+
*/
|
|
44
|
+
calculateClusterRequirementsRequestOpts(requestParameters: CalculateClusterRequirementsRequest): Promise<runtime.RequestOpts>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Calculate cluster requirements for hypothetical workload with inline inventory data (no assessment required)
|
|
48
|
+
* @param {StandaloneClusterRequirementsRequest} standaloneClusterRequirementsRequest
|
|
49
|
+
* @param {*} [options] Override http request option.
|
|
50
|
+
* @throws {RequiredError}
|
|
51
|
+
* @memberof SizingApiInterface
|
|
52
|
+
*/
|
|
53
|
+
calculateClusterRequirementsRaw(requestParameters: CalculateClusterRequirementsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StandaloneClusterRequirementsResponse>>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Calculate cluster requirements for hypothetical workload with inline inventory data (no assessment required)
|
|
57
|
+
*/
|
|
58
|
+
calculateClusterRequirements(requestParameters: CalculateClusterRequirementsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StandaloneClusterRequirementsResponse>;
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
export class SizingApi extends runtime.BaseAPI implements SizingApiInterface {
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Creates request options for calculateClusterRequirements without sending the request
|
|
69
|
+
*/
|
|
70
|
+
async calculateClusterRequirementsRequestOpts(requestParameters: CalculateClusterRequirementsRequest): Promise<runtime.RequestOpts> {
|
|
71
|
+
if (requestParameters['standaloneClusterRequirementsRequest'] == null) {
|
|
72
|
+
throw new runtime.RequiredError(
|
|
73
|
+
'standaloneClusterRequirementsRequest',
|
|
74
|
+
'Required parameter "standaloneClusterRequirementsRequest" was null or undefined when calling calculateClusterRequirements().'
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const queryParameters: any = {};
|
|
79
|
+
|
|
80
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
81
|
+
|
|
82
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
let urlPath = `/api/v1/cluster-requirements`;
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
path: urlPath,
|
|
89
|
+
method: 'POST',
|
|
90
|
+
headers: headerParameters,
|
|
91
|
+
query: queryParameters,
|
|
92
|
+
body: StandaloneClusterRequirementsRequestToJSON(requestParameters['standaloneClusterRequirementsRequest']),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Calculate cluster requirements for hypothetical workload with inline inventory data (no assessment required)
|
|
98
|
+
*/
|
|
99
|
+
async calculateClusterRequirementsRaw(requestParameters: CalculateClusterRequirementsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StandaloneClusterRequirementsResponse>> {
|
|
100
|
+
const requestOptions = await this.calculateClusterRequirementsRequestOpts(requestParameters);
|
|
101
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
102
|
+
|
|
103
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => StandaloneClusterRequirementsResponseFromJSON(jsonValue));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Calculate cluster requirements for hypothetical workload with inline inventory data (no assessment required)
|
|
108
|
+
*/
|
|
109
|
+
async calculateClusterRequirements(requestParameters: CalculateClusterRequirementsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StandaloneClusterRequirementsResponse> {
|
|
110
|
+
const response = await this.calculateClusterRequirementsRaw(requestParameters, initOverrides);
|
|
111
|
+
return await response.value();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
}
|
package/src/apis/index.ts
CHANGED
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
import { mapValues } from '../runtime.js';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ClusterFeatures
|
|
20
|
+
*/
|
|
21
|
+
export interface ClusterFeatures {
|
|
22
|
+
/**
|
|
23
|
+
* Whether DRS (Distributed Resource Scheduler) is enabled for this cluster
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
* @memberof ClusterFeatures
|
|
26
|
+
*/
|
|
27
|
+
drsEnabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* DRS automation mode for the cluster
|
|
30
|
+
* @type {ClusterFeaturesDrsModeEnum}
|
|
31
|
+
* @memberof ClusterFeatures
|
|
32
|
+
*/
|
|
33
|
+
drsMode?: ClusterFeaturesDrsModeEnum;
|
|
34
|
+
/**
|
|
35
|
+
* Whether Storage DRS is enabled for this cluster
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
* @memberof ClusterFeatures
|
|
38
|
+
*/
|
|
39
|
+
storageDrsEnabled?: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @export
|
|
45
|
+
*/
|
|
46
|
+
export const ClusterFeaturesDrsModeEnum = {
|
|
47
|
+
FullyAutomated: 'Fully Automated',
|
|
48
|
+
PartiallyAutomated: 'Partially Automated',
|
|
49
|
+
Manual: 'Manual',
|
|
50
|
+
None: 'None'
|
|
51
|
+
} as const;
|
|
52
|
+
export type ClusterFeaturesDrsModeEnum = typeof ClusterFeaturesDrsModeEnum[keyof typeof ClusterFeaturesDrsModeEnum];
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Check if a given object implements the ClusterFeatures interface.
|
|
57
|
+
*/
|
|
58
|
+
export function instanceOfClusterFeatures(value: object): value is ClusterFeatures {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function ClusterFeaturesFromJSON(json: any): ClusterFeatures {
|
|
63
|
+
return ClusterFeaturesFromJSONTyped(json, false);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function ClusterFeaturesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClusterFeatures {
|
|
67
|
+
if (json == null) {
|
|
68
|
+
return json;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
|
|
72
|
+
'drsEnabled': json['drsEnabled'] == null ? undefined : json['drsEnabled'],
|
|
73
|
+
'drsMode': json['drsMode'] == null ? undefined : json['drsMode'],
|
|
74
|
+
'storageDrsEnabled': json['storageDrsEnabled'] == null ? undefined : json['storageDrsEnabled'],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function ClusterFeaturesToJSON(json: any): ClusterFeatures {
|
|
79
|
+
return ClusterFeaturesToJSONTyped(json, false);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function ClusterFeaturesToJSONTyped(value?: ClusterFeatures | null, ignoreDiscriminator: boolean = false): any {
|
|
83
|
+
if (value == null) {
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
|
|
89
|
+
'drsEnabled': value['drsEnabled'],
|
|
90
|
+
'drsMode': value['drsMode'],
|
|
91
|
+
'storageDrsEnabled': value['storageDrsEnabled'],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
@@ -13,6 +13,21 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime.js';
|
|
16
|
+
import type { CpuOverCommitRatio } from './CpuOverCommitRatio.js';
|
|
17
|
+
import {
|
|
18
|
+
CpuOverCommitRatioFromJSON,
|
|
19
|
+
CpuOverCommitRatioFromJSONTyped,
|
|
20
|
+
CpuOverCommitRatioToJSON,
|
|
21
|
+
CpuOverCommitRatioToJSONTyped,
|
|
22
|
+
} from './CpuOverCommitRatio.js';
|
|
23
|
+
import type { MemoryOverCommitRatio } from './MemoryOverCommitRatio.js';
|
|
24
|
+
import {
|
|
25
|
+
MemoryOverCommitRatioFromJSON,
|
|
26
|
+
MemoryOverCommitRatioFromJSONTyped,
|
|
27
|
+
MemoryOverCommitRatioToJSON,
|
|
28
|
+
MemoryOverCommitRatioToJSONTyped,
|
|
29
|
+
} from './MemoryOverCommitRatio.js';
|
|
30
|
+
|
|
16
31
|
/**
|
|
17
32
|
* Request payload for calculating cluster requirements
|
|
18
33
|
* @export
|
|
@@ -27,16 +42,16 @@ export interface ClusterRequirementsRequest {
|
|
|
27
42
|
clusterId: string;
|
|
28
43
|
/**
|
|
29
44
|
* CPU over-commit ratio (e.g., "1:4")
|
|
30
|
-
* @type {
|
|
45
|
+
* @type {CpuOverCommitRatio}
|
|
31
46
|
* @memberof ClusterRequirementsRequest
|
|
32
47
|
*/
|
|
33
|
-
cpuOverCommitRatio:
|
|
48
|
+
cpuOverCommitRatio: CpuOverCommitRatio;
|
|
34
49
|
/**
|
|
35
50
|
* Memory over-commit ratio (e.g., "1:2")
|
|
36
|
-
* @type {
|
|
51
|
+
* @type {MemoryOverCommitRatio}
|
|
37
52
|
* @memberof ClusterRequirementsRequest
|
|
38
53
|
*/
|
|
39
|
-
memoryOverCommitRatio:
|
|
54
|
+
memoryOverCommitRatio: MemoryOverCommitRatio;
|
|
40
55
|
/**
|
|
41
56
|
* CPU cores per worker node
|
|
42
57
|
* @type {number}
|
|
@@ -88,27 +103,6 @@ export interface ClusterRequirementsRequest {
|
|
|
88
103
|
}
|
|
89
104
|
|
|
90
105
|
|
|
91
|
-
/**
|
|
92
|
-
* @export
|
|
93
|
-
*/
|
|
94
|
-
export const ClusterRequirementsRequestCpuOverCommitRatioEnum = {
|
|
95
|
-
CpuOneToOne: '1:1',
|
|
96
|
-
CpuOneToTwo: '1:2',
|
|
97
|
-
CpuOneToFour: '1:4',
|
|
98
|
-
CpuOneToSix: '1:6'
|
|
99
|
-
} as const;
|
|
100
|
-
export type ClusterRequirementsRequestCpuOverCommitRatioEnum = typeof ClusterRequirementsRequestCpuOverCommitRatioEnum[keyof typeof ClusterRequirementsRequestCpuOverCommitRatioEnum];
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* @export
|
|
104
|
-
*/
|
|
105
|
-
export const ClusterRequirementsRequestMemoryOverCommitRatioEnum = {
|
|
106
|
-
MemoryOneToOne: '1:1',
|
|
107
|
-
MemoryOneToTwo: '1:2',
|
|
108
|
-
MemoryOneToFour: '1:4'
|
|
109
|
-
} as const;
|
|
110
|
-
export type ClusterRequirementsRequestMemoryOverCommitRatioEnum = typeof ClusterRequirementsRequestMemoryOverCommitRatioEnum[keyof typeof ClusterRequirementsRequestMemoryOverCommitRatioEnum];
|
|
111
|
-
|
|
112
106
|
/**
|
|
113
107
|
* @export
|
|
114
108
|
*/
|
|
@@ -142,8 +136,8 @@ export function ClusterRequirementsRequestFromJSONTyped(json: any, ignoreDiscrim
|
|
|
142
136
|
return {
|
|
143
137
|
|
|
144
138
|
'clusterId': json['clusterId'],
|
|
145
|
-
'cpuOverCommitRatio': json['cpuOverCommitRatio'],
|
|
146
|
-
'memoryOverCommitRatio': json['memoryOverCommitRatio'],
|
|
139
|
+
'cpuOverCommitRatio': CpuOverCommitRatioFromJSON(json['cpuOverCommitRatio']),
|
|
140
|
+
'memoryOverCommitRatio': MemoryOverCommitRatioFromJSON(json['memoryOverCommitRatio']),
|
|
147
141
|
'workerNodeCPU': json['workerNodeCPU'],
|
|
148
142
|
'workerNodeMemory': json['workerNodeMemory'],
|
|
149
143
|
'workerNodeThreads': json['workerNodeThreads'] == null ? undefined : json['workerNodeThreads'],
|
|
@@ -167,8 +161,8 @@ export function ClusterRequirementsRequestToJSONTyped(value?: ClusterRequirement
|
|
|
167
161
|
return {
|
|
168
162
|
|
|
169
163
|
'clusterId': value['clusterId'],
|
|
170
|
-
'cpuOverCommitRatio': value['cpuOverCommitRatio'],
|
|
171
|
-
'memoryOverCommitRatio': value['memoryOverCommitRatio'],
|
|
164
|
+
'cpuOverCommitRatio': CpuOverCommitRatioToJSON(value['cpuOverCommitRatio']),
|
|
165
|
+
'memoryOverCommitRatio': MemoryOverCommitRatioToJSON(value['memoryOverCommitRatio']),
|
|
172
166
|
'workerNodeCPU': value['workerNodeCPU'],
|
|
173
167
|
'workerNodeMemory': value['workerNodeMemory'],
|
|
174
168
|
'workerNodeThreads': value['workerNodeThreads'],
|
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
import { mapValues } from '../runtime.js';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ClusterUtilization
|
|
20
|
+
*/
|
|
21
|
+
export interface ClusterUtilization {
|
|
22
|
+
/**
|
|
23
|
+
* Average CPU utilization percentage (0-100)
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof ClusterUtilization
|
|
26
|
+
*/
|
|
27
|
+
cpuAvg: number;
|
|
28
|
+
/**
|
|
29
|
+
* 95th percentile CPU utilization percentage (0-100)
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof ClusterUtilization
|
|
32
|
+
*/
|
|
33
|
+
cpuP95: number;
|
|
34
|
+
/**
|
|
35
|
+
* Maximum CPU utilization percentage (0-100)
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof ClusterUtilization
|
|
38
|
+
*/
|
|
39
|
+
cpuMax: number;
|
|
40
|
+
/**
|
|
41
|
+
* Average memory utilization percentage (0-100)
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof ClusterUtilization
|
|
44
|
+
*/
|
|
45
|
+
memAvg: number;
|
|
46
|
+
/**
|
|
47
|
+
* 95th percentile memory utilization percentage (0-100)
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof ClusterUtilization
|
|
50
|
+
*/
|
|
51
|
+
memP95: number;
|
|
52
|
+
/**
|
|
53
|
+
* Maximum memory utilization percentage (0-100)
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof ClusterUtilization
|
|
56
|
+
*/
|
|
57
|
+
memMax: number;
|
|
58
|
+
/**
|
|
59
|
+
* Data coverage confidence percentage (0-100), calculated as vCPU-weighted coverage
|
|
60
|
+
* @type {number}
|
|
61
|
+
* @memberof ClusterUtilization
|
|
62
|
+
*/
|
|
63
|
+
confidence: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Check if a given object implements the ClusterUtilization interface.
|
|
68
|
+
*/
|
|
69
|
+
export function instanceOfClusterUtilization(value: object): value is ClusterUtilization {
|
|
70
|
+
if ((!('cpuAvg' in value) && !('cpu_avg' in value)) || (value['cpuAvg'] === undefined && value['cpu_avg'] === undefined)) return false;
|
|
71
|
+
if ((!('cpuP95' in value) && !('cpu_p95' in value)) || (value['cpuP95'] === undefined && value['cpu_p95'] === undefined)) return false;
|
|
72
|
+
if ((!('cpuMax' in value) && !('cpu_max' in value)) || (value['cpuMax'] === undefined && value['cpu_max'] === undefined)) return false;
|
|
73
|
+
if ((!('memAvg' in value) && !('mem_avg' in value)) || (value['memAvg'] === undefined && value['mem_avg'] === undefined)) return false;
|
|
74
|
+
if ((!('memP95' in value) && !('mem_p95' in value)) || (value['memP95'] === undefined && value['mem_p95'] === undefined)) return false;
|
|
75
|
+
if ((!('memMax' in value) && !('mem_max' in value)) || (value['memMax'] === undefined && value['mem_max'] === undefined)) return false;
|
|
76
|
+
if (!('confidence' in value) || value['confidence'] === undefined) return false;
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function ClusterUtilizationFromJSON(json: any): ClusterUtilization {
|
|
81
|
+
return ClusterUtilizationFromJSONTyped(json, false);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function ClusterUtilizationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClusterUtilization {
|
|
85
|
+
if (json == null) {
|
|
86
|
+
return json;
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
|
|
90
|
+
'cpuAvg': json['cpu_avg'],
|
|
91
|
+
'cpuP95': json['cpu_p95'],
|
|
92
|
+
'cpuMax': json['cpu_max'],
|
|
93
|
+
'memAvg': json['mem_avg'],
|
|
94
|
+
'memP95': json['mem_p95'],
|
|
95
|
+
'memMax': json['mem_max'],
|
|
96
|
+
'confidence': json['confidence'],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function ClusterUtilizationToJSON(json: any): ClusterUtilization {
|
|
101
|
+
return ClusterUtilizationToJSONTyped(json, false);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function ClusterUtilizationToJSONTyped(value?: ClusterUtilization | null, ignoreDiscriminator: boolean = false): any {
|
|
105
|
+
if (value == null) {
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
|
|
111
|
+
'cpu_avg': value['cpuAvg'],
|
|
112
|
+
'cpu_p95': value['cpuP95'],
|
|
113
|
+
'cpu_max': value['cpuMax'],
|
|
114
|
+
'mem_avg': value['memAvg'],
|
|
115
|
+
'mem_p95': value['memP95'],
|
|
116
|
+
'mem_max': value['memMax'],
|
|
117
|
+
'confidence': value['confidence'],
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
* CPU over-commit ratio
|
|
18
|
+
* @export
|
|
19
|
+
*/
|
|
20
|
+
export const CpuOverCommitRatio = {
|
|
21
|
+
CpuOneToOne: '1:1',
|
|
22
|
+
CpuOneToTwo: '1:2',
|
|
23
|
+
CpuOneToFour: '1:4',
|
|
24
|
+
CpuOneToSix: '1:6'
|
|
25
|
+
} as const;
|
|
26
|
+
export type CpuOverCommitRatio = typeof CpuOverCommitRatio[keyof typeof CpuOverCommitRatio];
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export function instanceOfCpuOverCommitRatio(value: any): boolean {
|
|
30
|
+
for (const key in CpuOverCommitRatio) {
|
|
31
|
+
if (Object.prototype.hasOwnProperty.call(CpuOverCommitRatio, key)) {
|
|
32
|
+
if (CpuOverCommitRatio[key as keyof typeof CpuOverCommitRatio] === value) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function CpuOverCommitRatioFromJSON(json: any): CpuOverCommitRatio {
|
|
41
|
+
return CpuOverCommitRatioFromJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function CpuOverCommitRatioFromJSONTyped(json: any, ignoreDiscriminator: boolean): CpuOverCommitRatio {
|
|
45
|
+
return json as CpuOverCommitRatio;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function CpuOverCommitRatioToJSON(value?: CpuOverCommitRatio | null): any {
|
|
49
|
+
return value as any;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function CpuOverCommitRatioToJSONTyped(value: any, ignoreDiscriminator: boolean): CpuOverCommitRatio {
|
|
53
|
+
return value as CpuOverCommitRatio;
|
|
54
|
+
}
|
|
55
|
+
|