@openshift-migration-advisor/agent-sdk 0.33.0 → 0.33.1-693656015cf9
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 +26 -0
- package/.openapi-generator/VERSION +1 -1
- package/README.md +21 -3
- package/dist/apis/AppliancesApi.d.ts +194 -0
- package/dist/apis/AppliancesApi.js +201 -0
- package/dist/apis/GroupsApi.d.ts +6 -6
- package/dist/apis/ImageUpgradeApi.d.ts +66 -0
- package/dist/apis/ImageUpgradeApi.js +90 -0
- package/dist/apis/VirtualMachinesApi.d.ts +6 -6
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/AppliancesApi.d.ts +194 -0
- package/dist/esm/apis/AppliancesApi.js +201 -0
- package/dist/esm/apis/GroupsApi.d.ts +6 -6
- package/dist/esm/apis/ImageUpgradeApi.d.ts +66 -0
- package/dist/esm/apis/ImageUpgradeApi.js +86 -0
- package/dist/esm/apis/VirtualMachinesApi.d.ts +6 -6
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/AgentStatus.d.ts +5 -0
- package/dist/esm/models/AgentStatus.js +5 -0
- package/dist/esm/models/ApplianceRule.d.ts +90 -0
- package/dist/esm/models/ApplianceRule.js +98 -0
- package/dist/esm/models/ApplianceRuleCondition.d.ts +42 -0
- package/dist/esm/models/ApplianceRuleCondition.js +48 -0
- package/dist/esm/models/ApplianceRuleFunction.d.ts +37 -0
- package/dist/esm/models/ApplianceRuleFunction.js +46 -0
- package/dist/esm/models/ApplianceRuleListResponse.d.ts +31 -0
- package/dist/esm/models/ApplianceRuleListResponse.js +44 -0
- package/dist/esm/models/ApplianceRuleRequest.d.ts +74 -0
- package/dist/esm/models/ApplianceRuleRequest.js +85 -0
- package/dist/esm/models/DiskGeometryCondition.d.ts +47 -0
- package/dist/esm/models/DiskGeometryCondition.js +58 -0
- package/dist/esm/models/ImageUpgradeImage.d.ts +34 -0
- package/dist/esm/models/ImageUpgradeImage.js +47 -0
- package/dist/esm/models/ImageUpgradeResult.d.ts +66 -0
- package/dist/esm/models/ImageUpgradeResult.js +71 -0
- package/dist/esm/models/ImageUpgradeStatus.d.ts +44 -0
- package/dist/esm/models/ImageUpgradeStatus.js +57 -0
- package/dist/esm/models/ImageUploadStatus.d.ts +44 -0
- package/dist/esm/models/ImageUploadStatus.js +56 -0
- package/dist/esm/models/RDMBacking.d.ts +26 -0
- package/dist/esm/models/RDMBacking.js +17 -0
- package/dist/esm/models/RDMHostLun.d.ts +42 -0
- package/dist/esm/models/RDMHostLun.js +49 -0
- package/dist/esm/models/SuccessfulImageUpgrade.d.ts +38 -0
- package/dist/esm/models/SuccessfulImageUpgrade.js +52 -0
- package/dist/esm/models/VMFilterOptionsResponse.d.ts +8 -0
- package/dist/esm/models/VMFilterOptionsResponse.js +8 -0
- package/dist/esm/models/VirtualMachine.d.ts +8 -0
- package/dist/esm/models/VirtualMachine.js +4 -0
- package/dist/esm/models/VirtualMachineDisk.d.ts +8 -0
- package/dist/esm/models/VirtualMachineDisk.js +4 -0
- package/dist/esm/models/index.d.ts +12 -0
- package/dist/esm/models/index.js +12 -0
- package/dist/models/AgentStatus.d.ts +5 -0
- package/dist/models/AgentStatus.js +5 -0
- package/dist/models/ApplianceRule.d.ts +90 -0
- package/dist/models/ApplianceRule.js +106 -0
- package/dist/models/ApplianceRuleCondition.d.ts +42 -0
- package/dist/models/ApplianceRuleCondition.js +55 -0
- package/dist/models/ApplianceRuleFunction.d.ts +37 -0
- package/dist/models/ApplianceRuleFunction.js +53 -0
- package/dist/models/ApplianceRuleListResponse.d.ts +31 -0
- package/dist/models/ApplianceRuleListResponse.js +51 -0
- package/dist/models/ApplianceRuleRequest.d.ts +74 -0
- package/dist/models/ApplianceRuleRequest.js +93 -0
- package/dist/models/DiskGeometryCondition.d.ts +47 -0
- package/dist/models/DiskGeometryCondition.js +66 -0
- package/dist/models/ImageUpgradeImage.d.ts +34 -0
- package/dist/models/ImageUpgradeImage.js +54 -0
- package/dist/models/ImageUpgradeResult.d.ts +66 -0
- package/dist/models/ImageUpgradeResult.js +79 -0
- package/dist/models/ImageUpgradeStatus.d.ts +44 -0
- package/dist/models/ImageUpgradeStatus.js +64 -0
- package/dist/models/ImageUploadStatus.d.ts +44 -0
- package/dist/models/ImageUploadStatus.js +64 -0
- package/dist/models/RDMBacking.d.ts +26 -0
- package/dist/models/RDMBacking.js +18 -0
- package/dist/models/RDMHostLun.d.ts +42 -0
- package/dist/models/RDMHostLun.js +56 -0
- package/dist/models/SuccessfulImageUpgrade.d.ts +38 -0
- package/dist/models/SuccessfulImageUpgrade.js +59 -0
- package/dist/models/VMFilterOptionsResponse.d.ts +8 -0
- package/dist/models/VMFilterOptionsResponse.js +8 -0
- package/dist/models/VirtualMachine.d.ts +8 -0
- package/dist/models/VirtualMachine.js +4 -0
- package/dist/models/VirtualMachineDisk.d.ts +8 -0
- package/dist/models/VirtualMachineDisk.js +4 -0
- package/dist/models/index.d.ts +12 -0
- package/dist/models/index.js +12 -0
- package/docs/AgentStatus.md +2 -0
- package/docs/ApplianceRule.md +50 -0
- package/docs/ApplianceRuleCondition.md +39 -0
- package/docs/ApplianceRuleFunction.md +37 -0
- package/docs/ApplianceRuleListResponse.md +34 -0
- package/docs/ApplianceRuleRequest.md +46 -0
- package/docs/AppliancesApi.md +338 -0
- package/docs/DiskGeometryCondition.md +38 -0
- package/docs/GroupsApi.md +4 -4
- package/docs/ImageUpgradeApi.md +82 -0
- package/docs/ImageUpgradeImage.md +36 -0
- package/docs/ImageUpgradeResult.md +46 -0
- package/docs/ImageUpgradeStatus.md +40 -0
- package/docs/ImageUploadStatus.md +36 -0
- package/docs/RDMBacking.md +8 -0
- package/docs/RDMHostLun.md +41 -0
- package/docs/SuccessfulImageUpgrade.md +38 -0
- package/docs/VMFilterOptionsResponse.md +4 -0
- package/docs/VirtualMachine.md +4 -0
- package/docs/VirtualMachineDisk.md +4 -0
- package/docs/VirtualMachinesApi.md +4 -4
- package/package.json +1 -1
- package/src/apis/AppliancesApi.ts +393 -0
- package/src/apis/GroupsApi.ts +6 -6
- package/src/apis/ImageUpgradeApi.ts +128 -0
- package/src/apis/VirtualMachinesApi.ts +6 -6
- package/src/apis/index.ts +1 -0
- package/src/models/AgentStatus.ts +14 -0
- package/src/models/ApplianceRule.ts +159 -0
- package/src/models/ApplianceRuleCondition.ts +87 -0
- package/src/models/ApplianceRuleFunction.ts +80 -0
- package/src/models/ApplianceRuleListResponse.ts +72 -0
- package/src/models/ApplianceRuleRequest.ts +137 -0
- package/src/models/DiskGeometryCondition.ts +90 -0
- package/src/models/ImageUpgradeImage.ts +71 -0
- package/src/models/ImageUpgradeResult.ts +130 -0
- package/src/models/ImageUpgradeStatus.ts +100 -0
- package/src/models/ImageUploadStatus.ts +84 -0
- package/src/models/RDMBacking.ts +44 -0
- package/src/models/RDMHostLun.ts +82 -0
- package/src/models/SuccessfulImageUpgrade.ts +78 -0
- package/src/models/VMFilterOptionsResponse.ts +14 -0
- package/src/models/VirtualMachine.ts +12 -0
- package/src/models/VirtualMachineDisk.ts +12 -0
- package/src/models/index.ts +12 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# ApplianceRuleCondition
|
|
3
|
+
|
|
4
|
+
One condition. Either a filter expression over VM attributes or a call to a registered predicate function carrying its own payload. Exactly one of expression or function must be set. Condition names must be unique within a rule, and min_matched may not exceed the number of conditions.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`name` | string
|
|
11
|
+
`expression` | string
|
|
12
|
+
`_function` | [ApplianceRuleFunction](ApplianceRuleFunction.md)
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { ApplianceRuleCondition } from '@openshift-migration-advisor/agent-sdk'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"name": null,
|
|
22
|
+
"expression": null,
|
|
23
|
+
"_function": null,
|
|
24
|
+
} satisfies ApplianceRuleCondition
|
|
25
|
+
|
|
26
|
+
console.log(example)
|
|
27
|
+
|
|
28
|
+
// Convert the instance to a JSON string
|
|
29
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
30
|
+
console.log(exampleJSON)
|
|
31
|
+
|
|
32
|
+
// Parse the JSON string back to an object
|
|
33
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApplianceRuleCondition
|
|
34
|
+
console.log(exampleParsed)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
38
|
+
|
|
39
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# ApplianceRuleFunction
|
|
3
|
+
|
|
4
|
+
A registered predicate selected by name. Exactly one payload field, the one matching name, must be set; the payload is validated server-side against the predicate the name resolves to.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`name` | string
|
|
11
|
+
`disk_geometry` | [DiskGeometryCondition](DiskGeometryCondition.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ApplianceRuleFunction } from '@openshift-migration-advisor/agent-sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"name": null,
|
|
21
|
+
"disk_geometry": null,
|
|
22
|
+
} satisfies ApplianceRuleFunction
|
|
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 ApplianceRuleFunction
|
|
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,34 @@
|
|
|
1
|
+
|
|
2
|
+
# ApplianceRuleListResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`rules` | [Array<ApplianceRule>](ApplianceRule.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { ApplianceRuleListResponse } from '@openshift-migration-advisor/agent-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"rules": null,
|
|
19
|
+
} satisfies ApplianceRuleListResponse
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApplianceRuleListResponse
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
# ApplianceRuleRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`vendor` | string
|
|
11
|
+
`category` | string
|
|
12
|
+
`osv_verdict` | string
|
|
13
|
+
`max_confidence` | string
|
|
14
|
+
`min_matched` | number
|
|
15
|
+
`conditions` | [Array<ApplianceRuleCondition>](ApplianceRuleCondition.md)
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import type { ApplianceRuleRequest } from '@openshift-migration-advisor/agent-sdk'
|
|
21
|
+
|
|
22
|
+
// TODO: Update the object below with actual values
|
|
23
|
+
const example = {
|
|
24
|
+
"name": null,
|
|
25
|
+
"vendor": null,
|
|
26
|
+
"category": null,
|
|
27
|
+
"osv_verdict": null,
|
|
28
|
+
"max_confidence": null,
|
|
29
|
+
"min_matched": null,
|
|
30
|
+
"conditions": null,
|
|
31
|
+
} satisfies ApplianceRuleRequest
|
|
32
|
+
|
|
33
|
+
console.log(example)
|
|
34
|
+
|
|
35
|
+
// Convert the instance to a JSON string
|
|
36
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
37
|
+
console.log(exampleJSON)
|
|
38
|
+
|
|
39
|
+
// Parse the JSON string back to an object
|
|
40
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApplianceRuleRequest
|
|
41
|
+
console.log(exampleParsed)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
45
|
+
|
|
46
|
+
|
package/docs/AppliancesApi.md
CHANGED
|
@@ -4,10 +4,275 @@ All URIs are relative to *https://raw.githubusercontent.com/api/v2*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
|
+
| [**createApplianceRule**](AppliancesApi.md#createappliancerule) | **POST** /appliances/rules | Create an appliance rule |
|
|
8
|
+
| [**deleteApplianceRule**](AppliancesApi.md#deleteappliancerule) | **DELETE** /appliances/rules/{ruleId} | Delete an appliance rule |
|
|
9
|
+
| [**getApplianceRule**](AppliancesApi.md#getappliancerule) | **GET** /appliances/rules/{ruleId} | Get an appliance rule |
|
|
10
|
+
| [**listApplianceRules**](AppliancesApi.md#listappliancerules) | **GET** /appliances/rules | List appliance rules |
|
|
7
11
|
| [**listAppliances**](AppliancesApi.md#listappliances) | **GET** /collections/{id}/appliances | List detected appliances in a collection |
|
|
12
|
+
| [**updateApplianceRule**](AppliancesApi.md#updateappliancerule) | **PUT** /appliances/rules/{ruleId} | Replace an appliance rule |
|
|
8
13
|
|
|
9
14
|
|
|
10
15
|
|
|
16
|
+
## createApplianceRule
|
|
17
|
+
|
|
18
|
+
> ApplianceRule createApplianceRule(applianceRuleRequest)
|
|
19
|
+
|
|
20
|
+
Create an appliance rule
|
|
21
|
+
|
|
22
|
+
### Example
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import {
|
|
26
|
+
Configuration,
|
|
27
|
+
AppliancesApi,
|
|
28
|
+
} from '@openshift-migration-advisor/agent-sdk';
|
|
29
|
+
import type { CreateApplianceRuleRequest } from '@openshift-migration-advisor/agent-sdk';
|
|
30
|
+
|
|
31
|
+
async function example() {
|
|
32
|
+
console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
|
|
33
|
+
const api = new AppliancesApi();
|
|
34
|
+
|
|
35
|
+
const body = {
|
|
36
|
+
// ApplianceRuleRequest
|
|
37
|
+
applianceRuleRequest: ...,
|
|
38
|
+
} satisfies CreateApplianceRuleRequest;
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
const data = await api.createApplianceRule(body);
|
|
42
|
+
console.log(data);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error(error);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Run the test
|
|
49
|
+
example().catch(console.error);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Parameters
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
| Name | Type | Description | Notes |
|
|
56
|
+
|------------- | ------------- | ------------- | -------------|
|
|
57
|
+
| **applianceRuleRequest** | [ApplianceRuleRequest](ApplianceRuleRequest.md) | | |
|
|
58
|
+
|
|
59
|
+
### Return type
|
|
60
|
+
|
|
61
|
+
[**ApplianceRule**](ApplianceRule.md)
|
|
62
|
+
|
|
63
|
+
### Authorization
|
|
64
|
+
|
|
65
|
+
No authorization required
|
|
66
|
+
|
|
67
|
+
### HTTP request headers
|
|
68
|
+
|
|
69
|
+
- **Content-Type**: `application/json`
|
|
70
|
+
- **Accept**: `application/json`
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### HTTP response details
|
|
74
|
+
| Status code | Description | Response headers |
|
|
75
|
+
|-------------|-------------|------------------|
|
|
76
|
+
| **201** | Rule created | - |
|
|
77
|
+
| **400** | Invalid rule or rule already exists | - |
|
|
78
|
+
| **500** | Internal server error | - |
|
|
79
|
+
|
|
80
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## deleteApplianceRule
|
|
84
|
+
|
|
85
|
+
> deleteApplianceRule(ruleId)
|
|
86
|
+
|
|
87
|
+
Delete an appliance rule
|
|
88
|
+
|
|
89
|
+
### Example
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import {
|
|
93
|
+
Configuration,
|
|
94
|
+
AppliancesApi,
|
|
95
|
+
} from '@openshift-migration-advisor/agent-sdk';
|
|
96
|
+
import type { DeleteApplianceRuleRequest } from '@openshift-migration-advisor/agent-sdk';
|
|
97
|
+
|
|
98
|
+
async function example() {
|
|
99
|
+
console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
|
|
100
|
+
const api = new AppliancesApi();
|
|
101
|
+
|
|
102
|
+
const body = {
|
|
103
|
+
// string | Rule ID
|
|
104
|
+
ruleId: ruleId_example,
|
|
105
|
+
} satisfies DeleteApplianceRuleRequest;
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
const data = await api.deleteApplianceRule(body);
|
|
109
|
+
console.log(data);
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error(error);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Run the test
|
|
116
|
+
example().catch(console.error);
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Parameters
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
| Name | Type | Description | Notes |
|
|
123
|
+
|------------- | ------------- | ------------- | -------------|
|
|
124
|
+
| **ruleId** | `string` | Rule ID | [Defaults to `undefined`] |
|
|
125
|
+
|
|
126
|
+
### Return type
|
|
127
|
+
|
|
128
|
+
`void` (Empty response body)
|
|
129
|
+
|
|
130
|
+
### Authorization
|
|
131
|
+
|
|
132
|
+
No authorization required
|
|
133
|
+
|
|
134
|
+
### HTTP request headers
|
|
135
|
+
|
|
136
|
+
- **Content-Type**: Not defined
|
|
137
|
+
- **Accept**: Not defined
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### HTTP response details
|
|
141
|
+
| Status code | Description | Response headers |
|
|
142
|
+
|-------------|-------------|------------------|
|
|
143
|
+
| **204** | Rule deleted, or no rule had this id | - |
|
|
144
|
+
| **400** | Rule ID is not a number | - |
|
|
145
|
+
| **500** | Internal server error | - |
|
|
146
|
+
|
|
147
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
## getApplianceRule
|
|
151
|
+
|
|
152
|
+
> ApplianceRule getApplianceRule(ruleId)
|
|
153
|
+
|
|
154
|
+
Get an appliance rule
|
|
155
|
+
|
|
156
|
+
### Example
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
import {
|
|
160
|
+
Configuration,
|
|
161
|
+
AppliancesApi,
|
|
162
|
+
} from '@openshift-migration-advisor/agent-sdk';
|
|
163
|
+
import type { GetApplianceRuleRequest } from '@openshift-migration-advisor/agent-sdk';
|
|
164
|
+
|
|
165
|
+
async function example() {
|
|
166
|
+
console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
|
|
167
|
+
const api = new AppliancesApi();
|
|
168
|
+
|
|
169
|
+
const body = {
|
|
170
|
+
// string | Rule ID
|
|
171
|
+
ruleId: ruleId_example,
|
|
172
|
+
} satisfies GetApplianceRuleRequest;
|
|
173
|
+
|
|
174
|
+
try {
|
|
175
|
+
const data = await api.getApplianceRule(body);
|
|
176
|
+
console.log(data);
|
|
177
|
+
} catch (error) {
|
|
178
|
+
console.error(error);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Run the test
|
|
183
|
+
example().catch(console.error);
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Parameters
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
| Name | Type | Description | Notes |
|
|
190
|
+
|------------- | ------------- | ------------- | -------------|
|
|
191
|
+
| **ruleId** | `string` | Rule ID | [Defaults to `undefined`] |
|
|
192
|
+
|
|
193
|
+
### Return type
|
|
194
|
+
|
|
195
|
+
[**ApplianceRule**](ApplianceRule.md)
|
|
196
|
+
|
|
197
|
+
### Authorization
|
|
198
|
+
|
|
199
|
+
No authorization required
|
|
200
|
+
|
|
201
|
+
### HTTP request headers
|
|
202
|
+
|
|
203
|
+
- **Content-Type**: Not defined
|
|
204
|
+
- **Accept**: `application/json`
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
### HTTP response details
|
|
208
|
+
| Status code | Description | Response headers |
|
|
209
|
+
|-------------|-------------|------------------|
|
|
210
|
+
| **200** | Rule | - |
|
|
211
|
+
| **400** | Rule ID is not a number | - |
|
|
212
|
+
| **404** | Rule not found | - |
|
|
213
|
+
| **500** | Internal server error | - |
|
|
214
|
+
|
|
215
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
## listApplianceRules
|
|
219
|
+
|
|
220
|
+
> ApplianceRuleListResponse listApplianceRules()
|
|
221
|
+
|
|
222
|
+
List appliance rules
|
|
223
|
+
|
|
224
|
+
### Example
|
|
225
|
+
|
|
226
|
+
```ts
|
|
227
|
+
import {
|
|
228
|
+
Configuration,
|
|
229
|
+
AppliancesApi,
|
|
230
|
+
} from '@openshift-migration-advisor/agent-sdk';
|
|
231
|
+
import type { ListApplianceRulesRequest } from '@openshift-migration-advisor/agent-sdk';
|
|
232
|
+
|
|
233
|
+
async function example() {
|
|
234
|
+
console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
|
|
235
|
+
const api = new AppliancesApi();
|
|
236
|
+
|
|
237
|
+
try {
|
|
238
|
+
const data = await api.listApplianceRules();
|
|
239
|
+
console.log(data);
|
|
240
|
+
} catch (error) {
|
|
241
|
+
console.error(error);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Run the test
|
|
246
|
+
example().catch(console.error);
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Parameters
|
|
250
|
+
|
|
251
|
+
This endpoint does not need any parameter.
|
|
252
|
+
|
|
253
|
+
### Return type
|
|
254
|
+
|
|
255
|
+
[**ApplianceRuleListResponse**](ApplianceRuleListResponse.md)
|
|
256
|
+
|
|
257
|
+
### Authorization
|
|
258
|
+
|
|
259
|
+
No authorization required
|
|
260
|
+
|
|
261
|
+
### HTTP request headers
|
|
262
|
+
|
|
263
|
+
- **Content-Type**: Not defined
|
|
264
|
+
- **Accept**: `application/json`
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
### HTTP response details
|
|
268
|
+
| Status code | Description | Response headers |
|
|
269
|
+
|-------------|-------------|------------------|
|
|
270
|
+
| **200** | Return appliance rules | - |
|
|
271
|
+
| **500** | Internal server error | - |
|
|
272
|
+
|
|
273
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
274
|
+
|
|
275
|
+
|
|
11
276
|
## listAppliances
|
|
12
277
|
|
|
13
278
|
> ApplianceListResponse listAppliances(id)
|
|
@@ -74,3 +339,76 @@ No authorization required
|
|
|
74
339
|
|
|
75
340
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
76
341
|
|
|
342
|
+
|
|
343
|
+
## updateApplianceRule
|
|
344
|
+
|
|
345
|
+
> ApplianceRule updateApplianceRule(ruleId, applianceRuleRequest)
|
|
346
|
+
|
|
347
|
+
Replace an appliance rule
|
|
348
|
+
|
|
349
|
+
Full replacement of the rule with this id, including its conditions. When no rule has this id a new rule is created and the response carries the server assigned id, which differs from the id in the path.
|
|
350
|
+
|
|
351
|
+
### Example
|
|
352
|
+
|
|
353
|
+
```ts
|
|
354
|
+
import {
|
|
355
|
+
Configuration,
|
|
356
|
+
AppliancesApi,
|
|
357
|
+
} from '@openshift-migration-advisor/agent-sdk';
|
|
358
|
+
import type { UpdateApplianceRuleRequest } from '@openshift-migration-advisor/agent-sdk';
|
|
359
|
+
|
|
360
|
+
async function example() {
|
|
361
|
+
console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
|
|
362
|
+
const api = new AppliancesApi();
|
|
363
|
+
|
|
364
|
+
const body = {
|
|
365
|
+
// string | Rule ID
|
|
366
|
+
ruleId: ruleId_example,
|
|
367
|
+
// ApplianceRuleRequest
|
|
368
|
+
applianceRuleRequest: ...,
|
|
369
|
+
} satisfies UpdateApplianceRuleRequest;
|
|
370
|
+
|
|
371
|
+
try {
|
|
372
|
+
const data = await api.updateApplianceRule(body);
|
|
373
|
+
console.log(data);
|
|
374
|
+
} catch (error) {
|
|
375
|
+
console.error(error);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// Run the test
|
|
380
|
+
example().catch(console.error);
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Parameters
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
| Name | Type | Description | Notes |
|
|
387
|
+
|------------- | ------------- | ------------- | -------------|
|
|
388
|
+
| **ruleId** | `string` | Rule ID | [Defaults to `undefined`] |
|
|
389
|
+
| **applianceRuleRequest** | [ApplianceRuleRequest](ApplianceRuleRequest.md) | | |
|
|
390
|
+
|
|
391
|
+
### Return type
|
|
392
|
+
|
|
393
|
+
[**ApplianceRule**](ApplianceRule.md)
|
|
394
|
+
|
|
395
|
+
### Authorization
|
|
396
|
+
|
|
397
|
+
No authorization required
|
|
398
|
+
|
|
399
|
+
### HTTP request headers
|
|
400
|
+
|
|
401
|
+
- **Content-Type**: `application/json`
|
|
402
|
+
- **Accept**: `application/json`
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
### HTTP response details
|
|
406
|
+
| Status code | Description | Response headers |
|
|
407
|
+
|-------------|-------------|------------------|
|
|
408
|
+
| **200** | Rule updated | - |
|
|
409
|
+
| **201** | No rule had this id, so a new rule was created | - |
|
|
410
|
+
| **400** | Invalid rule, invalid rule ID or rule already exists | - |
|
|
411
|
+
| **500** | Internal server error | - |
|
|
412
|
+
|
|
413
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
414
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# DiskGeometryCondition
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`disks` | Array<number>
|
|
10
|
+
`mode` | string
|
|
11
|
+
`tolerance_mib` | number
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { DiskGeometryCondition } from '@openshift-migration-advisor/agent-sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"disks": null,
|
|
21
|
+
"mode": null,
|
|
22
|
+
"tolerance_mib": null,
|
|
23
|
+
} satisfies DiskGeometryCondition
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as DiskGeometryCondition
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
package/docs/GroupsApi.md
CHANGED
|
@@ -175,7 +175,7 @@ async function example() {
|
|
|
175
175
|
id: id_example,
|
|
176
176
|
// string | Group ID
|
|
177
177
|
groupId: groupId_example,
|
|
178
|
-
// Array<string> | Sort fields with direction (e.g., \"name:asc\", \"cluster:desc\"). Valid fields are name, vCenterState, cluster, diskSize, memory, issues, cpuUsage, diskUsage, ramUsage, cpuAvg, memAvg. (optional)
|
|
178
|
+
// Array<string> | Sort fields with direction (e.g., \"name:asc\", \"cluster:desc\"). Valid fields are name, vCenterState, cluster, diskSize, memory, issues, cpuUsage, diskUsage, ramUsage, cpuAvg, memAvg, guestOs. (optional)
|
|
179
179
|
sort: ["cluster:asc","name:desc"],
|
|
180
180
|
// number | Page number for pagination (optional)
|
|
181
181
|
page: 56,
|
|
@@ -202,7 +202,7 @@ example().catch(console.error);
|
|
|
202
202
|
|------------- | ------------- | ------------- | -------------|
|
|
203
203
|
| **id** | `string` | Collection ID | [Defaults to `undefined`] |
|
|
204
204
|
| **groupId** | `string` | Group ID | [Defaults to `undefined`] |
|
|
205
|
-
| **sort** | `Array<string>` | Sort fields with direction (e.g., \"name:asc\", \"cluster:desc\"). Valid fields are name, vCenterState, cluster, diskSize, memory, issues, cpuUsage, diskUsage, ramUsage, cpuAvg, memAvg. | [Optional] |
|
|
205
|
+
| **sort** | `Array<string>` | Sort fields with direction (e.g., \"name:asc\", \"cluster:desc\"). Valid fields are name, vCenterState, cluster, diskSize, memory, issues, cpuUsage, diskUsage, ramUsage, cpuAvg, memAvg, guestOs. | [Optional] |
|
|
206
206
|
| **page** | `number` | Page number for pagination | [Optional] [Defaults to `1`] |
|
|
207
207
|
| **pageSize** | `number` | Number of items per page | [Optional] [Defaults to `undefined`] |
|
|
208
208
|
|
|
@@ -252,7 +252,7 @@ async function example() {
|
|
|
252
252
|
const body = {
|
|
253
253
|
// string | Group ID
|
|
254
254
|
groupId: groupId_example,
|
|
255
|
-
// Array<string> | Sort fields with direction (e.g., \"name:asc\", \"cluster:desc\"). Valid fields are name, vCenterState, cluster, diskSize, memory, issues, cpuUsage, diskUsage, ramUsage, cpuAvg, memAvg. (optional)
|
|
255
|
+
// Array<string> | Sort fields with direction (e.g., \"name:asc\", \"cluster:desc\"). Valid fields are name, vCenterState, cluster, diskSize, memory, issues, cpuUsage, diskUsage, ramUsage, cpuAvg, memAvg, guestOs. (optional)
|
|
256
256
|
sort: ["cluster:asc","name:desc"],
|
|
257
257
|
// number | Page number for pagination (optional)
|
|
258
258
|
page: 56,
|
|
@@ -278,7 +278,7 @@ example().catch(console.error);
|
|
|
278
278
|
| Name | Type | Description | Notes |
|
|
279
279
|
|------------- | ------------- | ------------- | -------------|
|
|
280
280
|
| **groupId** | `string` | Group ID | [Defaults to `undefined`] |
|
|
281
|
-
| **sort** | `Array<string>` | Sort fields with direction (e.g., \"name:asc\", \"cluster:desc\"). Valid fields are name, vCenterState, cluster, diskSize, memory, issues, cpuUsage, diskUsage, ramUsage, cpuAvg, memAvg. | [Optional] |
|
|
281
|
+
| **sort** | `Array<string>` | Sort fields with direction (e.g., \"name:asc\", \"cluster:desc\"). Valid fields are name, vCenterState, cluster, diskSize, memory, issues, cpuUsage, diskUsage, ramUsage, cpuAvg, memAvg, guestOs. | [Optional] |
|
|
282
282
|
| **page** | `number` | Page number for pagination | [Optional] [Defaults to `1`] |
|
|
283
283
|
| **pageSize** | `number` | Number of items per page | [Optional] [Defaults to `undefined`] |
|
|
284
284
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# ImageUpgradeApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://raw.githubusercontent.com/api/v2*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**postImageUpgrade**](ImageUpgradeApi.md#postimageupgrade) | **POST** /image-upgrades | Upload an OCI image for a disconnected appliance image upgrade |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## postImageUpgrade
|
|
12
|
+
|
|
13
|
+
> postImageUpgrade(file)
|
|
14
|
+
|
|
15
|
+
Upload an OCI image for a disconnected appliance image upgrade
|
|
16
|
+
|
|
17
|
+
Validate the complete upload and atomically place the archive in the watched directory. The host owns upgrade execution. Read imageUpgradeStatus in GET /agent for upload activity and the last host result.
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
Configuration,
|
|
24
|
+
ImageUpgradeApi,
|
|
25
|
+
} from '@openshift-migration-advisor/agent-sdk';
|
|
26
|
+
import type { PostImageUpgradeRequest } from '@openshift-migration-advisor/agent-sdk';
|
|
27
|
+
|
|
28
|
+
async function example() {
|
|
29
|
+
console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
|
|
30
|
+
const api = new ImageUpgradeApi();
|
|
31
|
+
|
|
32
|
+
const body = {
|
|
33
|
+
// Blob | OCI archive; maximum file payload is 3 GiB
|
|
34
|
+
file: BINARY_DATA_HERE,
|
|
35
|
+
} satisfies PostImageUpgradeRequest;
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
const data = await api.postImageUpgrade(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
|
+
| **file** | `Blob` | OCI archive; maximum file payload is 3 GiB | [Defaults to `undefined`] |
|
|
55
|
+
|
|
56
|
+
### Return type
|
|
57
|
+
|
|
58
|
+
`void` (Empty response body)
|
|
59
|
+
|
|
60
|
+
### Authorization
|
|
61
|
+
|
|
62
|
+
No authorization required
|
|
63
|
+
|
|
64
|
+
### HTTP request headers
|
|
65
|
+
|
|
66
|
+
- **Content-Type**: `multipart/form-data`
|
|
67
|
+
- **Accept**: Not defined
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### HTTP response details
|
|
71
|
+
| Status code | Description | Response headers |
|
|
72
|
+
|-------------|-------------|------------------|
|
|
73
|
+
| **202** | Validated image handed to the host; installation is asynchronous and may restart the agent | - |
|
|
74
|
+
| **400** | Invalid multipart input, OCI image, platform, or upgrade version | - |
|
|
75
|
+
| **409** | Connected mode, another image upload in progress, or a published archive still pending host resolution | - |
|
|
76
|
+
| **413** | File exceeds 3 GiB or multipart framing exceeds 1 MiB | - |
|
|
77
|
+
| **507** | Insufficient storage; preparation requires three times the archive size | - |
|
|
78
|
+
| **500** | Internal error | - |
|
|
79
|
+
| **503** | Image upgrade service unavailable, or upload interrupted by cancellation or timeout | - |
|
|
80
|
+
|
|
81
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
82
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# ImageUpgradeImage
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`version` | string
|
|
10
|
+
`digest` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ImageUpgradeImage } from '@openshift-migration-advisor/agent-sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"version": null,
|
|
20
|
+
"digest": null,
|
|
21
|
+
} satisfies ImageUpgradeImage
|
|
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 ImageUpgradeImage
|
|
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
|
+
|