import * as plugins from '../plugins.js'; import type { IIdentity } from '../data/user.js'; /** * A provisioned corestore resource (SmartDb database or SmartStorage bucket) * as reported by a node's corestore control API. */ export interface ICorestoreResourceInfo { capability: 'database' | 'objectstorage'; provider: string; resourceName: string; createdAt: number; } export interface ICorestoreServiceResources { serviceId: string; serviceName?: string; resources: ICorestoreResourceInfo[]; updatedAt: number; } /** * Corestore inventory of one node (each coreflow node runs its own corestore; * the data is node-local, which is what makes node placement matter). */ export interface ICorestoreNodeInventory { /** Swarm node hostnames of the reporting coreflow. */ nodeNames: string[]; protocolVersion: 1; checkedAt: number; reachable: boolean; errorCode?: 'NODE_DISCOVERY_FAILED' | 'CORESTORE_UNREACHABLE'; error?: string; services: ICorestoreServiceResources[]; } export type TCorestoreInventoryProbeStatus = | 'ok' | 'connection-missing' | 'connection-inspection-failed' | 'identity-unverified' | 'node-tag-missing' | 'connection-ambiguous' | 'handler-unsupported' | 'rpc-timeout' | 'rpc-rejected' | 'rpc-invalid-response' | 'node-identity-mismatch' | 'corestore-unreachable'; /** * Cloudly's control-plane view of one expected node. Every expected online * node receives exactly one probe result, including transport and registration * failures that used to disappear from the inventory array. */ export interface ICorestoreInventoryProbe { expectedNodeName: string; expectedClusterId?: string; processRunning?: boolean; cloudlyRegistered: boolean; inventoryRpcReady: boolean; status: TCorestoreInventoryProbeStatus; connectionId?: string; reporterSessionId?: string; capabilityVersion?: number; observedNodeNames: string[]; checkedAt: number; lastSuccessfulInventoryAt?: number; message?: string; inventory?: ICorestoreNodeInventory; } export interface ICorestoreInventoryReport { checkedAt: number; inventories: ICorestoreNodeInventory[]; probes: ICorestoreInventoryProbe[]; } /** Final registration tag restored only after identity and capability tags. */ export interface ICoreflowInventoryRegistration { registrationVersion: 1; reporterSessionId: string; registeredAt: number; } export interface IReq_Any_Cloudly_GetCorestoreInventory extends plugins.typedrequestInterfaces.implementsTR< plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_GetCorestoreInventory > { method: 'getCorestoreInventory'; request: { identity: IIdentity; }; response: ICorestoreInventoryReport; } export interface IReq_Cloudly_Coreflow_GetCorestoreInventory extends plugins.typedrequestInterfaces.implementsTR< plugins.typedrequestInterfaces.ITypedRequest, IReq_Cloudly_Coreflow_GetCorestoreInventory > { method: 'coreflowGetCorestoreInventory'; request: Record; response: { inventory: ICorestoreNodeInventory; }; }