Makes cluster-nodes functional.
This commit is contained in:
@@ -13,8 +13,8 @@ export const clusterApi = {
|
||||
return apiClient.post(`/api/v1/instances/${instanceName}/cluster/config/generate`, config);
|
||||
},
|
||||
|
||||
async bootstrap(instanceName: string, node: string): Promise<OperationResponse> {
|
||||
return apiClient.post<OperationResponse>(`/api/v1/instances/${instanceName}/cluster/bootstrap`, { node });
|
||||
async bootstrap(instanceName: string, nodeName: string): Promise<OperationResponse> {
|
||||
return apiClient.post<OperationResponse>(`/api/v1/instances/${instanceName}/cluster/bootstrap`, { node_name: nodeName });
|
||||
},
|
||||
|
||||
async configureEndpoints(instanceName: string, includeNodes = false): Promise<OperationResponse> {
|
||||
|
||||
@@ -39,14 +39,23 @@ export const nodesApi = {
|
||||
return apiClient.post(`/api/v1/instances/${instanceName}/nodes/discover`, { subnet });
|
||||
},
|
||||
|
||||
async detect(instanceName: string): Promise<OperationResponse> {
|
||||
return apiClient.post(`/api/v1/instances/${instanceName}/nodes/detect`);
|
||||
async detect(instanceName: string, ip?: string): Promise<OperationResponse> {
|
||||
const body = ip ? { ip } : {};
|
||||
return apiClient.post(`/api/v1/instances/${instanceName}/nodes/detect`, body);
|
||||
},
|
||||
|
||||
async autoDetect(instanceName: string): Promise<{ networks: string[]; nodes: any[]; count: number }> {
|
||||
return apiClient.post(`/api/v1/instances/${instanceName}/nodes/auto-detect`);
|
||||
},
|
||||
|
||||
async discoveryStatus(instanceName: string): Promise<DiscoveryStatus> {
|
||||
return apiClient.get(`/api/v1/instances/${instanceName}/discovery`);
|
||||
},
|
||||
|
||||
async cancelDiscovery(instanceName: string): Promise<OperationResponse> {
|
||||
return apiClient.post(`/api/v1/instances/${instanceName}/discovery/cancel`);
|
||||
},
|
||||
|
||||
async getHardware(instanceName: string, ip: string): Promise<HardwareInfo> {
|
||||
return apiClient.get(`/api/v1/instances/${instanceName}/nodes/hardware/${ip}`);
|
||||
},
|
||||
|
||||
@@ -11,6 +11,13 @@ export interface Node {
|
||||
maintenance?: boolean;
|
||||
configured?: boolean;
|
||||
applied?: boolean;
|
||||
// Active operation flags
|
||||
configureInProgress?: boolean;
|
||||
applyInProgress?: boolean;
|
||||
// Optional runtime fields for enhanced status
|
||||
isReachable?: boolean;
|
||||
inKubernetes?: boolean;
|
||||
lastHealthCheck?: string;
|
||||
// Optional fields (not yet returned by API)
|
||||
hardware?: HardwareInfo;
|
||||
talosVersion?: string;
|
||||
@@ -23,15 +30,19 @@ export interface HardwareInfo {
|
||||
disk?: string;
|
||||
manufacturer?: string;
|
||||
model?: string;
|
||||
// Hardware detection fields
|
||||
ip?: string;
|
||||
interface?: string;
|
||||
interfaces?: string[];
|
||||
disks?: Array<{ path: string; size: number }>;
|
||||
selected_disk?: string;
|
||||
}
|
||||
|
||||
export interface DiscoveredNode {
|
||||
ip: string;
|
||||
hostname?: string;
|
||||
maintenance_mode?: boolean;
|
||||
maintenance_mode: boolean;
|
||||
version?: string;
|
||||
interface?: string;
|
||||
disks?: string[];
|
||||
}
|
||||
|
||||
export interface DiscoveryStatus {
|
||||
@@ -50,6 +61,10 @@ export interface NodeAddRequest {
|
||||
target_ip: string;
|
||||
role: 'controlplane' | 'worker';
|
||||
disk?: string;
|
||||
current_ip?: string;
|
||||
interface?: string;
|
||||
schematic_id?: string;
|
||||
maintenance?: boolean;
|
||||
}
|
||||
|
||||
export interface NodeUpdateRequest {
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
export interface BootstrapProgress {
|
||||
current_step: number;
|
||||
step_name: string;
|
||||
attempt: number;
|
||||
max_attempts: number;
|
||||
step_description: string;
|
||||
}
|
||||
|
||||
export interface OperationDetails {
|
||||
bootstrap?: BootstrapProgress;
|
||||
}
|
||||
|
||||
export interface Operation {
|
||||
id: string;
|
||||
instance_name: string;
|
||||
@@ -9,6 +21,7 @@ export interface Operation {
|
||||
started: string;
|
||||
completed?: string;
|
||||
error?: string;
|
||||
details?: OperationDetails;
|
||||
}
|
||||
|
||||
export interface OperationListResponse {
|
||||
|
||||
Reference in New Issue
Block a user