@openshift-migration-advisor/agent-sdk 0.24.0 → 0.27.0-c0cec331350f
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/VERSION +1 -1
- package/README.md +5 -3
- package/dist/apis/CollectionsApi.d.ts +34 -4
- package/dist/apis/CollectionsApi.js +34 -0
- package/dist/apis/GroupsApi.d.ts +39 -0
- package/dist/apis/GroupsApi.js +40 -0
- package/dist/esm/apis/CollectionsApi.d.ts +34 -4
- package/dist/esm/apis/CollectionsApi.js +34 -0
- package/dist/esm/apis/GroupsApi.d.ts +39 -0
- package/dist/esm/apis/GroupsApi.js +40 -0
- package/dist/esm/models/Datastore.d.ts +17 -0
- package/dist/esm/models/Datastore.js +12 -0
- package/dist/esm/models/Infra.d.ts +4 -0
- package/dist/esm/models/Infra.js +2 -0
- package/dist/esm/runtime.d.ts +22 -1
- package/dist/esm/runtime.js +61 -1
- package/dist/models/Datastore.d.ts +17 -0
- package/dist/models/Datastore.js +13 -0
- package/dist/models/Infra.d.ts +4 -0
- package/dist/models/Infra.js +2 -0
- package/dist/runtime.d.ts +22 -1
- package/dist/runtime.js +62 -1
- package/docs/CollectionsApi.md +59 -0
- package/docs/Datastore.md +4 -0
- package/docs/GroupsApi.md +68 -0
- package/docs/Infra.md +2 -0
- package/package.json +1 -1
- package/src/apis/CollectionsApi.ts +61 -4
- package/src/apis/GroupsApi.ts +80 -0
- package/src/models/Datastore.ts +24 -0
- package/src/models/Infra.ts +6 -0
- package/src/runtime.ts +69 -2
package/dist/esm/runtime.js
CHANGED
|
@@ -380,13 +380,73 @@ export class BlobApiResponse {
|
|
|
380
380
|
constructor(raw) {
|
|
381
381
|
this.raw = raw;
|
|
382
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* The body named after the Content-Disposition header, so that a download keeps the name the
|
|
385
|
+
* server gave it. A File is built from a native Blob; the Blob itself is named where there is no
|
|
386
|
+
* global File (Node.js before 20), where File cannot be constructed, or where the Blob is not the
|
|
387
|
+
* native one, as returned by an injected fetch implementation such as node-fetch, which a File
|
|
388
|
+
* would stringify instead of wrapping.
|
|
389
|
+
*/
|
|
383
390
|
value() {
|
|
384
391
|
return __awaiter(this, void 0, void 0, function* () {
|
|
385
|
-
|
|
392
|
+
var _a;
|
|
393
|
+
const blob = yield this.raw.blob();
|
|
394
|
+
const name = (_a = parseContentDispositionFilename(this.raw.headers)) !== null && _a !== void 0 ? _a : '';
|
|
395
|
+
if (typeof File !== 'undefined' && blob instanceof Blob) {
|
|
396
|
+
try {
|
|
397
|
+
return new File([blob], name, { type: blob.type });
|
|
398
|
+
}
|
|
399
|
+
catch (_b) {
|
|
400
|
+
// File cannot be constructed: name the Blob itself
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return Object.assign(blob, { name });
|
|
386
404
|
});
|
|
387
405
|
}
|
|
388
406
|
;
|
|
389
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
|
|
410
|
+
* `filename*` parameter first, falling back to the plain `filename` when it is malformed, not UTF-8
|
|
411
|
+
* or has no usable name. Any directory part is dropped; undefined when no usable name is advertised.
|
|
412
|
+
*/
|
|
413
|
+
export function parseContentDispositionFilename(headers) {
|
|
414
|
+
var _a, _b;
|
|
415
|
+
const params = parseHeaderParameters((_a = headers.get('Content-Disposition')) !== null && _a !== void 0 ? _a : '');
|
|
416
|
+
return (_b = basename(decodeExtValue(params.get('filename*')))) !== null && _b !== void 0 ? _b : basename(params.get('filename'));
|
|
417
|
+
}
|
|
418
|
+
/** The decoded RFC 5987 ext-value, or undefined when it is not UTF-8 or its percent-encoding is malformed. */
|
|
419
|
+
function decodeExtValue(value) {
|
|
420
|
+
const match = value === undefined ? null : /^utf-8'[^']*'(.*)$/i.exec(value);
|
|
421
|
+
try {
|
|
422
|
+
return match ? decodeURIComponent(match[1]) : undefined;
|
|
423
|
+
}
|
|
424
|
+
catch (_a) {
|
|
425
|
+
return undefined;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* The `name=value` parameters of a header value, consumed one at a time so that a quoted-string is
|
|
430
|
+
* taken whole, `;` included. Names are lower-cased, quoted-string values are unquoted with their
|
|
431
|
+
* backslash escapes resolved, and the first occurrence of a name wins.
|
|
432
|
+
*/
|
|
433
|
+
function parseHeaderParameters(value) {
|
|
434
|
+
const params = new Map();
|
|
435
|
+
const parameter = /(?:^|;)\s*([^=;]+?)\s*=\s*(?:"((?:[^"\\]|\\.)*)"?|([^;]*))/g;
|
|
436
|
+
let match;
|
|
437
|
+
while ((match = parameter.exec(value)) !== null) {
|
|
438
|
+
const name = match[1].toLowerCase();
|
|
439
|
+
if (!params.has(name)) {
|
|
440
|
+
params.set(name, match[2] !== undefined ? match[2].replace(/\\(.)/g, '$1') : match[3].trim());
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return params;
|
|
444
|
+
}
|
|
445
|
+
/** The last `/` or `\` separated segment of a file name, or undefined when it is not a file name. */
|
|
446
|
+
function basename(name) {
|
|
447
|
+
const base = name === null || name === void 0 ? void 0 : name.split(/[\\/]/).pop();
|
|
448
|
+
return !base || base === '.' || base === '..' ? undefined : base;
|
|
449
|
+
}
|
|
390
450
|
export class TextApiResponse {
|
|
391
451
|
constructor(raw) {
|
|
392
452
|
this.raw = raw;
|
|
@@ -20,6 +20,14 @@ export interface Datastore {
|
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
22
|
type: string;
|
|
23
|
+
/**
|
|
24
|
+
* Storage access category derived from Datastore.Type
|
|
25
|
+
*/
|
|
26
|
+
storageProtocol?: DatastoreStorageProtocolEnum;
|
|
27
|
+
/**
|
|
28
|
+
* Whether this datastore supports vSAN point-in-time snapshots
|
|
29
|
+
*/
|
|
30
|
+
vsanSnapshotSupport?: boolean;
|
|
23
31
|
/**
|
|
24
32
|
*
|
|
25
33
|
*/
|
|
@@ -57,6 +65,15 @@ export interface Datastore {
|
|
|
57
65
|
*/
|
|
58
66
|
storageIoConfiguration?: StorageIoConfiguration;
|
|
59
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @export
|
|
70
|
+
*/
|
|
71
|
+
export declare const DatastoreStorageProtocolEnum: {
|
|
72
|
+
readonly Block: "Block";
|
|
73
|
+
readonly File: "File";
|
|
74
|
+
readonly Object: "Object";
|
|
75
|
+
};
|
|
76
|
+
export type DatastoreStorageProtocolEnum = typeof DatastoreStorageProtocolEnum[keyof typeof DatastoreStorageProtocolEnum];
|
|
60
77
|
/**
|
|
61
78
|
* Check if a given object implements the Datastore interface.
|
|
62
79
|
*/
|
package/dist/models/Datastore.js
CHANGED
|
@@ -13,12 +13,21 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.DatastoreStorageProtocolEnum = void 0;
|
|
16
17
|
exports.instanceOfDatastore = instanceOfDatastore;
|
|
17
18
|
exports.DatastoreFromJSON = DatastoreFromJSON;
|
|
18
19
|
exports.DatastoreFromJSONTyped = DatastoreFromJSONTyped;
|
|
19
20
|
exports.DatastoreToJSON = DatastoreToJSON;
|
|
20
21
|
exports.DatastoreToJSONTyped = DatastoreToJSONTyped;
|
|
21
22
|
const StorageIoConfiguration_js_1 = require("./StorageIoConfiguration.js");
|
|
23
|
+
/**
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
exports.DatastoreStorageProtocolEnum = {
|
|
27
|
+
Block: 'Block',
|
|
28
|
+
File: 'File',
|
|
29
|
+
Object: 'Object',
|
|
30
|
+
};
|
|
22
31
|
/**
|
|
23
32
|
* Check if a given object implements the Datastore interface.
|
|
24
33
|
*/
|
|
@@ -50,6 +59,8 @@ function DatastoreFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
50
59
|
}
|
|
51
60
|
return {
|
|
52
61
|
'type': json['type'],
|
|
62
|
+
'storageProtocol': json['storageProtocol'] == null ? undefined : json['storageProtocol'],
|
|
63
|
+
'vsanSnapshotSupport': json['vsanSnapshotSupport'] == null ? undefined : json['vsanSnapshotSupport'],
|
|
53
64
|
'totalCapacityGB': json['totalCapacityGB'],
|
|
54
65
|
'freeCapacityGB': json['freeCapacityGB'],
|
|
55
66
|
'vendor': json['vendor'],
|
|
@@ -70,6 +81,8 @@ function DatastoreToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
70
81
|
}
|
|
71
82
|
return {
|
|
72
83
|
'type': value['type'],
|
|
84
|
+
'storageProtocol': value['storageProtocol'],
|
|
85
|
+
'vsanSnapshotSupport': value['vsanSnapshotSupport'],
|
|
73
86
|
'totalCapacityGB': value['totalCapacityGB'],
|
|
74
87
|
'freeCapacityGB': value['freeCapacityGB'],
|
|
75
88
|
'vendor': value['vendor'],
|
package/dist/models/Infra.d.ts
CHANGED
package/dist/models/Infra.js
CHANGED
|
@@ -44,6 +44,7 @@ function InfraFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
44
44
|
}
|
|
45
45
|
return {
|
|
46
46
|
'totalHosts': json['totalHosts'],
|
|
47
|
+
'standaloneHostsDetected': json['standaloneHostsDetected'] == null ? undefined : json['standaloneHostsDetected'],
|
|
47
48
|
'totalDatacenters': json['totalDatacenters'] == null ? undefined : json['totalDatacenters'],
|
|
48
49
|
'totalClusters': json['totalClusters'] == null ? undefined : json['totalClusters'],
|
|
49
50
|
'clustersPerDatacenter': json['clustersPerDatacenter'] == null ? undefined : json['clustersPerDatacenter'],
|
|
@@ -67,6 +68,7 @@ function InfraToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
67
68
|
}
|
|
68
69
|
return {
|
|
69
70
|
'totalHosts': value['totalHosts'],
|
|
71
|
+
'standaloneHostsDetected': value['standaloneHostsDetected'],
|
|
70
72
|
'totalDatacenters': value['totalDatacenters'],
|
|
71
73
|
'totalClusters': value['totalClusters'],
|
|
72
74
|
'clustersPerDatacenter': value['clustersPerDatacenter'],
|
package/dist/runtime.d.ts
CHANGED
|
@@ -184,11 +184,32 @@ export declare class VoidApiResponse {
|
|
|
184
184
|
constructor(raw: Response);
|
|
185
185
|
value(): Promise<void>;
|
|
186
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* A Blob carrying the file name the server advertised, empty when it did not send one. It is a File
|
|
189
|
+
* wherever one can be built, and the bare Blob given a name otherwise. Same name and shape as the
|
|
190
|
+
* `typescript` generator's browser HttpFile.
|
|
191
|
+
*/
|
|
192
|
+
export type HttpFile = Blob & {
|
|
193
|
+
readonly name: string;
|
|
194
|
+
};
|
|
187
195
|
export declare class BlobApiResponse {
|
|
188
196
|
raw: Response;
|
|
189
197
|
constructor(raw: Response);
|
|
190
|
-
|
|
198
|
+
/**
|
|
199
|
+
* The body named after the Content-Disposition header, so that a download keeps the name the
|
|
200
|
+
* server gave it. A File is built from a native Blob; the Blob itself is named where there is no
|
|
201
|
+
* global File (Node.js before 20), where File cannot be constructed, or where the Blob is not the
|
|
202
|
+
* native one, as returned by an injected fetch implementation such as node-fetch, which a File
|
|
203
|
+
* would stringify instead of wrapping.
|
|
204
|
+
*/
|
|
205
|
+
value(): Promise<HttpFile>;
|
|
191
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
|
|
209
|
+
* `filename*` parameter first, falling back to the plain `filename` when it is malformed, not UTF-8
|
|
210
|
+
* or has no usable name. Any directory part is dropped; undefined when no usable name is advertised.
|
|
211
|
+
*/
|
|
212
|
+
export declare function parseContentDispositionFilename(headers: Headers): string | undefined;
|
|
192
213
|
export declare class TextApiResponse {
|
|
193
214
|
raw: Response;
|
|
194
215
|
constructor(raw: Response);
|
package/dist/runtime.js
CHANGED
|
@@ -32,6 +32,7 @@ exports.parseDateTime = parseDateTime;
|
|
|
32
32
|
exports.mapValues = mapValues;
|
|
33
33
|
exports.anyToJSON = anyToJSON;
|
|
34
34
|
exports.canConsumeForm = canConsumeForm;
|
|
35
|
+
exports.parseContentDispositionFilename = parseContentDispositionFilename;
|
|
35
36
|
exports.BASE_PATH = "https://raw.githubusercontent.com/api/v2".replace(/\/+$/, "");
|
|
36
37
|
class Configuration {
|
|
37
38
|
constructor(configuration = {}) {
|
|
@@ -399,14 +400,74 @@ class BlobApiResponse {
|
|
|
399
400
|
constructor(raw) {
|
|
400
401
|
this.raw = raw;
|
|
401
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* The body named after the Content-Disposition header, so that a download keeps the name the
|
|
405
|
+
* server gave it. A File is built from a native Blob; the Blob itself is named where there is no
|
|
406
|
+
* global File (Node.js before 20), where File cannot be constructed, or where the Blob is not the
|
|
407
|
+
* native one, as returned by an injected fetch implementation such as node-fetch, which a File
|
|
408
|
+
* would stringify instead of wrapping.
|
|
409
|
+
*/
|
|
402
410
|
value() {
|
|
403
411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
404
|
-
|
|
412
|
+
var _a;
|
|
413
|
+
const blob = yield this.raw.blob();
|
|
414
|
+
const name = (_a = parseContentDispositionFilename(this.raw.headers)) !== null && _a !== void 0 ? _a : '';
|
|
415
|
+
if (typeof File !== 'undefined' && blob instanceof Blob) {
|
|
416
|
+
try {
|
|
417
|
+
return new File([blob], name, { type: blob.type });
|
|
418
|
+
}
|
|
419
|
+
catch (_b) {
|
|
420
|
+
// File cannot be constructed: name the Blob itself
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
return Object.assign(blob, { name });
|
|
405
424
|
});
|
|
406
425
|
}
|
|
407
426
|
;
|
|
408
427
|
}
|
|
409
428
|
exports.BlobApiResponse = BlobApiResponse;
|
|
429
|
+
/**
|
|
430
|
+
* The file name advertised by a Content-Disposition header (RFC 6266): the RFC 5987 encoded
|
|
431
|
+
* `filename*` parameter first, falling back to the plain `filename` when it is malformed, not UTF-8
|
|
432
|
+
* or has no usable name. Any directory part is dropped; undefined when no usable name is advertised.
|
|
433
|
+
*/
|
|
434
|
+
function parseContentDispositionFilename(headers) {
|
|
435
|
+
var _a, _b;
|
|
436
|
+
const params = parseHeaderParameters((_a = headers.get('Content-Disposition')) !== null && _a !== void 0 ? _a : '');
|
|
437
|
+
return (_b = basename(decodeExtValue(params.get('filename*')))) !== null && _b !== void 0 ? _b : basename(params.get('filename'));
|
|
438
|
+
}
|
|
439
|
+
/** The decoded RFC 5987 ext-value, or undefined when it is not UTF-8 or its percent-encoding is malformed. */
|
|
440
|
+
function decodeExtValue(value) {
|
|
441
|
+
const match = value === undefined ? null : /^utf-8'[^']*'(.*)$/i.exec(value);
|
|
442
|
+
try {
|
|
443
|
+
return match ? decodeURIComponent(match[1]) : undefined;
|
|
444
|
+
}
|
|
445
|
+
catch (_a) {
|
|
446
|
+
return undefined;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* The `name=value` parameters of a header value, consumed one at a time so that a quoted-string is
|
|
451
|
+
* taken whole, `;` included. Names are lower-cased, quoted-string values are unquoted with their
|
|
452
|
+
* backslash escapes resolved, and the first occurrence of a name wins.
|
|
453
|
+
*/
|
|
454
|
+
function parseHeaderParameters(value) {
|
|
455
|
+
const params = new Map();
|
|
456
|
+
const parameter = /(?:^|;)\s*([^=;]+?)\s*=\s*(?:"((?:[^"\\]|\\.)*)"?|([^;]*))/g;
|
|
457
|
+
let match;
|
|
458
|
+
while ((match = parameter.exec(value)) !== null) {
|
|
459
|
+
const name = match[1].toLowerCase();
|
|
460
|
+
if (!params.has(name)) {
|
|
461
|
+
params.set(name, match[2] !== undefined ? match[2].replace(/\\(.)/g, '$1') : match[3].trim());
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return params;
|
|
465
|
+
}
|
|
466
|
+
/** The last `/` or `\` separated segment of a file name, or undefined when it is not a file name. */
|
|
467
|
+
function basename(name) {
|
|
468
|
+
const base = name === null || name === void 0 ? void 0 : name.split(/[\\/]/).pop();
|
|
469
|
+
return !base || base === '.' || base === '..' ? undefined : base;
|
|
470
|
+
}
|
|
410
471
|
class TextApiResponse {
|
|
411
472
|
constructor(raw) {
|
|
412
473
|
this.raw = raw;
|
package/docs/CollectionsApi.md
CHANGED
|
@@ -6,6 +6,7 @@ All URIs are relative to *https://raw.githubusercontent.com/api/v2*
|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
7
|
| [**compareCollections**](CollectionsApi.md#comparecollections) | **GET** /collections/compare/{aId}/{bId} | Compare two collections — returns aggregates and diffs |
|
|
8
8
|
| [**compareCollectionsDiff**](CollectionsApi.md#comparecollectionsdiff) | **GET** /collections/compare/{aId}/{bId}/{dimension} | Drill down — VM IDs that differ between two collections for a given dimension |
|
|
9
|
+
| [**deleteCollections**](CollectionsApi.md#deletecollections) | **DELETE** /collections | Delete all collections |
|
|
9
10
|
| [**exportCollection**](CollectionsApi.md#exportcollection) | **GET** /collections/{id}/export | Export collection data as CSV ZIP archive or Excel workbook |
|
|
10
11
|
| [**listCollections**](CollectionsApi.md#listcollections) | **GET** /collections | List all collections |
|
|
11
12
|
|
|
@@ -161,6 +162,64 @@ No authorization required
|
|
|
161
162
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
162
163
|
|
|
163
164
|
|
|
165
|
+
## deleteCollections
|
|
166
|
+
|
|
167
|
+
> deleteCollections()
|
|
168
|
+
|
|
169
|
+
Delete all collections
|
|
170
|
+
|
|
171
|
+
### Example
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
import {
|
|
175
|
+
Configuration,
|
|
176
|
+
CollectionsApi,
|
|
177
|
+
} from '@openshift-migration-advisor/agent-sdk';
|
|
178
|
+
import type { DeleteCollectionsRequest } from '@openshift-migration-advisor/agent-sdk';
|
|
179
|
+
|
|
180
|
+
async function example() {
|
|
181
|
+
console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
|
|
182
|
+
const api = new CollectionsApi();
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
const data = await api.deleteCollections();
|
|
186
|
+
console.log(data);
|
|
187
|
+
} catch (error) {
|
|
188
|
+
console.error(error);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Run the test
|
|
193
|
+
example().catch(console.error);
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Parameters
|
|
197
|
+
|
|
198
|
+
This endpoint does not need any parameter.
|
|
199
|
+
|
|
200
|
+
### Return type
|
|
201
|
+
|
|
202
|
+
`void` (Empty response body)
|
|
203
|
+
|
|
204
|
+
### Authorization
|
|
205
|
+
|
|
206
|
+
No authorization required
|
|
207
|
+
|
|
208
|
+
### HTTP request headers
|
|
209
|
+
|
|
210
|
+
- **Content-Type**: Not defined
|
|
211
|
+
- **Accept**: Not defined
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
### HTTP response details
|
|
215
|
+
| Status code | Description | Response headers |
|
|
216
|
+
|-------------|-------------|------------------|
|
|
217
|
+
| **204** | Delete all collections | - |
|
|
218
|
+
| **500** | Internal server error | - |
|
|
219
|
+
|
|
220
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
221
|
+
|
|
222
|
+
|
|
164
223
|
## exportCollection
|
|
165
224
|
|
|
166
225
|
> Blob exportCollection(id, scope, format)
|
package/docs/Datastore.md
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
Name | Type
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`type` | string
|
|
10
|
+
`storageProtocol` | string
|
|
11
|
+
`vsanSnapshotSupport` | boolean
|
|
10
12
|
`totalCapacityGB` | number
|
|
11
13
|
`freeCapacityGB` | number
|
|
12
14
|
`vendor` | string
|
|
@@ -25,6 +27,8 @@ import type { Datastore } from '@openshift-migration-advisor/agent-sdk'
|
|
|
25
27
|
// TODO: Update the object below with actual values
|
|
26
28
|
const example = {
|
|
27
29
|
"type": null,
|
|
30
|
+
"storageProtocol": null,
|
|
31
|
+
"vsanSnapshotSupport": null,
|
|
28
32
|
"totalCapacityGB": null,
|
|
29
33
|
"freeCapacityGB": null,
|
|
30
34
|
"vendor": null,
|
package/docs/GroupsApi.md
CHANGED
|
@@ -8,6 +8,7 @@ All URIs are relative to *https://raw.githubusercontent.com/api/v2*
|
|
|
8
8
|
| [**deleteLatestGroup**](GroupsApi.md#deletelatestgroup) | **DELETE** /groups/{groupId} | Delete group from the latest collection |
|
|
9
9
|
| [**getGroup**](GroupsApi.md#getgroup) | **GET** /collections/{id}/groups/{groupId} | Get group by ID with its VirtualMachines |
|
|
10
10
|
| [**getLatestGroup**](GroupsApi.md#getlatestgroup) | **GET** /groups/{groupId} | Get group by ID from the latest collection |
|
|
11
|
+
| [**listGroupApplications**](GroupsApi.md#listgroupapplications) | **GET** /groups/{groupId}/applications | List detected applications for a group |
|
|
11
12
|
| [**listGroups**](GroupsApi.md#listgroups) | **GET** /collections/{id}/groups | List all groups in a collection |
|
|
12
13
|
| [**listLatestGroups**](GroupsApi.md#listlatestgroups) | **GET** /groups | List groups from the latest collection |
|
|
13
14
|
| [**updateLatestGroup**](GroupsApi.md#updatelatestgroup) | **PATCH** /groups/{groupId} | Update group in the latest collection |
|
|
@@ -304,6 +305,73 @@ No authorization required
|
|
|
304
305
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
305
306
|
|
|
306
307
|
|
|
308
|
+
## listGroupApplications
|
|
309
|
+
|
|
310
|
+
> ApplicationListResponse listGroupApplications(groupId)
|
|
311
|
+
|
|
312
|
+
List detected applications for a group
|
|
313
|
+
|
|
314
|
+
### Example
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
import {
|
|
318
|
+
Configuration,
|
|
319
|
+
GroupsApi,
|
|
320
|
+
} from '@openshift-migration-advisor/agent-sdk';
|
|
321
|
+
import type { ListGroupApplicationsRequest } from '@openshift-migration-advisor/agent-sdk';
|
|
322
|
+
|
|
323
|
+
async function example() {
|
|
324
|
+
console.log("🚀 Testing @openshift-migration-advisor/agent-sdk SDK...");
|
|
325
|
+
const api = new GroupsApi();
|
|
326
|
+
|
|
327
|
+
const body = {
|
|
328
|
+
// string | Group ID
|
|
329
|
+
groupId: groupId_example,
|
|
330
|
+
} satisfies ListGroupApplicationsRequest;
|
|
331
|
+
|
|
332
|
+
try {
|
|
333
|
+
const data = await api.listGroupApplications(body);
|
|
334
|
+
console.log(data);
|
|
335
|
+
} catch (error) {
|
|
336
|
+
console.error(error);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// Run the test
|
|
341
|
+
example().catch(console.error);
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Parameters
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
| Name | Type | Description | Notes |
|
|
348
|
+
|------------- | ------------- | ------------- | -------------|
|
|
349
|
+
| **groupId** | `string` | Group ID | [Defaults to `undefined`] |
|
|
350
|
+
|
|
351
|
+
### Return type
|
|
352
|
+
|
|
353
|
+
[**ApplicationListResponse**](ApplicationListResponse.md)
|
|
354
|
+
|
|
355
|
+
### Authorization
|
|
356
|
+
|
|
357
|
+
No authorization required
|
|
358
|
+
|
|
359
|
+
### HTTP request headers
|
|
360
|
+
|
|
361
|
+
- **Content-Type**: Not defined
|
|
362
|
+
- **Accept**: `application/json`
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
### HTTP response details
|
|
366
|
+
| Status code | Description | Response headers |
|
|
367
|
+
|-------------|-------------|------------------|
|
|
368
|
+
| **200** | List of detected applications | - |
|
|
369
|
+
| **404** | No collections or group not found | - |
|
|
370
|
+
| **500** | Internal server error | - |
|
|
371
|
+
|
|
372
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
373
|
+
|
|
374
|
+
|
|
307
375
|
## listGroups
|
|
308
376
|
|
|
309
377
|
> GroupListResponse listGroups(id, byName, page, pageSize)
|
package/docs/Infra.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
Name | Type
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`totalHosts` | number
|
|
10
|
+
`standaloneHostsDetected` | boolean
|
|
10
11
|
`totalDatacenters` | number
|
|
11
12
|
`totalClusters` | number
|
|
12
13
|
`clustersPerDatacenter` | Array<number>
|
|
@@ -28,6 +29,7 @@ import type { Infra } from '@openshift-migration-advisor/agent-sdk'
|
|
|
28
29
|
// TODO: Update the object below with actual values
|
|
29
30
|
const example = {
|
|
30
31
|
"totalHosts": null,
|
|
32
|
+
"standaloneHostsDetected": null,
|
|
31
33
|
"totalDatacenters": null,
|
|
32
34
|
"totalClusters": null,
|
|
33
35
|
"clustersPerDatacenter": null,
|
package/package.json
CHANGED
|
@@ -141,6 +141,27 @@ export interface CollectionsApiInterface {
|
|
|
141
141
|
*/
|
|
142
142
|
compareCollectionsDiff(requestParameters: CompareCollectionsDiffRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionComparisonDiff>;
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Creates request options for deleteCollections without sending the request
|
|
146
|
+
* @throws {RequiredError}
|
|
147
|
+
* @memberof CollectionsApiInterface
|
|
148
|
+
*/
|
|
149
|
+
deleteCollectionsRequestOpts(): Promise<runtime.RequestOpts>;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
* @summary Delete all collections
|
|
154
|
+
* @param {*} [options] Override http request option.
|
|
155
|
+
* @throws {RequiredError}
|
|
156
|
+
* @memberof CollectionsApiInterface
|
|
157
|
+
*/
|
|
158
|
+
deleteCollectionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Delete all collections
|
|
162
|
+
*/
|
|
163
|
+
deleteCollections(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
164
|
+
|
|
144
165
|
/**
|
|
145
166
|
* Creates request options for exportCollection without sending the request
|
|
146
167
|
* @param {string} id Collection ID
|
|
@@ -161,12 +182,12 @@ export interface CollectionsApiInterface {
|
|
|
161
182
|
* @throws {RequiredError}
|
|
162
183
|
* @memberof CollectionsApiInterface
|
|
163
184
|
*/
|
|
164
|
-
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
185
|
+
exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<runtime.HttpFile>>;
|
|
165
186
|
|
|
166
187
|
/**
|
|
167
188
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
168
189
|
*/
|
|
169
|
-
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
190
|
+
exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.HttpFile>;
|
|
170
191
|
|
|
171
192
|
/**
|
|
172
193
|
* Creates request options for listCollections without sending the request
|
|
@@ -318,6 +339,42 @@ export class CollectionsApi extends runtime.BaseAPI implements CollectionsApiInt
|
|
|
318
339
|
return await response.value();
|
|
319
340
|
}
|
|
320
341
|
|
|
342
|
+
/**
|
|
343
|
+
* Creates request options for deleteCollections without sending the request
|
|
344
|
+
*/
|
|
345
|
+
async deleteCollectionsRequestOpts(): Promise<runtime.RequestOpts> {
|
|
346
|
+
const queryParameters: any = {};
|
|
347
|
+
|
|
348
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
let urlPath = `/collections`;
|
|
352
|
+
|
|
353
|
+
return {
|
|
354
|
+
path: urlPath,
|
|
355
|
+
method: 'DELETE',
|
|
356
|
+
headers: headerParameters,
|
|
357
|
+
query: queryParameters,
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Delete all collections
|
|
363
|
+
*/
|
|
364
|
+
async deleteCollectionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
365
|
+
const requestOptions = await this.deleteCollectionsRequestOpts();
|
|
366
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
367
|
+
|
|
368
|
+
return new runtime.VoidApiResponse(response);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Delete all collections
|
|
373
|
+
*/
|
|
374
|
+
async deleteCollections(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
375
|
+
await this.deleteCollectionsRaw(initOverrides);
|
|
376
|
+
}
|
|
377
|
+
|
|
321
378
|
/**
|
|
322
379
|
* Creates request options for exportCollection without sending the request
|
|
323
380
|
*/
|
|
@@ -356,7 +413,7 @@ export class CollectionsApi extends runtime.BaseAPI implements CollectionsApiInt
|
|
|
356
413
|
/**
|
|
357
414
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
358
415
|
*/
|
|
359
|
-
async exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
416
|
+
async exportCollectionRaw(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<runtime.HttpFile>> {
|
|
360
417
|
const requestOptions = await this.exportCollectionRequestOpts(requestParameters);
|
|
361
418
|
const response = await this.request(requestOptions, initOverrides);
|
|
362
419
|
|
|
@@ -366,7 +423,7 @@ export class CollectionsApi extends runtime.BaseAPI implements CollectionsApiInt
|
|
|
366
423
|
/**
|
|
367
424
|
* Export collection data as CSV ZIP archive or Excel workbook
|
|
368
425
|
*/
|
|
369
|
-
async exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
426
|
+
async exportCollection(requestParameters: ExportCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.HttpFile> {
|
|
370
427
|
const response = await this.exportCollectionRaw(requestParameters, initOverrides);
|
|
371
428
|
return await response.value();
|
|
372
429
|
}
|