@openshift-migration-advisor/agent-sdk 0.12.0-1f1dc16fb9e5 → 0.12.0-b2d61b72e086
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 +4 -0
- package/README.md +6 -2
- package/dist/apis/DefaultApi.d.ts +74 -0
- package/dist/apis/DefaultApi.js +81 -0
- package/dist/esm/apis/DefaultApi.d.ts +74 -0
- package/dist/esm/apis/DefaultApi.js +81 -0
- package/dist/esm/models/RightsizingClusterListResponse.d.ts +39 -0
- package/dist/esm/models/RightsizingClusterListResponse.js +48 -0
- package/dist/esm/models/RightsizingClusterUtilization.d.ts +112 -0
- package/dist/esm/models/RightsizingClusterUtilization.js +95 -0
- package/dist/esm/models/VirtualMachineDetail.d.ts +7 -0
- package/dist/esm/models/VirtualMachineDetail.js +3 -0
- package/dist/esm/models/VmUtilizationDetails.d.ts +18 -0
- package/dist/esm/models/VmUtilizationDetails.js +12 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/models/RightsizingClusterListResponse.d.ts +39 -0
- package/dist/models/RightsizingClusterListResponse.js +55 -0
- package/dist/models/RightsizingClusterUtilization.d.ts +112 -0
- package/dist/models/RightsizingClusterUtilization.js +102 -0
- package/dist/models/VirtualMachineDetail.d.ts +7 -0
- package/dist/models/VirtualMachineDetail.js +3 -0
- package/dist/models/VmUtilizationDetails.d.ts +18 -0
- package/dist/models/VmUtilizationDetails.js +12 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/docs/DefaultApi.md +139 -0
- package/docs/RightsizingClusterListResponse.md +36 -0
- package/docs/RightsizingClusterUtilization.md +60 -0
- package/docs/VirtualMachineDetail.md +2 -0
- package/docs/VmUtilizationDetails.md +6 -0
- package/package.json +1 -1
- package/src/apis/DefaultApi.ts +152 -0
- package/src/models/RightsizingClusterListResponse.ts +83 -0
- package/src/models/RightsizingClusterUtilization.ts +185 -0
- package/src/models/VirtualMachineDetail.ts +15 -0
- package/src/models/VmUtilizationDetails.ts +27 -0
- package/src/models/index.ts +2 -0
|
@@ -22,6 +22,7 @@ const VMNIC_js_1 = require("./VMNIC.js");
|
|
|
22
22
|
const GuestNetwork_js_1 = require("./GuestNetwork.js");
|
|
23
23
|
const VMIssue_js_1 = require("./VMIssue.js");
|
|
24
24
|
const VMDevice_js_1 = require("./VMDevice.js");
|
|
25
|
+
const VmUtilizationDetails_js_1 = require("./VmUtilizationDetails.js");
|
|
25
26
|
const VMDisk_js_1 = require("./VMDisk.js");
|
|
26
27
|
const VmInspectionResults_js_1 = require("./VmInspectionResults.js");
|
|
27
28
|
/**
|
|
@@ -87,6 +88,7 @@ function VirtualMachineDetailFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
87
88
|
'guestNetworks': json['guestNetworks'] == null ? undefined : (json['guestNetworks'].map(GuestNetwork_js_1.GuestNetworkFromJSON)),
|
|
88
89
|
'issues': json['issues'] == null ? undefined : (json['issues'].map(VMIssue_js_1.VMIssueFromJSON)),
|
|
89
90
|
'inspection': json['inspection'] == null ? undefined : (0, VmInspectionResults_js_1.VmInspectionResultsFromJSON)(json['inspection']),
|
|
91
|
+
'utilization': json['utilization'] == null ? undefined : (0, VmUtilizationDetails_js_1.VmUtilizationDetailsFromJSON)(json['utilization']),
|
|
90
92
|
};
|
|
91
93
|
}
|
|
92
94
|
function VirtualMachineDetailToJSON(json) {
|
|
@@ -128,5 +130,6 @@ function VirtualMachineDetailToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
128
130
|
'guestNetworks': value['guestNetworks'] == null ? undefined : (value['guestNetworks'].map(GuestNetwork_js_1.GuestNetworkToJSON)),
|
|
129
131
|
'issues': value['issues'] == null ? undefined : (value['issues'].map(VMIssue_js_1.VMIssueToJSON)),
|
|
130
132
|
'inspection': (0, VmInspectionResults_js_1.VmInspectionResultsToJSON)(value['inspection']),
|
|
133
|
+
'utilization': (0, VmUtilizationDetails_js_1.VmUtilizationDetailsToJSON)(value['utilization']),
|
|
131
134
|
};
|
|
132
135
|
}
|
|
@@ -27,6 +27,24 @@ export interface VmUtilizationDetails {
|
|
|
27
27
|
* @memberof VmUtilizationDetails
|
|
28
28
|
*/
|
|
29
29
|
vmName: string;
|
|
30
|
+
/**
|
|
31
|
+
* Number of vCPUs provisioned for this VM
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof VmUtilizationDetails
|
|
34
|
+
*/
|
|
35
|
+
provisionedCpus: number;
|
|
36
|
+
/**
|
|
37
|
+
* Provisioned RAM (MB)
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof VmUtilizationDetails
|
|
40
|
+
*/
|
|
41
|
+
provisionedMemoryMb: number;
|
|
42
|
+
/**
|
|
43
|
+
* Provisioned disk (KB)
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof VmUtilizationDetails
|
|
46
|
+
*/
|
|
47
|
+
provisionedDiskKb: number;
|
|
30
48
|
/**
|
|
31
49
|
* CPU utilization average (%)
|
|
32
50
|
* @type {number}
|
|
@@ -26,6 +26,12 @@ function instanceOfVmUtilizationDetails(value) {
|
|
|
26
26
|
return false;
|
|
27
27
|
if (!('vmName' in value) || value['vmName'] === undefined)
|
|
28
28
|
return false;
|
|
29
|
+
if (!('provisionedCpus' in value) || value['provisionedCpus'] === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
if (!('provisionedMemoryMb' in value) || value['provisionedMemoryMb'] === undefined)
|
|
32
|
+
return false;
|
|
33
|
+
if (!('provisionedDiskKb' in value) || value['provisionedDiskKb'] === undefined)
|
|
34
|
+
return false;
|
|
29
35
|
if (!('cpuAvg' in value) || value['cpuAvg'] === undefined)
|
|
30
36
|
return false;
|
|
31
37
|
if (!('cpuP95' in value) || value['cpuP95'] === undefined)
|
|
@@ -58,6 +64,9 @@ function VmUtilizationDetailsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
58
64
|
return {
|
|
59
65
|
'moid': json['moid'],
|
|
60
66
|
'vmName': json['vm_name'],
|
|
67
|
+
'provisionedCpus': json['provisioned_cpus'],
|
|
68
|
+
'provisionedMemoryMb': json['provisioned_memory_mb'],
|
|
69
|
+
'provisionedDiskKb': json['provisioned_disk_kb'],
|
|
61
70
|
'cpuAvg': json['cpu_avg'],
|
|
62
71
|
'cpuP95': json['cpu_p95'],
|
|
63
72
|
'cpuMax': json['cpu_max'],
|
|
@@ -80,6 +89,9 @@ function VmUtilizationDetailsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
80
89
|
return {
|
|
81
90
|
'moid': value['moid'],
|
|
82
91
|
'vm_name': value['vmName'],
|
|
92
|
+
'provisioned_cpus': value['provisionedCpus'],
|
|
93
|
+
'provisioned_memory_mb': value['provisionedMemoryMb'],
|
|
94
|
+
'provisioned_disk_kb': value['provisionedDiskKb'],
|
|
83
95
|
'cpu_avg': value['cpuAvg'],
|
|
84
96
|
'cpu_p95': value['cpuP95'],
|
|
85
97
|
'cpu_max': value['cpuMax'],
|
package/dist/models/index.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export * from './OsInfo.js';
|
|
|
32
32
|
export * from './PairCapability.js';
|
|
33
33
|
export * from './PairCapabilityRequest.js';
|
|
34
34
|
export * from './PutForecasterCredentials403Response.js';
|
|
35
|
+
export * from './RightsizingClusterListResponse.js';
|
|
36
|
+
export * from './RightsizingClusterUtilization.js';
|
|
35
37
|
export * from './RightsizingCollectRequest.js';
|
|
36
38
|
export * from './RightsizingMetricStats.js';
|
|
37
39
|
export * from './RightsizingReport.js';
|
package/dist/models/index.js
CHANGED
|
@@ -50,6 +50,8 @@ __exportStar(require("./OsInfo.js"), exports);
|
|
|
50
50
|
__exportStar(require("./PairCapability.js"), exports);
|
|
51
51
|
__exportStar(require("./PairCapabilityRequest.js"), exports);
|
|
52
52
|
__exportStar(require("./PutForecasterCredentials403Response.js"), exports);
|
|
53
|
+
__exportStar(require("./RightsizingClusterListResponse.js"), exports);
|
|
54
|
+
__exportStar(require("./RightsizingClusterUtilization.js"), exports);
|
|
53
55
|
__exportStar(require("./RightsizingCollectRequest.js"), exports);
|
|
54
56
|
__exportStar(require("./RightsizingMetricStats.js"), exports);
|
|
55
57
|
__exportStar(require("./RightsizingReport.js"), exports);
|
package/docs/DefaultApi.md
CHANGED
|
@@ -17,7 +17,9 @@ All URIs are relative to *https://raw.githubusercontent.com/api/v1*
|
|
|
17
17
|
| [**getInspectorStatus**](DefaultApi.md#getinspectorstatus) | **GET** /inspector | Get inspector status |
|
|
18
18
|
| [**getInspectorVddkStatus**](DefaultApi.md#getinspectorvddkstatus) | **GET** /inspector/vddk | Get VDDK status |
|
|
19
19
|
| [**getInventory**](DefaultApi.md#getinventory) | **GET** /inventory | Get collected inventory |
|
|
20
|
+
| [**getLatestRightsizingClusters**](DefaultApi.md#getlatestrightsizingclusters) | **GET** /cluster_rightsizing | Get cluster-level utilization aggregates for the latest completed report |
|
|
20
21
|
| [**getRightsizingReport**](DefaultApi.md#getrightsizingreport) | **GET** /rightsizing/{id} | Get a specific rightsizing report with full VM metrics |
|
|
22
|
+
| [**getRightsizingReportClusters**](DefaultApi.md#getrightsizingreportclusters) | **GET** /cluster_rightsizing/{report_id} | Get cluster-level utilization aggregates for a specific report |
|
|
21
23
|
| [**getVM**](DefaultApi.md#getvm) | **GET** /vms/{id} | Get details about a vm |
|
|
22
24
|
| [**getVMUtilization**](DefaultApi.md#getvmutilization) | **GET** /vms/{id}/utilization | Get utilization breakdown for a specific VM |
|
|
23
25
|
| [**getVMs**](DefaultApi.md#getvms) | **GET** /vms | Get list of VMs with filtering and pagination |
|
|
@@ -897,6 +899,73 @@ No authorization required
|
|
|
897
899
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
898
900
|
|
|
899
901
|
|
|
902
|
+
## getLatestRightsizingClusters
|
|
903
|
+
|
|
904
|
+
> RightsizingClusterListResponse getLatestRightsizingClusters(byExpression)
|
|
905
|
+
|
|
906
|
+
Get cluster-level utilization aggregates for the latest completed report
|
|
907
|
+
|
|
908
|
+
### Example
|
|
909
|
+
|
|
910
|
+
```ts
|
|
911
|
+
import {
|
|
912
|
+
Configuration,
|
|
913
|
+
DefaultApi,
|
|
914
|
+
} from '@openshift-migration-advisor/agent-sdk';
|
|
915
|
+
import type { GetLatestRightsizingClustersRequest } from '@openshift-migration-advisor/agent-sdk';
|
|
916
|
+
|
|
917
|
+
async function example() {
|
|
918
|
+
console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
|
|
919
|
+
const api = new DefaultApi();
|
|
920
|
+
|
|
921
|
+
const body = {
|
|
922
|
+
// string | Filter DSL expression (e.g. \"cluster_id = \'domain-c123\'\"). Omit to return all clusters. (optional)
|
|
923
|
+
byExpression: byExpression_example,
|
|
924
|
+
} satisfies GetLatestRightsizingClustersRequest;
|
|
925
|
+
|
|
926
|
+
try {
|
|
927
|
+
const data = await api.getLatestRightsizingClusters(body);
|
|
928
|
+
console.log(data);
|
|
929
|
+
} catch (error) {
|
|
930
|
+
console.error(error);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// Run the test
|
|
935
|
+
example().catch(console.error);
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
### Parameters
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
| Name | Type | Description | Notes |
|
|
942
|
+
|------------- | ------------- | ------------- | -------------|
|
|
943
|
+
| **byExpression** | `string` | Filter DSL expression (e.g. \"cluster_id = \'domain-c123\'\"). Omit to return all clusters. | [Optional] [Defaults to `undefined`] |
|
|
944
|
+
|
|
945
|
+
### Return type
|
|
946
|
+
|
|
947
|
+
[**RightsizingClusterListResponse**](RightsizingClusterListResponse.md)
|
|
948
|
+
|
|
949
|
+
### Authorization
|
|
950
|
+
|
|
951
|
+
No authorization required
|
|
952
|
+
|
|
953
|
+
### HTTP request headers
|
|
954
|
+
|
|
955
|
+
- **Content-Type**: Not defined
|
|
956
|
+
- **Accept**: `application/json`
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
### HTTP response details
|
|
960
|
+
| Status code | Description | Response headers |
|
|
961
|
+
|-------------|-------------|------------------|
|
|
962
|
+
| **200** | Cluster utilization aggregates | - |
|
|
963
|
+
| **404** | No completed rightsizing report found | - |
|
|
964
|
+
| **500** | Internal server error | - |
|
|
965
|
+
|
|
966
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
967
|
+
|
|
968
|
+
|
|
900
969
|
## getRightsizingReport
|
|
901
970
|
|
|
902
971
|
> RightsizingReport getRightsizingReport(id)
|
|
@@ -964,6 +1033,76 @@ No authorization required
|
|
|
964
1033
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
965
1034
|
|
|
966
1035
|
|
|
1036
|
+
## getRightsizingReportClusters
|
|
1037
|
+
|
|
1038
|
+
> RightsizingClusterListResponse getRightsizingReportClusters(reportId, byExpression)
|
|
1039
|
+
|
|
1040
|
+
Get cluster-level utilization aggregates for a specific report
|
|
1041
|
+
|
|
1042
|
+
### Example
|
|
1043
|
+
|
|
1044
|
+
```ts
|
|
1045
|
+
import {
|
|
1046
|
+
Configuration,
|
|
1047
|
+
DefaultApi,
|
|
1048
|
+
} from '@openshift-migration-advisor/agent-sdk';
|
|
1049
|
+
import type { GetRightsizingReportClustersRequest } from '@openshift-migration-advisor/agent-sdk';
|
|
1050
|
+
|
|
1051
|
+
async function example() {
|
|
1052
|
+
console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
|
|
1053
|
+
const api = new DefaultApi();
|
|
1054
|
+
|
|
1055
|
+
const body = {
|
|
1056
|
+
// string | Rightsizing report UUID
|
|
1057
|
+
reportId: reportId_example,
|
|
1058
|
+
// string | Filter DSL expression (e.g. \"cluster_id = \'domain-c123\'\"). Omit to return all clusters. (optional)
|
|
1059
|
+
byExpression: byExpression_example,
|
|
1060
|
+
} satisfies GetRightsizingReportClustersRequest;
|
|
1061
|
+
|
|
1062
|
+
try {
|
|
1063
|
+
const data = await api.getRightsizingReportClusters(body);
|
|
1064
|
+
console.log(data);
|
|
1065
|
+
} catch (error) {
|
|
1066
|
+
console.error(error);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
// Run the test
|
|
1071
|
+
example().catch(console.error);
|
|
1072
|
+
```
|
|
1073
|
+
|
|
1074
|
+
### Parameters
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
| Name | Type | Description | Notes |
|
|
1078
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1079
|
+
| **reportId** | `string` | Rightsizing report UUID | [Defaults to `undefined`] |
|
|
1080
|
+
| **byExpression** | `string` | Filter DSL expression (e.g. \"cluster_id = \'domain-c123\'\"). Omit to return all clusters. | [Optional] [Defaults to `undefined`] |
|
|
1081
|
+
|
|
1082
|
+
### Return type
|
|
1083
|
+
|
|
1084
|
+
[**RightsizingClusterListResponse**](RightsizingClusterListResponse.md)
|
|
1085
|
+
|
|
1086
|
+
### Authorization
|
|
1087
|
+
|
|
1088
|
+
No authorization required
|
|
1089
|
+
|
|
1090
|
+
### HTTP request headers
|
|
1091
|
+
|
|
1092
|
+
- **Content-Type**: Not defined
|
|
1093
|
+
- **Accept**: `application/json`
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
### HTTP response details
|
|
1097
|
+
| Status code | Description | Response headers |
|
|
1098
|
+
|-------------|-------------|------------------|
|
|
1099
|
+
| **200** | Cluster utilization aggregates | - |
|
|
1100
|
+
| **404** | Report not found | - |
|
|
1101
|
+
| **500** | Internal server error | - |
|
|
1102
|
+
|
|
1103
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1104
|
+
|
|
1105
|
+
|
|
967
1106
|
## getVM
|
|
968
1107
|
|
|
969
1108
|
> VirtualMachineDetail getVM(id)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# RightsizingClusterListResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`reportId` | string
|
|
10
|
+
`clusters` | [Array<RightsizingClusterUtilization>](RightsizingClusterUtilization.md)
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { RightsizingClusterListResponse } from '@openshift-migration-advisor/agent-sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"reportId": null,
|
|
20
|
+
"clusters": null,
|
|
21
|
+
} satisfies RightsizingClusterListResponse
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as RightsizingClusterListResponse
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
# RightsizingClusterUtilization
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`clusterId` | string
|
|
10
|
+
`clusterName` | string
|
|
11
|
+
`vmCount` | number
|
|
12
|
+
`cpuAvg` | number
|
|
13
|
+
`cpuP95` | number
|
|
14
|
+
`cpuMax` | number
|
|
15
|
+
`memAvg` | number
|
|
16
|
+
`memP95` | number
|
|
17
|
+
`memMax` | number
|
|
18
|
+
`disk` | number
|
|
19
|
+
`confidence` | number
|
|
20
|
+
`totalProvisionedCpus` | number
|
|
21
|
+
`totalProvisionedMemoryMb` | number
|
|
22
|
+
`totalProvisionedDiskKb` | number
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import type { RightsizingClusterUtilization } from '@openshift-migration-advisor/agent-sdk'
|
|
28
|
+
|
|
29
|
+
// TODO: Update the object below with actual values
|
|
30
|
+
const example = {
|
|
31
|
+
"clusterId": null,
|
|
32
|
+
"clusterName": null,
|
|
33
|
+
"vmCount": null,
|
|
34
|
+
"cpuAvg": null,
|
|
35
|
+
"cpuP95": null,
|
|
36
|
+
"cpuMax": null,
|
|
37
|
+
"memAvg": null,
|
|
38
|
+
"memP95": null,
|
|
39
|
+
"memMax": null,
|
|
40
|
+
"disk": null,
|
|
41
|
+
"confidence": null,
|
|
42
|
+
"totalProvisionedCpus": null,
|
|
43
|
+
"totalProvisionedMemoryMb": null,
|
|
44
|
+
"totalProvisionedDiskKb": null,
|
|
45
|
+
} satisfies RightsizingClusterUtilization
|
|
46
|
+
|
|
47
|
+
console.log(example)
|
|
48
|
+
|
|
49
|
+
// Convert the instance to a JSON string
|
|
50
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
51
|
+
console.log(exampleJSON)
|
|
52
|
+
|
|
53
|
+
// Parse the JSON string back to an object
|
|
54
|
+
const exampleParsed = JSON.parse(exampleJSON) as RightsizingClusterUtilization
|
|
55
|
+
console.log(exampleParsed)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
59
|
+
|
|
60
|
+
|
|
@@ -37,6 +37,7 @@ Name | Type
|
|
|
37
37
|
`guestNetworks` | [Array<GuestNetwork>](GuestNetwork.md)
|
|
38
38
|
`issues` | [Array<VMIssue>](VMIssue.md)
|
|
39
39
|
`inspection` | [VmInspectionResults](VmInspectionResults.md)
|
|
40
|
+
`utilization` | [VmUtilizationDetails](VmUtilizationDetails.md)
|
|
40
41
|
|
|
41
42
|
## Example
|
|
42
43
|
|
|
@@ -76,6 +77,7 @@ const example = {
|
|
|
76
77
|
"guestNetworks": null,
|
|
77
78
|
"issues": null,
|
|
78
79
|
"inspection": null,
|
|
80
|
+
"utilization": null,
|
|
79
81
|
} satisfies VirtualMachineDetail
|
|
80
82
|
|
|
81
83
|
console.log(example)
|
|
@@ -8,6 +8,9 @@ Name | Type
|
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`moid` | string
|
|
10
10
|
`vmName` | string
|
|
11
|
+
`provisionedCpus` | number
|
|
12
|
+
`provisionedMemoryMb` | number
|
|
13
|
+
`provisionedDiskKb` | number
|
|
11
14
|
`cpuAvg` | number
|
|
12
15
|
`cpuP95` | number
|
|
13
16
|
`cpuMax` | number
|
|
@@ -28,6 +31,9 @@ import type { VmUtilizationDetails } from '@openshift-migration-advisor/agent-sd
|
|
|
28
31
|
const example = {
|
|
29
32
|
"moid": null,
|
|
30
33
|
"vmName": null,
|
|
34
|
+
"provisionedCpus": null,
|
|
35
|
+
"provisionedMemoryMb": null,
|
|
36
|
+
"provisionedDiskKb": null,
|
|
31
37
|
"cpuAvg": null,
|
|
32
38
|
"cpuP95": null,
|
|
33
39
|
"cpuMax": null,
|
package/package.json
CHANGED
package/src/apis/DefaultApi.ts
CHANGED
|
@@ -108,6 +108,11 @@ import {
|
|
|
108
108
|
PutForecasterCredentials403ResponseFromJSON,
|
|
109
109
|
PutForecasterCredentials403ResponseToJSON,
|
|
110
110
|
} from '../models/PutForecasterCredentials403Response.js';
|
|
111
|
+
import {
|
|
112
|
+
type RightsizingClusterListResponse,
|
|
113
|
+
RightsizingClusterListResponseFromJSON,
|
|
114
|
+
RightsizingClusterListResponseToJSON,
|
|
115
|
+
} from '../models/RightsizingClusterListResponse.js';
|
|
111
116
|
import {
|
|
112
117
|
type RightsizingCollectRequest,
|
|
113
118
|
RightsizingCollectRequestFromJSON,
|
|
@@ -220,10 +225,19 @@ export interface GetInventoryRequest {
|
|
|
220
225
|
groupId?: string;
|
|
221
226
|
}
|
|
222
227
|
|
|
228
|
+
export interface GetLatestRightsizingClustersRequest {
|
|
229
|
+
byExpression?: string;
|
|
230
|
+
}
|
|
231
|
+
|
|
223
232
|
export interface GetRightsizingReportRequest {
|
|
224
233
|
id: string;
|
|
225
234
|
}
|
|
226
235
|
|
|
236
|
+
export interface GetRightsizingReportClustersRequest {
|
|
237
|
+
reportId: string;
|
|
238
|
+
byExpression?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
227
241
|
export interface GetVMRequest {
|
|
228
242
|
id: string;
|
|
229
243
|
}
|
|
@@ -606,6 +620,29 @@ export interface DefaultApiInterface {
|
|
|
606
620
|
*/
|
|
607
621
|
getInventory(requestParameters: GetInventoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetInventory200Response>;
|
|
608
622
|
|
|
623
|
+
/**
|
|
624
|
+
* Creates request options for getLatestRightsizingClusters without sending the request
|
|
625
|
+
* @param {string} [byExpression] Filter DSL expression (e.g. \"cluster_id = \'domain-c123\'\"). Omit to return all clusters.
|
|
626
|
+
* @throws {RequiredError}
|
|
627
|
+
* @memberof DefaultApiInterface
|
|
628
|
+
*/
|
|
629
|
+
getLatestRightsizingClustersRequestOpts(requestParameters: GetLatestRightsizingClustersRequest): Promise<runtime.RequestOpts>;
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
*
|
|
633
|
+
* @summary Get cluster-level utilization aggregates for the latest completed report
|
|
634
|
+
* @param {string} [byExpression] Filter DSL expression (e.g. \"cluster_id = \'domain-c123\'\"). Omit to return all clusters.
|
|
635
|
+
* @param {*} [options] Override http request option.
|
|
636
|
+
* @throws {RequiredError}
|
|
637
|
+
* @memberof DefaultApiInterface
|
|
638
|
+
*/
|
|
639
|
+
getLatestRightsizingClustersRaw(requestParameters: GetLatestRightsizingClustersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RightsizingClusterListResponse>>;
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Get cluster-level utilization aggregates for the latest completed report
|
|
643
|
+
*/
|
|
644
|
+
getLatestRightsizingClusters(requestParameters: GetLatestRightsizingClustersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RightsizingClusterListResponse>;
|
|
645
|
+
|
|
609
646
|
/**
|
|
610
647
|
* Creates request options for getRightsizingReport without sending the request
|
|
611
648
|
* @param {string} id Report UUID
|
|
@@ -629,6 +666,31 @@ export interface DefaultApiInterface {
|
|
|
629
666
|
*/
|
|
630
667
|
getRightsizingReport(requestParameters: GetRightsizingReportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RightsizingReport>;
|
|
631
668
|
|
|
669
|
+
/**
|
|
670
|
+
* Creates request options for getRightsizingReportClusters without sending the request
|
|
671
|
+
* @param {string} reportId Rightsizing report UUID
|
|
672
|
+
* @param {string} [byExpression] Filter DSL expression (e.g. \"cluster_id = \'domain-c123\'\"). Omit to return all clusters.
|
|
673
|
+
* @throws {RequiredError}
|
|
674
|
+
* @memberof DefaultApiInterface
|
|
675
|
+
*/
|
|
676
|
+
getRightsizingReportClustersRequestOpts(requestParameters: GetRightsizingReportClustersRequest): Promise<runtime.RequestOpts>;
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
*
|
|
680
|
+
* @summary Get cluster-level utilization aggregates for a specific report
|
|
681
|
+
* @param {string} reportId Rightsizing report UUID
|
|
682
|
+
* @param {string} [byExpression] Filter DSL expression (e.g. \"cluster_id = \'domain-c123\'\"). Omit to return all clusters.
|
|
683
|
+
* @param {*} [options] Override http request option.
|
|
684
|
+
* @throws {RequiredError}
|
|
685
|
+
* @memberof DefaultApiInterface
|
|
686
|
+
*/
|
|
687
|
+
getRightsizingReportClustersRaw(requestParameters: GetRightsizingReportClustersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RightsizingClusterListResponse>>;
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Get cluster-level utilization aggregates for a specific report
|
|
691
|
+
*/
|
|
692
|
+
getRightsizingReportClusters(requestParameters: GetRightsizingReportClustersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RightsizingClusterListResponse>;
|
|
693
|
+
|
|
632
694
|
/**
|
|
633
695
|
* Creates request options for getVM without sending the request
|
|
634
696
|
* @param {string} id VirtualMachine id
|
|
@@ -1693,6 +1755,47 @@ export class DefaultApi extends runtime.BaseAPI implements DefaultApiInterface {
|
|
|
1693
1755
|
return await response.value();
|
|
1694
1756
|
}
|
|
1695
1757
|
|
|
1758
|
+
/**
|
|
1759
|
+
* Creates request options for getLatestRightsizingClusters without sending the request
|
|
1760
|
+
*/
|
|
1761
|
+
async getLatestRightsizingClustersRequestOpts(requestParameters: GetLatestRightsizingClustersRequest): Promise<runtime.RequestOpts> {
|
|
1762
|
+
const queryParameters: any = {};
|
|
1763
|
+
|
|
1764
|
+
if (requestParameters['byExpression'] != null) {
|
|
1765
|
+
queryParameters['byExpression'] = requestParameters['byExpression'];
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
let urlPath = `/cluster_rightsizing`;
|
|
1772
|
+
|
|
1773
|
+
return {
|
|
1774
|
+
path: urlPath,
|
|
1775
|
+
method: 'GET',
|
|
1776
|
+
headers: headerParameters,
|
|
1777
|
+
query: queryParameters,
|
|
1778
|
+
};
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
/**
|
|
1782
|
+
* Get cluster-level utilization aggregates for the latest completed report
|
|
1783
|
+
*/
|
|
1784
|
+
async getLatestRightsizingClustersRaw(requestParameters: GetLatestRightsizingClustersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RightsizingClusterListResponse>> {
|
|
1785
|
+
const requestOptions = await this.getLatestRightsizingClustersRequestOpts(requestParameters);
|
|
1786
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1787
|
+
|
|
1788
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RightsizingClusterListResponseFromJSON(jsonValue));
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
/**
|
|
1792
|
+
* Get cluster-level utilization aggregates for the latest completed report
|
|
1793
|
+
*/
|
|
1794
|
+
async getLatestRightsizingClusters(requestParameters: GetLatestRightsizingClustersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RightsizingClusterListResponse> {
|
|
1795
|
+
const response = await this.getLatestRightsizingClustersRaw(requestParameters, initOverrides);
|
|
1796
|
+
return await response.value();
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1696
1799
|
/**
|
|
1697
1800
|
* Creates request options for getRightsizingReport without sending the request
|
|
1698
1801
|
*/
|
|
@@ -1738,6 +1841,55 @@ export class DefaultApi extends runtime.BaseAPI implements DefaultApiInterface {
|
|
|
1738
1841
|
return await response.value();
|
|
1739
1842
|
}
|
|
1740
1843
|
|
|
1844
|
+
/**
|
|
1845
|
+
* Creates request options for getRightsizingReportClusters without sending the request
|
|
1846
|
+
*/
|
|
1847
|
+
async getRightsizingReportClustersRequestOpts(requestParameters: GetRightsizingReportClustersRequest): Promise<runtime.RequestOpts> {
|
|
1848
|
+
if (requestParameters['reportId'] == null) {
|
|
1849
|
+
throw new runtime.RequiredError(
|
|
1850
|
+
'reportId',
|
|
1851
|
+
'Required parameter "reportId" was null or undefined when calling getRightsizingReportClusters().'
|
|
1852
|
+
);
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
const queryParameters: any = {};
|
|
1856
|
+
|
|
1857
|
+
if (requestParameters['byExpression'] != null) {
|
|
1858
|
+
queryParameters['byExpression'] = requestParameters['byExpression'];
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1862
|
+
|
|
1863
|
+
|
|
1864
|
+
let urlPath = `/cluster_rightsizing/{report_id}`;
|
|
1865
|
+
urlPath = urlPath.replace('{report_id}', encodeURIComponent(String(requestParameters['reportId'])));
|
|
1866
|
+
|
|
1867
|
+
return {
|
|
1868
|
+
path: urlPath,
|
|
1869
|
+
method: 'GET',
|
|
1870
|
+
headers: headerParameters,
|
|
1871
|
+
query: queryParameters,
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
/**
|
|
1876
|
+
* Get cluster-level utilization aggregates for a specific report
|
|
1877
|
+
*/
|
|
1878
|
+
async getRightsizingReportClustersRaw(requestParameters: GetRightsizingReportClustersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RightsizingClusterListResponse>> {
|
|
1879
|
+
const requestOptions = await this.getRightsizingReportClustersRequestOpts(requestParameters);
|
|
1880
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1881
|
+
|
|
1882
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RightsizingClusterListResponseFromJSON(jsonValue));
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
/**
|
|
1886
|
+
* Get cluster-level utilization aggregates for a specific report
|
|
1887
|
+
*/
|
|
1888
|
+
async getRightsizingReportClusters(requestParameters: GetRightsizingReportClustersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RightsizingClusterListResponse> {
|
|
1889
|
+
const response = await this.getRightsizingReportClustersRaw(requestParameters, initOverrides);
|
|
1890
|
+
return await response.value();
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1741
1893
|
/**
|
|
1742
1894
|
* Creates request options for getVM without sending the request
|
|
1743
1895
|
*/
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Assisted Migration Agent API
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: v1
|
|
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 { RightsizingClusterUtilization } from './RightsizingClusterUtilization.js';
|
|
17
|
+
import {
|
|
18
|
+
RightsizingClusterUtilizationFromJSON,
|
|
19
|
+
RightsizingClusterUtilizationFromJSONTyped,
|
|
20
|
+
RightsizingClusterUtilizationToJSON,
|
|
21
|
+
RightsizingClusterUtilizationToJSONTyped,
|
|
22
|
+
} from './RightsizingClusterUtilization.js';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface RightsizingClusterListResponse
|
|
28
|
+
*/
|
|
29
|
+
export interface RightsizingClusterListResponse {
|
|
30
|
+
/**
|
|
31
|
+
* The report ID this data was aggregated from
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof RightsizingClusterListResponse
|
|
34
|
+
*/
|
|
35
|
+
reportId: string;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {Array<RightsizingClusterUtilization>}
|
|
39
|
+
* @memberof RightsizingClusterListResponse
|
|
40
|
+
*/
|
|
41
|
+
clusters: Array<RightsizingClusterUtilization>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check if a given object implements the RightsizingClusterListResponse interface.
|
|
46
|
+
*/
|
|
47
|
+
export function instanceOfRightsizingClusterListResponse(value: object): value is RightsizingClusterListResponse {
|
|
48
|
+
if (!('reportId' in value) || value['reportId'] === undefined) return false;
|
|
49
|
+
if (!('clusters' in value) || value['clusters'] === undefined) return false;
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function RightsizingClusterListResponseFromJSON(json: any): RightsizingClusterListResponse {
|
|
54
|
+
return RightsizingClusterListResponseFromJSONTyped(json, false);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function RightsizingClusterListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RightsizingClusterListResponse {
|
|
58
|
+
if (json == null) {
|
|
59
|
+
return json;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'reportId': json['report_id'],
|
|
64
|
+
'clusters': ((json['clusters'] as Array<any>).map(RightsizingClusterUtilizationFromJSON)),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function RightsizingClusterListResponseToJSON(json: any): RightsizingClusterListResponse {
|
|
69
|
+
return RightsizingClusterListResponseToJSONTyped(json, false);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function RightsizingClusterListResponseToJSONTyped(value?: RightsizingClusterListResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
73
|
+
if (value == null) {
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
|
|
79
|
+
'report_id': value['reportId'],
|
|
80
|
+
'clusters': ((value['clusters'] as Array<any>).map(RightsizingClusterUtilizationToJSON)),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|