Skip to content
Ona Docs

DeleteEnvironment

client.environments.delete(EnvironmentDeleteParams { environmentId, force } body, RequestOptionsoptions?): EnvironmentDeleteResponse
POST/gitpod.v1.EnvironmentService/DeleteEnvironment

Permanently deletes an environment.

Running environments are automatically stopped before deletion. If force is true, the environment is deleted immediately without graceful shutdown.

Examples

  • Delete with graceful shutdown:

    Deletes an environment after gracefully stopping it.

    environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
    force: false
  • Force delete:

    Immediately deletes an environment without waiting for graceful shutdown.

    environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
    force: true
ParametersExpand Collapse
body: EnvironmentDeleteParams { environmentId, force }
environmentId?: string

environment_id specifies the environment that is going to delete.

+required

formatuuid
force?: boolean

force indicates whether the environment should be deleted forcefully When force deleting an Environment, the Environment is removed immediately and environment lifecycle is not respected. Force deleting can result in data loss on the environment.

ReturnsExpand Collapse
EnvironmentDeleteResponse = unknown

DeleteEnvironment

import Gitpod from '@gitpod/sdk';

const client = new Gitpod({
  bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});

const environment = await client.environments.delete({
  environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048',
});

console.log(environment);
{}
Returns Examples
{}