Complete provisioning job detail pages and lifecycle evidence
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
import type { ProvisioningAction } from './provisioning.js';
|
||||
import type { LaunchRecipeSummary } from './deployment-plan.js';
|
||||
|
||||
export const provisioningPhases = ['requested', 'eligibility', 'startup-queue', 'prepare', 'create-deployment',
|
||||
'container-action', 'remove-container', 'delete-deployment', 'cleanup', 'verify-container', 'verify-game',
|
||||
'verify-map', 'verify-stopped'] as const;
|
||||
export type ProvisioningPhase = typeof provisioningPhases[number];
|
||||
export type EvidenceResult = 'pass' | 'waiting' | 'fail' | 'unknown';
|
||||
export type EvidenceSource = 'komodo' | 'rcon' | 'telemetry' | 'combined' | null;
|
||||
|
||||
export interface ProvisioningCheck {
|
||||
key: 'container' | 'game' | 'map' | 'occupancy' | 'stopped';
|
||||
label: string;
|
||||
result: EvidenceResult;
|
||||
source: EvidenceSource;
|
||||
checkedAt: string;
|
||||
receivedAt: string | null;
|
||||
expected: string | number | null;
|
||||
actual: string | number | null;
|
||||
message: string | null;
|
||||
}
|
||||
export interface ProvisioningBlocker {
|
||||
code: string;
|
||||
message: string;
|
||||
automatic: boolean;
|
||||
href?: string | null;
|
||||
label?: string | null;
|
||||
}
|
||||
export interface ProvisioningCheckpoint {
|
||||
key: string;
|
||||
label: string;
|
||||
at: string;
|
||||
phase: ProvisioningPhase | null;
|
||||
}
|
||||
export interface RecoveryObservation {
|
||||
state: 'held' | 'released' | 'transferred' | 'unknown';
|
||||
at: string;
|
||||
message: string;
|
||||
operationId?: string | null;
|
||||
}
|
||||
export interface ProvisioningProgress {
|
||||
version: 1;
|
||||
phase: ProvisioningPhase | null;
|
||||
phaseStartedAt: string | null;
|
||||
observedAt: string | null;
|
||||
blocker: ProvisioningBlocker | null;
|
||||
checks: ProvisioningCheck[];
|
||||
checkpoints: ProvisioningCheckpoint[];
|
||||
command: { state: 'attempted' | 'accepted' | 'rejected' | 'uncertain'; at: string; message: string } | null;
|
||||
recovery: RecoveryObservation | null;
|
||||
recipeStatus: 'queued' | 'attempted' | null;
|
||||
}
|
||||
export interface ProvisioningEvent {
|
||||
id: number;
|
||||
created_at: string;
|
||||
message: string;
|
||||
kind?: string | null;
|
||||
phase_key?: string | null;
|
||||
details_json?: string | null;
|
||||
}
|
||||
export interface ProvisioningDeployment {
|
||||
id: string;
|
||||
server: string;
|
||||
server_deleted_at: string | null;
|
||||
action: ProvisioningAction;
|
||||
state: string;
|
||||
stage: string;
|
||||
started_at: string;
|
||||
finished_at: string | null;
|
||||
submitted_at?: string | null;
|
||||
checked_at?: string | null;
|
||||
players?: number | null;
|
||||
triggered_by: string;
|
||||
error: string | null;
|
||||
warnings: string;
|
||||
server_exists: number;
|
||||
expected_map?: string | null;
|
||||
}
|
||||
export interface ProvisioningSource {
|
||||
kind: 'campaign' | 'beta' | 'maintenance' | 'watchdog';
|
||||
source_id: string;
|
||||
server?: string;
|
||||
label: string;
|
||||
href: string | null;
|
||||
}
|
||||
export interface ProvisioningCapacity {
|
||||
evaluatedAt: string;
|
||||
pools: {
|
||||
kind: 'startup' | 'restart';
|
||||
limit: number;
|
||||
used: number;
|
||||
holders: { id: string | null; server: string }[];
|
||||
requestOrder: number | null;
|
||||
ownsSlot: boolean;
|
||||
}[];
|
||||
}
|
||||
export interface ProvisioningDetail {
|
||||
deployment: ProvisioningDeployment;
|
||||
events: ProvisioningEvent[];
|
||||
activity: { total: number; latestId: number | null; failureExcerpt: ProvisioningEvent | null };
|
||||
sources: ProvisioningSource[];
|
||||
recipe: LaunchRecipeSummary | null;
|
||||
blueprintName: string | null;
|
||||
canResumeVerification: boolean;
|
||||
canResumeCleanup: boolean;
|
||||
canResumeRebuild: boolean;
|
||||
canCancelRemoval: boolean;
|
||||
collection: { id: string; name: string } | null;
|
||||
progress: ProvisioningProgress | null;
|
||||
capacity: ProvisioningCapacity;
|
||||
warningMessages: string[];
|
||||
generatedAt: string;
|
||||
}
|
||||
export interface ProvisioningEventPage {
|
||||
events: ProvisioningEvent[];
|
||||
total: number;
|
||||
totalEvents: number;
|
||||
latestId: number | null;
|
||||
watermark: number;
|
||||
nextCursor: number | null;
|
||||
}
|
||||
Reference in New Issue
Block a user