Skip to main content

EnvironmentDebugApi API

Environment Debug API

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

Quick Reference

MethodDescription
cleanupCleans up stale or orphaned environment instances.
getByProviderRetrieves environment instances associated with a specific provider.
getInstanceRetrieves a specific environment debug instance by its ID.
getInstanceLogsRetrieves parsed logs for an environment debug instance.
getInstanceRawLogsRetrieves raw, unprocessed logs for an environment debug instance.
getRunningInstancesRetrieves all currently running environment instances.
listFilteredInstancesLists environment debug instances matching specific filter criteria.
listInstancesLists all environment debug instances.
rebuildIndexRebuilds the environment debug index from scratch.

Methods


cleanup

client.environmentDebugApi.cleanup(): Promise<unknown>

Cleans up stale or orphaned environment instances.

Removes environment instances that are no longer active or have been orphaned due to provider failures. This is a maintenance operation that should be run periodically to keep the debug index clean.

No parameters.

Returns: Promise<unknown> — A promise that resolves when cleanup is complete

Full reference →


getByProvider

client.environmentDebugApi.getByProvider(providerId: string): Promise<EnvironmentDebugInstance[]>

Retrieves environment instances associated with a specific provider.

Filters instances by the provider that created or manages them, useful for diagnosing issues with a particular environment provider.

ParameterTypeRequiredDescription
providerIdstringYesThe unique identifier of the environment provider

Returns: Promise<EnvironmentDebugInstance[]> — A promise that resolves to an array of objects for the given provider

Full reference →


getInstance

client.environmentDebugApi.getInstance(environmentId: string): Promise<EnvironmentDebugInstance>

Retrieves a specific environment debug instance by its ID.

Returns the full detail of a single environment instance including its current state, provider information, and metadata.

ParameterTypeRequiredDescription
environmentIdstringYesThe unique identifier of the environment instance

Returns: Promise<EnvironmentDebugInstance> — A promise that resolves to the

Full reference →


getInstanceLogs

client.environmentDebugApi.getInstanceLogs(environmentId: string, params?: EnvironmentDebugLogsParams): Promise<EnvironmentDebugLog[]>

Retrieves parsed logs for an environment debug instance.

Returns structured log entries that have been parsed from raw output, making them easier to filter, search, and display in a UI.

ParameterTypeRequiredDescription
environmentIdstringYesThe unique identifier of the environment instance
paramsEnvironmentDebugLogsParamsNoOptional parameters to filter logs by level, time range, or pagination

Returns: Promise<EnvironmentDebugLog[]> — A promise that resolves to an array of entries

Full reference →


getInstanceRawLogs

client.environmentDebugApi.getInstanceRawLogs(environmentId: string, params?: EnvironmentDebugLogsParams): Promise<unknown>

Retrieves raw, unprocessed logs for an environment debug instance.

Returns the original log output without parsing or structuring. Useful for debugging cases where parsed logs may lose important context.

ParameterTypeRequiredDescription
environmentIdstringYesThe unique identifier of the environment instance
paramsEnvironmentDebugLogsParamsNoOptional parameters to filter or paginate raw log output

Returns: Promise<unknown> — A promise that resolves to the raw log data

Full reference →


getRunningInstances

client.environmentDebugApi.getRunningInstances(): Promise<EnvironmentDebugInstance[]>

Retrieves all currently running environment instances.

Returns only instances that are in an active/running state, which is useful for monitoring dashboards and health checks.

No parameters.

Returns: Promise<EnvironmentDebugInstance[]> — A promise that resolves to an array of running objects

Full reference →


listFilteredInstances

client.environmentDebugApi.listFilteredInstances(params?: EnvironmentDebugFilteredParams): Promise<EnvironmentDebugInstance[]>

Lists environment debug instances matching specific filter criteria.

Similar to but applies additional server-side filtering such as status, date range, or provider constraints.

ParameterTypeRequiredDescription
paramsEnvironmentDebugFilteredParamsNoOptional filter parameters to narrow results

Returns: Promise<EnvironmentDebugInstance[]> — A promise that resolves to an array of filtered objects

Full reference →


listInstances

client.environmentDebugApi.listInstances(params?: EnvironmentDebugInstancesParams): Promise<EnvironmentDebugInstance[]>

Lists all environment debug instances.

Returns every known environment instance regardless of state. Use the optional parameters to paginate or filter results server-side.

ParameterTypeRequiredDescription
paramsEnvironmentDebugInstancesParamsNoOptional query parameters for pagination and filtering

Returns: Promise<EnvironmentDebugInstance[]> — A promise that resolves to an array of objects

Full reference →


rebuildIndex

client.environmentDebugApi.rebuildIndex(data?: RebuildEnvironmentIndexRequest): Promise<unknown>

Rebuilds the environment debug index from scratch.

Triggers a full re-indexing of all environment instances. Use this when the index becomes inconsistent or after bulk data migrations.

ParameterTypeRequiredDescription
dataRebuildEnvironmentIndexRequestNoOptional configuration for the rebuild process

Returns: Promise<unknown> — A promise that resolves when the rebuild is initiated

Full reference →