diff --git a/apps/demo/src/migration-wizard/steps/discovery/DiscoveryStep.tsx b/apps/demo/src/migration-wizard/steps/discovery/DiscoveryStep.tsx index c19a2ff..c756bf5 100644 --- a/apps/demo/src/migration-wizard/steps/discovery/DiscoveryStep.tsx +++ b/apps/demo/src/migration-wizard/steps/discovery/DiscoveryStep.tsx @@ -39,7 +39,7 @@ import { ReportPieChart } from "./ReportPieChart"; export const DiscoveryStep: React.FC = () => { const discoverSourcesContext = useDiscoverySources(); const { inventory } = discoverSourcesContext.sourceSelected as Source; - const { infra, vms } = inventory!; + const { infra, vms, smartState } = inventory!; const { datastores, networks, @@ -301,6 +301,24 @@ export const DiscoveryStep: React.FC = () => { ], }; + const smartStateViewData: TreeViewDataItem = { + title: "Smart State POC", + icon: , + name: <>This is the collected Smart State data, + id: "smarts", + children: [ + { + title: "Details", + name: ( +
+          {smartState ? JSON.stringify(smartState, null, 2) : "No data available"}
+        
+ ), + id: "os-details", + }, + ], + }; + const operatingSystemsViewData: TreeViewDataItem = { title: "Operating systems", icon: , @@ -330,6 +348,7 @@ export const DiscoveryStep: React.FC = () => { networksViewData, storageViewData, operatingSystemsViewData, + smartStateViewData, ]; return ( diff --git a/apps/demo/vite.config.ts b/apps/demo/vite.config.ts index 53d0fdb..9cfa1a7 100644 --- a/apps/demo/vite.config.ts +++ b/apps/demo/vite.config.ts @@ -13,12 +13,12 @@ export default defineConfig((_env) => { server: { proxy: { "/planner/api": { - target: "http://172.17.0.3:3443", + target: "http://192.168.122.1:3443", changeOrigin: true, rewrite: (path): string => path.replace(/^\/planner/, ""), }, "/agent/api/v1": { - target: "http://172.17.0.3:3333", + target: "http://192.168.122.1:3333", changeOrigin: true, rewrite: (path): string => path.replace(/^\/agent/, ""), }, diff --git a/openapitools.json b/openapitools.json index 8669894..bd8d3bd 100644 --- a/openapitools.json +++ b/openapitools.json @@ -5,7 +5,7 @@ "version": "7.8.0", "generators": { "api-client": { - "inputSpec": "https://raw.githubusercontent.com/kubev2v/migration-planner/main/api/v1alpha1/openapi.yaml", + "inputSpec": "https://raw.githubusercontent.com/kubev2v/migration-planner/41c138c994c82262aef827a322dbc480f5d840f2/api/v1alpha1/openapi.yaml", "output": "packages/api-client", "generatorName": "typescript-fetch", "additionalProperties": { diff --git a/packages/api-client/src/apis/SourceApi.ts b/packages/api-client/src/apis/SourceApi.ts index 5aedca1..99c4f70 100644 --- a/packages/api-client/src/apis/SourceApi.ts +++ b/packages/api-client/src/apis/SourceApi.ts @@ -182,7 +182,7 @@ export class SourceApi extends runtime.BaseAPI implements SourceApiInterface { * list sources */ async listSources(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const response = await this.listSourcesRaw(initOverrides); + const response = await this.listSourcesRaw(initOverrides); return await response.value(); } diff --git a/packages/api-client/src/models/Inventory.ts b/packages/api-client/src/models/Inventory.ts index 2334e5a..48352ac 100644 --- a/packages/api-client/src/models/Inventory.ts +++ b/packages/api-client/src/models/Inventory.ts @@ -56,6 +56,12 @@ export interface Inventory { * @memberof Inventory */ infra: Infra; + /** + * + * @type {Array<{ [key: string]: any; }>} + * @memberof Inventory + */ + smartState?: Array<{ [key: string]: any; }>; } /** @@ -81,6 +87,7 @@ export function InventoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): 'vcenter': json['vcenter'], 'vms': json['vms'], 'infra': json['infra'], + 'smartState': json['smartState'] == null ? undefined : json['smartState'], }; } @@ -93,6 +100,7 @@ export function InventoryToJSON(value?: Inventory | null): any { 'vcenter': value['vcenter'], 'vms': value['vms'], 'infra': value['infra'], + 'smartState': value['smartState'], }; } diff --git a/packages/api-client/src/models/Source.ts b/packages/api-client/src/models/Source.ts index dfa1099..9169e43 100644 --- a/packages/api-client/src/models/Source.ts +++ b/packages/api-client/src/models/Source.ts @@ -38,24 +38,6 @@ export interface Source { * @memberof Source */ id: string; - /** - * - * @type {string} - * @memberof Source - */ - name: string; - /** - * - * @type {string} - * @memberof Source - */ - status: SourceStatusEnum; - /** - * - * @type {string} - * @memberof Source - */ - statusInfo: string; /** * * @type {Inventory} @@ -79,7 +61,7 @@ export interface Source { * @type {string} * @memberof Source */ - sshKey?: string; + name?: string; /** * * @type {Array} @@ -88,28 +70,11 @@ export interface Source { agents?: Array; } - -/** - * @export - */ -export const SourceStatusEnum = { - NotConnected: 'not-connected', - WaitingForCredentials: 'waiting-for-credentials', - Error: 'error', - GatheringInitialInventory: 'gathering-initial-inventory', - UpToDate: 'up-to-date' -} as const; -export type SourceStatusEnum = typeof SourceStatusEnum[keyof typeof SourceStatusEnum]; - - /** * Check if a given object implements the Source interface. */ export function instanceOfSource(value: object): value is Source { if (!('id' in value) || value['id'] === undefined) return false; - if (!('name' in value) || value['name'] === undefined) return false; - if (!('status' in value) || value['status'] === undefined) return false; - if (!('statusInfo' in value) || value['statusInfo'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; return true; @@ -126,13 +91,10 @@ export function SourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): So return { 'id': json['id'], - 'name': json['name'], - 'status': json['status'], - 'statusInfo': json['statusInfo'], 'inventory': json['inventory'] == null ? undefined : InventoryFromJSON(json['inventory']), 'createdAt': (new Date(json['createdAt'])), 'updatedAt': (new Date(json['updatedAt'])), - 'sshKey': json['sshKey'] == null ? undefined : json['sshKey'], + 'name': json['name'] == null ? undefined : json['name'], 'agents': json['agents'] == null ? undefined : ((json['agents'] as Array).map(SourceAgentItemFromJSON)), }; } @@ -144,13 +106,10 @@ export function SourceToJSON(value?: Source | null): any { return { 'id': value['id'], - 'name': value['name'], - 'status': value['status'], - 'statusInfo': value['statusInfo'], 'inventory': InventoryToJSON(value['inventory']), 'createdAt': ((value['createdAt']).toISOString()), 'updatedAt': ((value['updatedAt']).toISOString()), - 'sshKey': value['sshKey'], + 'name': value['name'], 'agents': value['agents'] == null ? undefined : ((value['agents'] as Array).map(SourceAgentItemToJSON)), }; }