feat: add provisioning lifecycle actions
Rename Deployments to Provisioning with compatible redirects and APIs. Add durable Start, Restart, Stop, and Rebuild operations alongside Create and Destroy; rebuild wipes the instance and recreates it in the same slot and port. Add lifecycle, migration, recovery, and Komodo command tests. Type checks and production build pass; the full suite retains a telemetry assertion failure reproduced on the unchanged branch. Refs #39
This commit is contained in:
@@ -520,6 +520,21 @@ export async function komodoDeploy(deployment: string): Promise<KomodoWriteResul
|
||||
return postAndClassify('execute/Deploy', { deployment });
|
||||
}
|
||||
|
||||
/** Runtime controls use the saved Komodo resource, never the EC display name. */
|
||||
export async function komodoRuntimeAction(server: string, action: 'start' | 'stop'): Promise<KomodoRestartResult> {
|
||||
if (!komodoConfigured()) return { ok: false, kind: 'unconfigured', message: 'komodo not configured' };
|
||||
const row = getServer(server);
|
||||
if (!row?.komodo_name) return { ok: false, kind: 'no-name', message: 'no komodo_name set for server' };
|
||||
const type = row.komodo_type ?? 'deployment';
|
||||
const verb = action === 'start' ? 'Start' : 'Stop';
|
||||
if (type === 'container') {
|
||||
if (!row.komodo_server) return { ok: false, kind: 'no-name', message: 'container type needs komodo_server' };
|
||||
return postAndClassify(`execute/${verb}Container`, { server: row.komodo_server, container: row.komodo_name });
|
||||
}
|
||||
if (type === 'stack') return postAndClassify(`execute/${verb}Stack`, { stack: row.komodo_name });
|
||||
return postAndClassify(`execute/${verb}Deployment`, { deployment: row.komodo_name });
|
||||
}
|
||||
|
||||
/** Stop + remove the container backing a Komodo deployment. Entity remains. */
|
||||
export async function komodoDestroyDeployment(deployment: string): Promise<KomodoWriteResult> {
|
||||
if (!komodoConfigured()) {
|
||||
|
||||
Reference in New Issue
Block a user