feat(api,cli,docs): auto-delete sandbox interval (#2061)
Signed-off-by: fabjanvucina <fabjanvucina@gmail.com>
This commit is contained in:
@@ -160,6 +160,9 @@ export class MetricsInterceptor implements NestInterceptor, OnApplicationShutdow
|
||||
case '/api/workspace/:workspaceId/autoarchive/:interval':
|
||||
this.captureSetAutoArchiveInterval(props, request.params.sandboxId, parseInt(request.params.interval))
|
||||
break
|
||||
case '/api/sandbox/:sandboxId/autodelete/:interval':
|
||||
this.captureSetAutoDeleteInterval(props, request.params.sandboxId, parseInt(request.params.interval))
|
||||
break
|
||||
case '/api/organizations/invitations/:invitationId/accept':
|
||||
this.captureAcceptInvitation(props, request.params.invitationId)
|
||||
break
|
||||
@@ -484,6 +487,8 @@ export class MetricsInterceptor implements NestInterceptor, OnApplicationShutdow
|
||||
sandbox_auto_stop_interval_min: response.autoStopInterval,
|
||||
sandbox_auto_archive_interval_min_request: request.autoArchiveInterval,
|
||||
sandbox_auto_archive_interval_min: response.autoArchiveInterval,
|
||||
sandbox_auto_delete_interval_min_request: request.autoDeleteInterval,
|
||||
sandbox_auto_delete_interval_min: response.autoDeleteInterval,
|
||||
sandbox_public_request: request.public,
|
||||
sandbox_public: response.public,
|
||||
sandbox_labels_request: request.labels,
|
||||
@@ -590,6 +595,13 @@ export class MetricsInterceptor implements NestInterceptor, OnApplicationShutdow
|
||||
})
|
||||
}
|
||||
|
||||
private captureSetAutoDeleteInterval(props: CommonCaptureProps, sandboxId: string, interval: number) {
|
||||
this.capture('api_sandbox_autodelete_interval_updated', props, 'api_sandbox_autodelete_interval_update_failed', {
|
||||
sandbox_id: sandboxId,
|
||||
sandbox_autodelete_interval: interval,
|
||||
})
|
||||
}
|
||||
|
||||
private captureUpdateSandboxLabels(props: CommonCaptureProps, sandboxId: string) {
|
||||
this.capture('api_sandbox_labels_update', props, 'api_sandbox_labels_update_failed', {
|
||||
sandbox_id: sandboxId,
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2025 Daytona Platforms Inc.
|
||||
* SPDX-License-Identifier: AGPL-3.0
|
||||
*/
|
||||
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm'
|
||||
|
||||
export class Migration1750668569562 implements MigrationInterface {
|
||||
name = 'Migration1750668569562'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "sandbox" ADD "autoDeleteInterval" integer NOT NULL DEFAULT '-1'`)
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "sandbox" DROP COLUMN "autoDeleteInterval"`)
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@ export class SandboxController {
|
||||
@Throttle({ default: { limit: 100 } })
|
||||
@RequiredOrganizationResourcePermissions([OrganizationResourcePermission.DELETE_SANDBOXES])
|
||||
@UseGuards(SandboxAccessGuard)
|
||||
async removeSandbox(
|
||||
async deleteSandbox(
|
||||
@Param('sandboxId') sandboxId: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
@Query('force') force?: boolean,
|
||||
@@ -408,6 +408,35 @@ export class SandboxController {
|
||||
await this.sandboxService.setAutoArchiveInterval(sandboxId, interval)
|
||||
}
|
||||
|
||||
@Post(':sandboxId/autodelete/:interval')
|
||||
@ApiOperation({
|
||||
summary: 'Set sandbox auto-delete interval',
|
||||
operationId: 'setAutoDeleteInterval',
|
||||
})
|
||||
@ApiParam({
|
||||
name: 'sandboxId',
|
||||
description: 'ID of the sandbox',
|
||||
type: 'string',
|
||||
})
|
||||
@ApiParam({
|
||||
name: 'interval',
|
||||
description:
|
||||
'Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)',
|
||||
type: 'number',
|
||||
})
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description: 'Auto-delete interval has been set',
|
||||
})
|
||||
@RequiredOrganizationResourcePermissions([OrganizationResourcePermission.WRITE_SANDBOXES])
|
||||
@UseGuards(SandboxAccessGuard)
|
||||
async setAutoDeleteInterval(
|
||||
@Param('sandboxId') sandboxId: string,
|
||||
@Param('interval') interval: number,
|
||||
): Promise<void> {
|
||||
await this.sandboxService.setAutoDeleteInterval(sandboxId, interval)
|
||||
}
|
||||
|
||||
@Post(':sandboxId/archive')
|
||||
@HttpCode(200)
|
||||
@ApiOperation({
|
||||
|
||||
@@ -128,6 +128,16 @@ export class CreateSandboxDto {
|
||||
@IsNumber()
|
||||
autoArchiveInterval?: number
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
'Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)',
|
||||
example: 30,
|
||||
type: 'integer',
|
||||
})
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
autoDeleteInterval?: number
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description: 'Array of volumes to attach to the sandbox',
|
||||
type: [SandboxVolume],
|
||||
|
||||
@@ -169,6 +169,15 @@ export class SandboxDto {
|
||||
@IsOptional()
|
||||
autoArchiveInterval?: number
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
'Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)',
|
||||
example: 30,
|
||||
required: false,
|
||||
})
|
||||
@IsOptional()
|
||||
autoDeleteInterval?: number
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description: 'The domain name of the runner',
|
||||
example: 'runner.example.com',
|
||||
@@ -250,6 +259,7 @@ export class SandboxDto {
|
||||
backupCreatedAt: sandbox.lastBackupAt?.toISOString(),
|
||||
autoStopInterval: sandbox.autoStopInterval,
|
||||
autoArchiveInterval: sandbox.autoArchiveInterval,
|
||||
autoDeleteInterval: sandbox.autoDeleteInterval,
|
||||
class: sandbox.class,
|
||||
createdAt: sandbox.createdAt?.toISOString(),
|
||||
updatedAt: sandbox.updatedAt?.toISOString(),
|
||||
|
||||
@@ -158,6 +158,12 @@ export class Sandbox {
|
||||
@Column({ default: 7 * 24 * 60 })
|
||||
autoArchiveInterval?: number
|
||||
|
||||
// this is the interval in minutes after which a continuously stopped workspace will be automatically deleted
|
||||
// if set to negative value, auto delete will be disabled
|
||||
// if set to 0, sandbox will be immediately deleted upon stopping
|
||||
@Column({ default: -1 })
|
||||
autoDeleteInterval?: number
|
||||
|
||||
@Column({ default: false })
|
||||
pending?: boolean
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { Injectable, Logger } from '@nestjs/common'
|
||||
import { InjectRepository } from '@nestjs/typeorm'
|
||||
import { Cron, CronExpression } from '@nestjs/schedule'
|
||||
import { In, Not, Raw, Repository } from 'typeorm'
|
||||
import { In, MoreThanOrEqual, Not, Raw, Repository } from 'typeorm'
|
||||
import { Sandbox } from '../entities/sandbox.entity'
|
||||
import { SandboxState } from '../enums/sandbox-state.enum'
|
||||
import { SandboxDesiredState } from '../enums/sandbox-desired-state.enum'
|
||||
@@ -65,7 +65,6 @@ export class SandboxManager {
|
||||
async autostopCheck(): Promise<void> {
|
||||
// lock the sync to only run one instance at a time
|
||||
// keep the worker selected for 1 minute
|
||||
|
||||
if (!(await this.redisLockProvider.lock('auto-stop-check-worker-selected', 60))) {
|
||||
return
|
||||
}
|
||||
@@ -77,7 +76,7 @@ export class SandboxManager {
|
||||
// Process all runners in parallel
|
||||
await Promise.all(
|
||||
readyRunners.map(async (runner) => {
|
||||
const sandboxs = await this.sandboxRepository.find({
|
||||
const sandboxes = await this.sandboxRepository.find({
|
||||
where: {
|
||||
runnerId: runner.id,
|
||||
organizationId: Not(SANDBOX_WARM_POOL_UNASSIGNED_ORGANIZATION),
|
||||
@@ -95,7 +94,7 @@ export class SandboxManager {
|
||||
})
|
||||
|
||||
await Promise.all(
|
||||
sandboxs.map(async (sandbox) => {
|
||||
sandboxes.map(async (sandbox) => {
|
||||
const lockKey = SYNC_INSTANCE_STATE_LOCK_KEY + sandbox.id
|
||||
const acquired = await this.redisLockProvider.lock(lockKey, 30)
|
||||
if (!acquired) {
|
||||
@@ -104,7 +103,12 @@ export class SandboxManager {
|
||||
|
||||
try {
|
||||
sandbox.pending = true
|
||||
sandbox.desiredState = SandboxDesiredState.STOPPED
|
||||
// if auto-delete interval is 0, delete the sandbox immediately
|
||||
if (sandbox.autoDeleteInterval === 0) {
|
||||
sandbox.desiredState = SandboxDesiredState.DESTROYED
|
||||
} else {
|
||||
sandbox.desiredState = SandboxDesiredState.STOPPED
|
||||
}
|
||||
await this.sandboxRepository.save(sandbox)
|
||||
this.syncInstanceState(sandbox.id)
|
||||
} catch (error) {
|
||||
@@ -121,12 +125,10 @@ export class SandboxManager {
|
||||
@Cron(CronExpression.EVERY_MINUTE, { name: 'auto-archive-check' })
|
||||
async autoArchiveCheck(): Promise<void> {
|
||||
// lock the sync to only run one instance at a time
|
||||
const autoArchiveCheckWorkerSelected = await this.redis.get('auto-archive-check-worker-selected')
|
||||
if (autoArchiveCheckWorkerSelected) {
|
||||
// keep the worker selected for 1 minute
|
||||
if (!(await this.redisLockProvider.lock('auto-archive-check-worker-selected', 60))) {
|
||||
return
|
||||
}
|
||||
// keep the worker selected for 1 minute
|
||||
await this.redis.setex('auto-archive-check-worker-selected', 60, '1')
|
||||
|
||||
// Get all ready runners
|
||||
const allRunners = await this.runnerService.findAll()
|
||||
@@ -135,7 +137,7 @@ export class SandboxManager {
|
||||
// Process all runners in parallel
|
||||
await Promise.all(
|
||||
readyRunners.map(async (runner) => {
|
||||
const sandboxs = await this.sandboxRepository.find({
|
||||
const sandboxes = await this.sandboxRepository.find({
|
||||
where: {
|
||||
runnerId: runner.id,
|
||||
organizationId: Not(SANDBOX_WARM_POOL_UNASSIGNED_ORGANIZATION),
|
||||
@@ -147,13 +149,13 @@ export class SandboxManager {
|
||||
order: {
|
||||
lastBackupAt: 'ASC',
|
||||
},
|
||||
// max 3 sandboxs can be archived at the same time on the same runner
|
||||
// max 3 sandboxes can be archived at the same time on the same runner
|
||||
// this is to prevent the runner from being overloaded
|
||||
take: 3,
|
||||
})
|
||||
|
||||
await Promise.all(
|
||||
sandboxs.map(async (sandbox) => {
|
||||
sandboxes.map(async (sandbox) => {
|
||||
const lockKey = SYNC_INSTANCE_STATE_LOCK_KEY + sandbox.id
|
||||
const acquired = await this.redisLockProvider.lock(lockKey, 30)
|
||||
if (!acquired) {
|
||||
@@ -176,6 +178,61 @@ export class SandboxManager {
|
||||
)
|
||||
}
|
||||
|
||||
@Cron(CronExpression.EVERY_MINUTE, { name: 'auto-delete-check' })
|
||||
async autoDeleteCheck(): Promise<void> {
|
||||
// lock the sync to only run one instance at a time
|
||||
// keep the worker selected for 1 minute
|
||||
if (!(await this.redisLockProvider.lock('auto-delete-check-worker-selected', 60))) {
|
||||
return
|
||||
}
|
||||
|
||||
// Get all ready runners
|
||||
const allRunners = await this.runnerService.findAll()
|
||||
const readyRunners = allRunners.filter((runner) => runner.state === RunnerState.READY)
|
||||
|
||||
// Process all runners in parallel
|
||||
await Promise.all(
|
||||
readyRunners.map(async (runner) => {
|
||||
const sandboxes = await this.sandboxRepository.find({
|
||||
where: {
|
||||
runnerId: runner.id,
|
||||
organizationId: Not(SANDBOX_WARM_POOL_UNASSIGNED_ORGANIZATION),
|
||||
state: SandboxState.STOPPED,
|
||||
desiredState: SandboxDesiredState.STOPPED,
|
||||
pending: Not(true),
|
||||
autoDeleteInterval: MoreThanOrEqual(0),
|
||||
lastActivityAt: Raw((alias) => `${alias} < NOW() - INTERVAL '1 minute' * "autoDeleteInterval"`),
|
||||
},
|
||||
order: {
|
||||
lastActivityAt: 'ASC',
|
||||
},
|
||||
take: 100,
|
||||
})
|
||||
|
||||
await Promise.all(
|
||||
sandboxes.map(async (sandbox) => {
|
||||
const lockKey = SYNC_INSTANCE_STATE_LOCK_KEY + sandbox.id
|
||||
const acquired = await this.redisLockProvider.lock(lockKey, 30)
|
||||
if (!acquired) {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
sandbox.pending = true
|
||||
sandbox.desiredState = SandboxDesiredState.DESTROYED
|
||||
await this.sandboxRepository.save(sandbox)
|
||||
this.syncInstanceState(sandbox.id)
|
||||
} catch (error) {
|
||||
this.logger.error(`Error processing auto-delete state for sandbox ${sandbox.id}:`, fromAxiosError(error))
|
||||
} finally {
|
||||
await this.redisLockProvider.unlock(lockKey)
|
||||
}
|
||||
}),
|
||||
)
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
@Cron(CronExpression.EVERY_10_SECONDS, { name: 'sync-states' })
|
||||
@OtelSpan()
|
||||
async syncStates(): Promise<void> {
|
||||
@@ -184,7 +241,7 @@ export class SandboxManager {
|
||||
return
|
||||
}
|
||||
|
||||
const sandboxs = await this.sandboxRepository.find({
|
||||
const sandboxes = await this.sandboxRepository.find({
|
||||
where: {
|
||||
state: Not(In([SandboxState.DESTROYED, SandboxState.ERROR, SandboxState.BUILD_FAILED])),
|
||||
desiredState: Raw(
|
||||
@@ -199,7 +256,7 @@ export class SandboxManager {
|
||||
})
|
||||
|
||||
await Promise.all(
|
||||
sandboxs.map(async (sandbox) => {
|
||||
sandboxes.map(async (sandbox) => {
|
||||
this.syncInstanceState(sandbox.id)
|
||||
}),
|
||||
)
|
||||
@@ -221,7 +278,7 @@ export class SandboxManager {
|
||||
.having('COUNT(*) >= 3')
|
||||
.getRawMany()
|
||||
|
||||
const sandboxs = await this.sandboxRepository.find({
|
||||
const sandboxes = await this.sandboxRepository.find({
|
||||
where: [
|
||||
{
|
||||
state: SandboxState.ARCHIVING,
|
||||
@@ -242,7 +299,7 @@ export class SandboxManager {
|
||||
})
|
||||
|
||||
await Promise.all(
|
||||
sandboxs.map(async (sandbox) => {
|
||||
sandboxes.map(async (sandbox) => {
|
||||
this.syncInstanceState(sandbox.id)
|
||||
}),
|
||||
)
|
||||
@@ -432,7 +489,7 @@ export class SandboxManager {
|
||||
|
||||
// if the sandbox is already in progress, continue
|
||||
if (!inProgressOnRunner.find((s) => s.id === sandbox.id)) {
|
||||
// max 3 sandboxs can be archived at the same time on the same runner
|
||||
// max 3 sandboxes can be archived at the same time on the same runner
|
||||
// this is to prevent the runner from being overloaded
|
||||
if (inProgressOnRunner.length > 2) {
|
||||
await this.redisLockProvider.unlock(lockKey)
|
||||
@@ -855,7 +912,7 @@ export class SandboxManager {
|
||||
})
|
||||
const lessUsedRunners = availableRunners.filter((runner) => runner.id !== sandbox.runnerId)
|
||||
|
||||
// temp workaround to move sandboxs to less used runner
|
||||
// temp workaround to move sandboxes to less used runner
|
||||
if (lessUsedRunners.length > 0) {
|
||||
await this.sandboxRepository.update(sandbox.id, {
|
||||
runnerId: null,
|
||||
|
||||
@@ -322,13 +322,17 @@ export class SandboxService {
|
||||
sandbox.public = createSandboxDto.public || false
|
||||
|
||||
if (createSandboxDto.autoStopInterval !== undefined) {
|
||||
sandbox.autoStopInterval = createSandboxDto.autoStopInterval
|
||||
sandbox.autoStopInterval = this.resolveAutoStopInterval(createSandboxDto.autoStopInterval)
|
||||
}
|
||||
|
||||
if (createSandboxDto.autoArchiveInterval !== undefined) {
|
||||
sandbox.autoArchiveInterval = this.resolveAutoArchiveInterval(createSandboxDto.autoArchiveInterval)
|
||||
}
|
||||
|
||||
if (createSandboxDto.autoDeleteInterval !== undefined) {
|
||||
sandbox.autoDeleteInterval = createSandboxDto.autoDeleteInterval
|
||||
}
|
||||
|
||||
sandbox.runnerId = runner.id
|
||||
|
||||
await this.sandboxRepository.insert(sandbox)
|
||||
@@ -346,13 +350,17 @@ export class SandboxService {
|
||||
warmPoolSandbox.createdAt = new Date()
|
||||
|
||||
if (createSandboxDto.autoStopInterval !== undefined) {
|
||||
warmPoolSandbox.autoStopInterval = createSandboxDto.autoStopInterval
|
||||
warmPoolSandbox.autoStopInterval = this.resolveAutoStopInterval(createSandboxDto.autoStopInterval)
|
||||
}
|
||||
|
||||
if (createSandboxDto.autoArchiveInterval !== undefined) {
|
||||
warmPoolSandbox.autoArchiveInterval = this.resolveAutoArchiveInterval(createSandboxDto.autoArchiveInterval)
|
||||
}
|
||||
|
||||
if (createSandboxDto.autoDeleteInterval !== undefined) {
|
||||
warmPoolSandbox.autoDeleteInterval = createSandboxDto.autoDeleteInterval
|
||||
}
|
||||
|
||||
const runner = await this.runnerService.findOne(warmPoolSandbox.runnerId)
|
||||
|
||||
const result = await this.sandboxRepository.save(warmPoolSandbox)
|
||||
@@ -398,13 +406,17 @@ export class SandboxService {
|
||||
sandbox.public = createSandboxDto.public || false
|
||||
|
||||
if (createSandboxDto.autoStopInterval !== undefined) {
|
||||
sandbox.autoStopInterval = createSandboxDto.autoStopInterval
|
||||
sandbox.autoStopInterval = this.resolveAutoStopInterval(createSandboxDto.autoStopInterval)
|
||||
}
|
||||
|
||||
if (createSandboxDto.autoArchiveInterval !== undefined) {
|
||||
sandbox.autoArchiveInterval = this.resolveAutoArchiveInterval(createSandboxDto.autoArchiveInterval)
|
||||
}
|
||||
|
||||
if (createSandboxDto.autoDeleteInterval !== undefined) {
|
||||
sandbox.autoDeleteInterval = createSandboxDto.autoDeleteInterval
|
||||
}
|
||||
|
||||
const buildInfoSnapshotRef = generateBuildSnapshotRef(
|
||||
createSandboxDto.buildInfo.dockerfileContent,
|
||||
createSandboxDto.buildInfo.contextHashes,
|
||||
@@ -630,11 +642,22 @@ export class SandboxService {
|
||||
if (sandbox.pending) {
|
||||
throw new SandboxError('Sandbox state change in progress')
|
||||
}
|
||||
|
||||
sandbox.pending = true
|
||||
sandbox.desiredState = SandboxDesiredState.STOPPED
|
||||
// if auto-delete interval is 0, delete the sandbox immediately
|
||||
if (sandbox.autoDeleteInterval === 0) {
|
||||
sandbox.desiredState = SandboxDesiredState.DESTROYED
|
||||
} else {
|
||||
sandbox.desiredState = SandboxDesiredState.STOPPED
|
||||
}
|
||||
|
||||
await this.sandboxRepository.save(sandbox)
|
||||
|
||||
this.eventEmitter.emit(SandboxEvents.STOPPED, new SandboxStoppedEvent(sandbox))
|
||||
if (sandbox.autoDeleteInterval === 0) {
|
||||
this.eventEmitter.emit(SandboxEvents.DESTROYED, new SandboxDestroyedEvent(sandbox))
|
||||
} else {
|
||||
this.eventEmitter.emit(SandboxEvents.STOPPED, new SandboxStoppedEvent(sandbox))
|
||||
}
|
||||
}
|
||||
|
||||
async updatePublicStatus(sandboxId: string, isPublic: boolean): Promise<void> {
|
||||
@@ -701,7 +724,7 @@ export class SandboxService {
|
||||
})
|
||||
|
||||
if (destroyedSandboxs.affected > 0) {
|
||||
this.logger.debug(`Cleaned up ${destroyedSandboxs.affected} destroyed sandboxs`)
|
||||
this.logger.debug(`Cleaned up ${destroyedSandboxs.affected} destroyed sandboxes`)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -714,12 +737,7 @@ export class SandboxService {
|
||||
throw new NotFoundException(`Sandbox with ID ${sandboxId} not found`)
|
||||
}
|
||||
|
||||
// Validate interval is non-negative
|
||||
if (interval < 0) {
|
||||
throw new BadRequestError('Auto-stop interval must be non-negative')
|
||||
}
|
||||
|
||||
sandbox.autoStopInterval = interval
|
||||
sandbox.autoStopInterval = this.resolveAutoStopInterval(interval)
|
||||
await this.sandboxRepository.save(sandbox)
|
||||
}
|
||||
|
||||
@@ -736,6 +754,19 @@ export class SandboxService {
|
||||
await this.sandboxRepository.save(sandbox)
|
||||
}
|
||||
|
||||
async setAutoDeleteInterval(sandboxId: string, interval: number): Promise<void> {
|
||||
const sandbox = await this.sandboxRepository.findOne({
|
||||
where: { id: sandboxId },
|
||||
})
|
||||
|
||||
if (!sandbox) {
|
||||
throw new NotFoundException(`Sandbox with ID ${sandboxId} not found`)
|
||||
}
|
||||
|
||||
sandbox.autoDeleteInterval = interval
|
||||
await this.sandboxRepository.save(sandbox)
|
||||
}
|
||||
|
||||
@OnEvent(WarmPoolEvents.TOPUP_REQUESTED)
|
||||
private async createWarmPoolSandbox(event: WarmPoolTopUpRequested) {
|
||||
await this.createForWarmPool(event.warmPool)
|
||||
@@ -749,8 +780,8 @@ export class SandboxService {
|
||||
return
|
||||
}
|
||||
|
||||
// find all sandboxs that are using the unschedulable runners and have organizationId = '00000000-0000-0000-0000-000000000000'
|
||||
const sandboxs = await this.sandboxRepository.find({
|
||||
// find all sandboxes that are using the unschedulable runners and have organizationId = '00000000-0000-0000-0000-000000000000'
|
||||
const sandboxes = await this.sandboxRepository.find({
|
||||
where: {
|
||||
runnerId: In(runners.map((runner) => runner.id)),
|
||||
organizationId: '00000000-0000-0000-0000-000000000000',
|
||||
@@ -759,17 +790,17 @@ export class SandboxService {
|
||||
},
|
||||
})
|
||||
|
||||
if (sandboxs.length === 0) {
|
||||
if (sandboxes.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
const destroyPromises = sandboxs.map((sandbox) => this.destroy(sandbox.id))
|
||||
const destroyPromises = sandboxes.map((sandbox) => this.destroy(sandbox.id))
|
||||
const results = await Promise.allSettled(destroyPromises)
|
||||
|
||||
// Log any failed sandbox destructions
|
||||
results.forEach((result, index) => {
|
||||
if (result.status === 'rejected') {
|
||||
this.logger.error(`Failed to destroy sandbox ${sandboxs[index].id}: ${result.reason}`)
|
||||
this.logger.error(`Failed to destroy sandbox ${sandboxes[index].id}: ${result.reason}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -794,6 +825,14 @@ export class SandboxService {
|
||||
})
|
||||
}
|
||||
|
||||
private resolveAutoStopInterval(autoStopInterval: number): number {
|
||||
if (autoStopInterval < 0) {
|
||||
throw new BadRequestError('Auto-stop interval must be non-negative')
|
||||
}
|
||||
|
||||
return autoStopInterval
|
||||
}
|
||||
|
||||
private resolveAutoArchiveInterval(autoArchiveInterval: number): number {
|
||||
if (autoArchiveInterval < 0) {
|
||||
throw new BadRequestError('Auto-archive interval must be non-negative')
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
DAYTONA_API_URL=http://localhost:3001/api
|
||||
DAYTONA_AUTH0_DOMAIN=http://localhost:5556/dex
|
||||
DAYTONA_AUTH0_CLIENT_ID=daytona
|
||||
DAYTONA_AUTH0_CALLBACK_PORT=3009
|
||||
DAYTONA_AUTH0_AUDIENCE=daytona
|
||||
@@ -1,6 +0,0 @@
|
||||
DAYTONA_API_URL=https://app.daytona.io/api
|
||||
DAYTONA_AUTH0_DOMAIN=
|
||||
DAYTONA_AUTH0_CLIENT_ID=
|
||||
DAYTONA_AUTH0_CLIENT_SECRET=
|
||||
DAYTONA_AUTH0_CALLBACK_PORT=
|
||||
DAYTONA_AUTH0_AUDIENCE=
|
||||
@@ -83,12 +83,13 @@ var CreateCmd = &cobra.Command{
|
||||
if diskFlag > 0 {
|
||||
createSandbox.SetDisk(diskFlag)
|
||||
}
|
||||
if autoStopFlag > 0 {
|
||||
if autoStopFlag >= 0 {
|
||||
createSandbox.SetAutoStopInterval(autoStopFlag)
|
||||
}
|
||||
if autoArchiveFlag >= 0 {
|
||||
createSandbox.SetAutoArchiveInterval(autoArchiveFlag)
|
||||
}
|
||||
createSandbox.SetAutoDeleteInterval(autoDeleteFlag)
|
||||
|
||||
if dockerfileFlag != "" {
|
||||
createBuildInfoDto, err := common.GetCreateBuildInfoDto(ctx, dockerfileFlag, contextFlag)
|
||||
@@ -198,6 +199,7 @@ var (
|
||||
diskFlag int32
|
||||
autoStopFlag int32
|
||||
autoArchiveFlag int32
|
||||
autoDeleteFlag int32
|
||||
volumesFlag []string
|
||||
dockerfileFlag string
|
||||
contextFlag []string
|
||||
@@ -215,8 +217,9 @@ func init() {
|
||||
CreateCmd.Flags().Int32Var(&gpuFlag, "gpu", 0, "GPU units allocated to the sandbox")
|
||||
CreateCmd.Flags().Int32Var(&memoryFlag, "memory", 0, "Memory allocated to the sandbox in MB")
|
||||
CreateCmd.Flags().Int32Var(&diskFlag, "disk", 0, "Disk space allocated to the sandbox in GB")
|
||||
CreateCmd.Flags().Int32Var(&autoStopFlag, "auto-stop", 0, "Auto-stop interval in minutes (0 means disabled)")
|
||||
CreateCmd.Flags().Int32Var(&autoStopFlag, "auto-stop", 15, "Auto-stop interval in minutes (0 means disabled)")
|
||||
CreateCmd.Flags().Int32Var(&autoArchiveFlag, "auto-archive", 10080, "Auto-archive interval in minutes (0 means the maximum interval will be used)")
|
||||
CreateCmd.Flags().Int32Var(&autoDeleteFlag, "auto-delete", -1, "Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)")
|
||||
CreateCmd.Flags().StringArrayVarP(&volumesFlag, "volume", "v", []string{}, "Volumes to mount (format: VOLUME_NAME:MOUNT_PATH)")
|
||||
CreateCmd.Flags().StringVarP(&dockerfileFlag, "dockerfile", "f", "", "Path to Dockerfile for Sandbox snapshot")
|
||||
CreateCmd.Flags().StringArrayVarP(&contextFlag, "context", "c", []string{}, "Files or directories to include in the build context (can be specified multiple times)")
|
||||
|
||||
@@ -10,6 +10,7 @@ daytona sandbox create [flags]
|
||||
|
||||
```
|
||||
--auto-archive int32 Auto-archive interval in minutes (0 means the maximum interval will be used) (default 10080)
|
||||
--auto-delete int32 Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) (default -1)
|
||||
--auto-stop int32 Auto-stop interval in minutes (0 means disabled)
|
||||
--class string Sandbox class type (small, medium, large)
|
||||
-c, --context stringArray Files or directories to include in the build context (can be specified multiple times)
|
||||
|
||||
@@ -33,12 +33,17 @@ if [ -n "$DAYTONA_ENV_FILE" ]; then
|
||||
fi
|
||||
elif load_env_file "${SCRIPT_DIR}/../.env.local"; then
|
||||
: # Successfully loaded CLI .env
|
||||
elif load_env_file "${SCRIPT_DIR}/../.env"; then
|
||||
: # Successfully loaded CLI .env
|
||||
elif load_env_file "${PROJECT_ROOT}/.env.local"; then
|
||||
: # Successfully loaded root .env
|
||||
elif load_env_file "${PROJECT_ROOT}/.env"; then
|
||||
: # Successfully loaded root .env
|
||||
else
|
||||
echo "Note: No .env file found, using default values"
|
||||
fi
|
||||
|
||||
|
||||
# Set default values
|
||||
: "${DAYTONA_VERSION:=v0.0.0-dev}"
|
||||
: "${GOOS:=linux}"
|
||||
|
||||
@@ -6,6 +6,10 @@ options:
|
||||
default_value: '10080'
|
||||
usage: |
|
||||
Auto-archive interval in minutes (0 means the maximum interval will be used)
|
||||
- name: auto-delete
|
||||
default_value: '-1'
|
||||
usage: |
|
||||
Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
- name: auto-stop
|
||||
default_value: '0'
|
||||
usage: Auto-stop interval in minutes (0 means disabled)
|
||||
|
||||
@@ -89,6 +89,7 @@ Note: if you are running Daytona MCP Server on Windows OS, add the following to
|
||||
- `image`: Image of the sandbox (optional)
|
||||
- `auto_stop_interval` (default: "15"): Auto-stop interval in minutes (0 means disabled)
|
||||
- `auto_archive_interval` (default: "10080"): Auto-archive interval in minutes (0 means the maximum interval will be used)
|
||||
- `auto_delete_interval` (default: "-1"): Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
|
||||
- `destroy_sandbox`: Destroy a sandbox with Daytona
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ func GetCreateSandboxTool() mcp.Tool {
|
||||
mcp.WithNumber("disk", mcp.Description("Disk space allocated to the sandbox in GB."), mcp.Min(0), mcp.Max(10)),
|
||||
mcp.WithNumber("autoStopInterval", mcp.DefaultNumber(15), mcp.Min(0), mcp.Description("Auto-stop interval in minutes (0 means disabled) for the sandbox.")),
|
||||
mcp.WithNumber("autoArchiveInterval", mcp.DefaultNumber(10080), mcp.Min(0), mcp.Description("Auto-archive interval in minutes (0 means the maximum interval will be used) for the sandbox.")),
|
||||
mcp.WithNumber("autoDeleteInterval", mcp.DefaultNumber(-1), mcp.Description("Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) for the sandbox.")),
|
||||
mcp.WithArray("volumes", mcp.Description("Volumes to attach to the sandbox."), mcp.Items(map[string]any{"type": "object", "properties": map[string]any{"volumeId": map[string]any{"type": "string"}, "mountPath": map[string]any{"type": "string"}}})),
|
||||
mcp.WithObject("buildInfo", mcp.Description("Build information for the sandbox."), mcp.Properties(map[string]any{"dockerfile_content": map[string]any{"type": "string"}, "context_hashes": map[string]any{"type": "array", "items": map[string]any{"type": "string"}}})),
|
||||
)
|
||||
|
||||
+416
-364
@@ -814,7 +814,7 @@ if __name__ == '__main__':
|
||||
}));
|
||||
|
||||
// Get the preview link for the Flask app
|
||||
const previewInfo = sandbox.getPreviewLink(3000);
|
||||
const previewInfo = await sandbox.getPreviewLink(3000);
|
||||
console.log(`Flask app is available at: ${previewInfo.url}`);
|
||||
}
|
||||
|
||||
@@ -2497,9 +2497,9 @@ All sandboxes have been deleted
|
||||
|
||||
:::
|
||||
|
||||
## Auto-stop and Auto-archive
|
||||
## Automated Lifecycle Management
|
||||
|
||||
Daytona Sandboxes can be automatically stopped and archived based on user-defined intervals.
|
||||
Daytona Sandboxes can be automatically stopped, archived, and deleted based on user-defined intervals.
|
||||
|
||||
### Auto-stop Interval
|
||||
|
||||
@@ -2552,7 +2552,48 @@ const sandbox = await daytona.create({
|
||||
});
|
||||
```
|
||||
|
||||
### Run Indefinitely
|
||||
### Auto-delete Interval
|
||||
|
||||
The auto-delete interval parameter sets the amount of time after which a continuously stopped Sandbox will be automatically deleted. By default, Sandboxes will never be automatically deleted.
|
||||
|
||||
The parameter can either be set to:
|
||||
|
||||
- a time interval in minutes
|
||||
- `-1`, which disables the auto-delete functionality
|
||||
- `0`, which means the Sandbox will be deleted immediately after stopping
|
||||
|
||||
If the parameter is not set, the Sandbox will not be deleted automatically.
|
||||
|
||||
```python
|
||||
sandbox = daytona.create(CreateSandboxFromSnapshotParams(
|
||||
snapshot="my-snapshot-name",
|
||||
auto_delete_interval=60, # Auto-delete after a Sandbox has been stopped for 1 hour
|
||||
))
|
||||
|
||||
# Delete the Sandbox immediately after it has been stopped
|
||||
|
||||
sandbox.set_auto_delete_interval(0)
|
||||
|
||||
# Disable auto-deletion
|
||||
|
||||
sandbox.set_auto_delete_interval(-1)
|
||||
|
||||
```
|
||||
```typescript
|
||||
const sandbox = await daytona.create({
|
||||
snapshot: "my-snapshot-name",
|
||||
autoDeleteInterval: 60, // Auto-delete after a Sandbox has been stopped for 1 hour
|
||||
});
|
||||
|
||||
// Delete the Sandbox immediately after it has been stopped
|
||||
await sandbox.setAutoDeleteInterval(0)
|
||||
|
||||
// Disable auto-deletion
|
||||
await sandbox.setAutoDeleteInterval(-1)
|
||||
```
|
||||
|
||||
|
||||
## Run Indefinitely
|
||||
|
||||
By default, Sandboxes auto-stop after 15 minutes of inactivity. To keep a Sandbox running without interruption, set the auto-stop interval to `0` when creating a new Sandbox:
|
||||
|
||||
@@ -2829,472 +2870,483 @@ description: A reference of supported operations using the Daytona CLI.
|
||||
sidebar:
|
||||
label: Daytona CLI Reference
|
||||
|
||||
|
||||
The `daytona` command-line tool provides access to Daytona's core features including managing Snapshots and the lifecycle of Daytona Sandboxes. View the installation instructions by clicking [here](/docs/getting-started#setting-up-the-daytona-cli).
|
||||
|
||||
This reference lists all commands supported by the `daytona` command-line tool complete with a description of their behaviour, and any supported flags.
|
||||
You can access this documentation on a per-command basis by appending the `--help`/`-h` flag when invoking `daytona`.
|
||||
|
||||
## daytona version
|
||||
Print the version number
|
||||
|
||||
```shell
|
||||
daytona version [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox info
|
||||
Get sandbox info
|
||||
|
||||
```shell
|
||||
daytona sandbox info [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--verbose` | `-v` | Include verbose output |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox list
|
||||
List sandboxes
|
||||
|
||||
```shell
|
||||
daytona sandbox list [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--limit` | `-l` | Maximum number of items per page |
|
||||
| `--page` | `-p` | Page number for pagination (starting from 1) |
|
||||
| `--verbose` | `-v` | Include verbose output |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox start
|
||||
Start a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox start [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Start all sandboxes |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox stop
|
||||
Stop a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox stop [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Stop all sandboxes |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox
|
||||
Manage Daytona sandboxes
|
||||
|
||||
```shell
|
||||
daytona sandbox [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox create
|
||||
Create a new sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox create [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--auto-archive` | | Auto-archive interval in minutes (0 means the maximum interval will be used) |
|
||||
| `--auto-stop` | | Auto-stop interval in minutes (0 means disabled) |
|
||||
| `--class` | | Sandbox class type (small, medium, large) |
|
||||
| `--context` | `-c` | Files or directories to include in the build context (can be specified multiple times) |
|
||||
| `--cpu` | | CPU cores allocated to the sandbox |
|
||||
| `--disk` | | Disk space allocated to the sandbox in GB |
|
||||
| `--dockerfile` | `-f` | Path to Dockerfile for Sandbox snapshot |
|
||||
| `--env` | `-e` | Environment variables (format: KEY=VALUE) |
|
||||
| `--gpu` | | GPU units allocated to the sandbox |
|
||||
| `--label` | `-l` | Labels (format: KEY=VALUE) |
|
||||
| `--memory` | | Memory allocated to the sandbox in MB |
|
||||
| `--public` | | Make sandbox publicly accessible |
|
||||
| `--snapshot` | | Snapshot to use for the sandbox |
|
||||
| `--target` | | Target region (eu, us) |
|
||||
| `--user` | | User associated with the sandbox |
|
||||
| `--volume` | `-v` | Volumes to mount (format: VOLUME_NAME:MOUNT_PATH) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox delete
|
||||
Delete a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox delete [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Delete all sandboxes |
|
||||
| `--force` | `-f` | Force delete |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona snapshot push
|
||||
Push local snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot push [SNAPSHOT] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--entrypoint` | `-e` | The entrypoint command for the image |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona login
|
||||
Log in to Daytona
|
||||
|
||||
```shell
|
||||
daytona login [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--api-key` | | API key to use for authentication |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona logout
|
||||
Logout from Daytona
|
||||
|
||||
```shell
|
||||
daytona logout [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona snapshot
|
||||
Manage Daytona snapshots
|
||||
|
||||
```shell
|
||||
daytona snapshot [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona snapshot create
|
||||
Create a snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot create [SNAPSHOT] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--context` | `-c` | Files or directories to include in the build context (can be specified multiple times) |
|
||||
| `--dockerfile` | `-f` | Path to Dockerfile to build |
|
||||
| `--entrypoint` | `-e` | The entrypoint command for the snapshot |
|
||||
| `--image` | `-i` | The image name for the snapshot |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona snapshot delete
|
||||
Delete a snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot delete [SNAPSHOT_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Delete all snapshots |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona snapshot list
|
||||
List all snapshots
|
||||
|
||||
```shell
|
||||
daytona snapshot list [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--limit` | `-l` | Maximum number of items per page |
|
||||
| `--page` | `-p` | Page number for pagination (starting from 1) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona
|
||||
|
||||
Daytona CLI
|
||||
|
||||
```shell
|
||||
daytona [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--help` | | help for daytona |
|
||||
| `--version` | `-v` | Display the version of Daytona |
|
||||
|
||||
|
||||
## daytona autocomplete
|
||||
|
||||
Adds a completion script for your shell environment
|
||||
|
||||
```shell
|
||||
daytona autocomplete [bash|zsh|fish|powershell] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
<Aside type="note">
|
||||
If using bash shell environment, make sure you have bash-completion installed in order to get full autocompletion functionality.
|
||||
Linux Installation: ```sudo apt-get install bash-completion```
|
||||
macOS Installation: ```brew install bash-completion```
|
||||
If using bash shell environment, make sure you have bash-completion installed
|
||||
in order to get full autocompletion functionality. Linux Installation: ```sudo
|
||||
apt-get install bash-completion``` macOS Installation: ```brew install
|
||||
bash-completion```
|
||||
</Aside>
|
||||
|
||||
## daytona docs
|
||||
|
||||
Opens the Daytona documentation in your default browser.
|
||||
|
||||
```shell
|
||||
daytona docs [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona login
|
||||
|
||||
## daytona organization
|
||||
Manage Daytona organizations
|
||||
Log in to Daytona
|
||||
|
||||
```shell
|
||||
daytona organization [flags]
|
||||
daytona login [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--api-key` | | API key to use for authentication |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona logout
|
||||
|
||||
## daytona organization create
|
||||
Create a new organization and set it as active
|
||||
Logout from Daytona
|
||||
|
||||
```shell
|
||||
daytona organization create [ORGANIZATION_NAME] [flags]
|
||||
daytona logout [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona organization delete
|
||||
Delete an organization
|
||||
|
||||
```shell
|
||||
daytona organization delete [ORGANIZATION] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona organization list
|
||||
List all organizations
|
||||
|
||||
```shell
|
||||
daytona organization list [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona organization use
|
||||
Set active organization
|
||||
|
||||
```shell
|
||||
daytona organization use [ORGANIZATION] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona mcp
|
||||
|
||||
Manage Daytona MCP Server
|
||||
|
||||
```shell
|
||||
daytona mcp [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona mcp init
|
||||
Initialize Daytona MCP Server with an agent (currently supported: claude, windsurf, cursor)
|
||||
|
||||
|
||||
```shell
|
||||
daytona mcp init [AGENT_NAME] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona mcp start
|
||||
Start Daytona MCP Server
|
||||
|
||||
```shell
|
||||
daytona mcp start [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona mcp config
|
||||
|
||||
Outputs JSON configuration for Daytona MCP Server
|
||||
|
||||
```shell
|
||||
daytona mcp config [AGENT_NAME] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona mcp init
|
||||
|
||||
Initialize Daytona MCP Server with an agent (currently supported: claude, windsurf, cursor)
|
||||
|
||||
```shell
|
||||
daytona mcp init [AGENT_NAME] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona mcp start
|
||||
|
||||
Start Daytona MCP Server
|
||||
|
||||
```shell
|
||||
daytona mcp start [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona organization
|
||||
|
||||
Manage Daytona organizations
|
||||
|
||||
```shell
|
||||
daytona organization [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona organization create
|
||||
|
||||
Create a new organization and set it as active
|
||||
|
||||
```shell
|
||||
daytona organization create [ORGANIZATION_NAME] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona organization delete
|
||||
|
||||
Delete an organization
|
||||
|
||||
```shell
|
||||
daytona organization delete [ORGANIZATION] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona organization list
|
||||
|
||||
List all organizations
|
||||
|
||||
```shell
|
||||
daytona organization list [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona organization use
|
||||
|
||||
Set active organization
|
||||
|
||||
```shell
|
||||
daytona organization use [ORGANIZATION] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox
|
||||
|
||||
Manage Daytona sandboxes
|
||||
|
||||
```shell
|
||||
daytona sandbox [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox create
|
||||
|
||||
Create a new sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox create [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--auto-archive` | | Auto-archive interval in minutes (0 means the maximum interval will be used) |
|
||||
| `--auto-delete` | | Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) |
|
||||
| `--auto-stop` | | Auto-stop interval in minutes (0 means disabled) |
|
||||
| `--class` | | Sandbox class type (small, medium, large) |
|
||||
| `--context` | `-c` | Files or directories to include in the build context (can be specified multiple times) |
|
||||
| `--cpu` | | CPU cores allocated to the sandbox |
|
||||
| `--disk` | | Disk space allocated to the sandbox in GB |
|
||||
| `--dockerfile` | `-f` | Path to Dockerfile for Sandbox snapshot |
|
||||
| `--env` | `-e` | Environment variables (format: KEY=VALUE) |
|
||||
| `--gpu` | | GPU units allocated to the sandbox |
|
||||
| `--label` | `-l` | Labels (format: KEY=VALUE) |
|
||||
| `--memory` | | Memory allocated to the sandbox in MB |
|
||||
| `--public` | | Make sandbox publicly accessible |
|
||||
| `--snapshot` | | Snapshot to use for the sandbox |
|
||||
| `--target` | | Target region (eu, us) |
|
||||
| `--user` | | User associated with the sandbox |
|
||||
| `--volume` | `-v` | Volumes to mount (format: VOLUME_NAME:MOUNT_PATH) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox delete
|
||||
|
||||
Delete a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox delete [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Delete all sandboxes |
|
||||
| `--force` | `-f` | Force delete |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox info
|
||||
|
||||
Get sandbox info
|
||||
|
||||
```shell
|
||||
daytona sandbox info [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--verbose` | `-v` | Include verbose output |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox list
|
||||
|
||||
List sandboxes
|
||||
|
||||
```shell
|
||||
daytona sandbox list [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--limit` | `-l` | Maximum number of items per page |
|
||||
| `--page` | `-p` | Page number for pagination (starting from 1) |
|
||||
| `--verbose` | `-v` | Include verbose output |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox start
|
||||
|
||||
Start a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox start [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Start all sandboxes |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox stop
|
||||
|
||||
Stop a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox stop [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Stop all sandboxes |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona snapshot
|
||||
|
||||
Manage Daytona snapshots
|
||||
|
||||
```shell
|
||||
daytona snapshot [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona snapshot create
|
||||
|
||||
Create a snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot create [SNAPSHOT] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--context` | `-c` | Files or directories to include in the build context (can be specified multiple times) |
|
||||
| `--cpu` | | CPU cores that will be allocated to the underlying sandboxes (default: 1) |
|
||||
| `--disk` | | Disk space that will be allocated to the underlying sandboxes in GB (default: 3) |
|
||||
| `--dockerfile` | `-f` | Path to Dockerfile to build |
|
||||
| `--entrypoint` | `-e` | The entrypoint command for the snapshot |
|
||||
| `--image` | `-i` | The image name for the snapshot |
|
||||
| `--memory` | | Memory that will be allocated to the underlying sandboxes in GB (default: 1) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona snapshot delete
|
||||
|
||||
Delete a snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot delete [SNAPSHOT_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Delete all snapshots |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona snapshot list
|
||||
|
||||
List all snapshots
|
||||
|
||||
```shell
|
||||
daytona snapshot list [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--limit` | `-l` | Maximum number of items per page |
|
||||
| `--page` | `-p` | Page number for pagination (starting from 1) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona snapshot push
|
||||
|
||||
Push local snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot push [SNAPSHOT] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--cpu` | | CPU cores that will be allocated to the underlying sandboxes (default: 1) |
|
||||
| `--disk` | | Disk space that will be allocated to the underlying sandboxes in GB (default: 3) |
|
||||
| `--entrypoint` | `-e` | The entrypoint command for the image |
|
||||
| `--memory` | | Memory that will be allocated to the underlying sandboxes in GB (default: 1) |
|
||||
| `--name` | `-n` | Specify the Snapshot name |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona version
|
||||
|
||||
Print the version number
|
||||
|
||||
```shell
|
||||
daytona version [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona volume
|
||||
|
||||
Manage Daytona volumes
|
||||
|
||||
```shell
|
||||
daytona volume [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona volume list
|
||||
List all volumes
|
||||
|
||||
```shell
|
||||
daytona volume list [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona volume create
|
||||
|
||||
Create a volume
|
||||
|
||||
```shell
|
||||
daytona volume create [NAME] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--size` | `-s` | Size of the volume in GB |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona volume get
|
||||
Get volume details
|
||||
|
||||
```shell
|
||||
daytona volume get [VOLUME_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona volume delete
|
||||
|
||||
Delete a volume
|
||||
|
||||
```shell
|
||||
daytona volume delete [VOLUME_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona volume get
|
||||
|
||||
Get volume details
|
||||
|
||||
```shell
|
||||
daytona volume get [VOLUME_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona volume list
|
||||
|
||||
List all volumes
|
||||
|
||||
```shell
|
||||
daytona volume list [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
title: Volumes
|
||||
|
||||
|
||||
+24
-23
@@ -1,5 +1,5 @@
|
||||
# Daytona Documentation v0.0.0-dev
|
||||
# Generated on: 2025-07-07
|
||||
# Generated on: 2025-07-11
|
||||
|
||||
# Daytona
|
||||
|
||||
@@ -121,9 +121,10 @@
|
||||
- [Stop and Start Sandbox](https://daytona.io/docs/sandbox-management#stop-and-start-sandbox)
|
||||
- [Archive Sandbox](https://daytona.io/docs/sandbox-management#archive-sandbox)
|
||||
- [Delete Sandbox](https://daytona.io/docs/sandbox-management#delete-sandbox)
|
||||
- [Auto-stop and Auto-archive](https://daytona.io/docs/sandbox-management#auto-stop-and-auto-archive)
|
||||
- [Automated Lifecycle Management](https://daytona.io/docs/sandbox-management#automated-lifecycle-management)
|
||||
- [Auto-stop Interval](https://daytona.io/docs/sandbox-management#auto-stop-interval)
|
||||
- [Auto-archive Interval](https://daytona.io/docs/sandbox-management#auto-archive-interval)
|
||||
- [Auto-delete Interval](https://daytona.io/docs/sandbox-management#auto-delete-interval)
|
||||
- [Run Indefinitely](https://daytona.io/docs/sandbox-management#run-indefinitely)
|
||||
- [Snapshots](https://daytona.io/docs/snapshots)
|
||||
- [Creating Snapshots](https://daytona.io/docs/snapshots#creating-snapshots)
|
||||
@@ -133,38 +134,38 @@
|
||||
- [Deleting Snapshots](https://daytona.io/docs/snapshots#deleting-snapshots)
|
||||
- [Default Snapshot](https://daytona.io/docs/snapshots#default-snapshot)
|
||||
- [CLI](https://daytona.io/docs/tools/cli)
|
||||
- [daytona version](https://daytona.io/docs/tools/cli#daytona-version)
|
||||
- [daytona sandbox info](https://daytona.io/docs/tools/cli#daytona-sandbox-info)
|
||||
- [daytona sandbox list](https://daytona.io/docs/tools/cli#daytona-sandbox-list)
|
||||
- [daytona sandbox start](https://daytona.io/docs/tools/cli#daytona-sandbox-start)
|
||||
- [daytona sandbox stop](https://daytona.io/docs/tools/cli#daytona-sandbox-stop)
|
||||
- [daytona sandbox](https://daytona.io/docs/tools/cli#daytona-sandbox)
|
||||
- [daytona sandbox create](https://daytona.io/docs/tools/cli#daytona-sandbox-create)
|
||||
- [daytona sandbox delete](https://daytona.io/docs/tools/cli#daytona-sandbox-delete)
|
||||
- [daytona snapshot push](https://daytona.io/docs/tools/cli#daytona-snapshot-push)
|
||||
- [daytona login](https://daytona.io/docs/tools/cli#daytona-login)
|
||||
- [daytona logout](https://daytona.io/docs/tools/cli#daytona-logout)
|
||||
- [daytona snapshot](https://daytona.io/docs/tools/cli#daytona-snapshot)
|
||||
- [daytona snapshot create](https://daytona.io/docs/tools/cli#daytona-snapshot-create)
|
||||
- [daytona snapshot delete](https://daytona.io/docs/tools/cli#daytona-snapshot-delete)
|
||||
- [daytona snapshot list](https://daytona.io/docs/tools/cli#daytona-snapshot-list)
|
||||
- [daytona](https://daytona.io/docs/tools/cli#daytona)
|
||||
- [daytona autocomplete](https://daytona.io/docs/tools/cli#daytona-autocomplete)
|
||||
- [daytona docs](https://daytona.io/docs/tools/cli#daytona-docs)
|
||||
- [daytona login](https://daytona.io/docs/tools/cli#daytona-login)
|
||||
- [daytona logout](https://daytona.io/docs/tools/cli#daytona-logout)
|
||||
- [daytona mcp](https://daytona.io/docs/tools/cli#daytona-mcp)
|
||||
- [daytona mcp config](https://daytona.io/docs/tools/cli#daytona-mcp-config)
|
||||
- [daytona mcp init](https://daytona.io/docs/tools/cli#daytona-mcp-init)
|
||||
- [daytona mcp start](https://daytona.io/docs/tools/cli#daytona-mcp-start)
|
||||
- [daytona organization](https://daytona.io/docs/tools/cli#daytona-organization)
|
||||
- [daytona organization create](https://daytona.io/docs/tools/cli#daytona-organization-create)
|
||||
- [daytona organization delete](https://daytona.io/docs/tools/cli#daytona-organization-delete)
|
||||
- [daytona organization list](https://daytona.io/docs/tools/cli#daytona-organization-list)
|
||||
- [daytona organization use](https://daytona.io/docs/tools/cli#daytona-organization-use)
|
||||
- [daytona mcp](https://daytona.io/docs/tools/cli#daytona-mcp)
|
||||
- [daytona mcp init](https://daytona.io/docs/tools/cli#daytona-mcp-init)
|
||||
- [daytona mcp start](https://daytona.io/docs/tools/cli#daytona-mcp-start)
|
||||
- [daytona mcp config](https://daytona.io/docs/tools/cli#daytona-mcp-config)
|
||||
- [daytona sandbox](https://daytona.io/docs/tools/cli#daytona-sandbox)
|
||||
- [daytona sandbox create](https://daytona.io/docs/tools/cli#daytona-sandbox-create)
|
||||
- [daytona sandbox delete](https://daytona.io/docs/tools/cli#daytona-sandbox-delete)
|
||||
- [daytona sandbox info](https://daytona.io/docs/tools/cli#daytona-sandbox-info)
|
||||
- [daytona sandbox list](https://daytona.io/docs/tools/cli#daytona-sandbox-list)
|
||||
- [daytona sandbox start](https://daytona.io/docs/tools/cli#daytona-sandbox-start)
|
||||
- [daytona sandbox stop](https://daytona.io/docs/tools/cli#daytona-sandbox-stop)
|
||||
- [daytona snapshot](https://daytona.io/docs/tools/cli#daytona-snapshot)
|
||||
- [daytona snapshot create](https://daytona.io/docs/tools/cli#daytona-snapshot-create)
|
||||
- [daytona snapshot delete](https://daytona.io/docs/tools/cli#daytona-snapshot-delete)
|
||||
- [daytona snapshot list](https://daytona.io/docs/tools/cli#daytona-snapshot-list)
|
||||
- [daytona snapshot push](https://daytona.io/docs/tools/cli#daytona-snapshot-push)
|
||||
- [daytona version](https://daytona.io/docs/tools/cli#daytona-version)
|
||||
- [daytona volume](https://daytona.io/docs/tools/cli#daytona-volume)
|
||||
- [daytona volume list](https://daytona.io/docs/tools/cli#daytona-volume-list)
|
||||
- [daytona volume create](https://daytona.io/docs/tools/cli#daytona-volume-create)
|
||||
- [daytona volume get](https://daytona.io/docs/tools/cli#daytona-volume-get)
|
||||
- [daytona volume delete](https://daytona.io/docs/tools/cli#daytona-volume-delete)
|
||||
- [daytona volume get](https://daytona.io/docs/tools/cli#daytona-volume-get)
|
||||
- [daytona volume list](https://daytona.io/docs/tools/cli#daytona-volume-list)
|
||||
- [Volumes](https://daytona.io/docs/volumes)
|
||||
- [Creating Volumes](https://daytona.io/docs/volumes#creating-volumes)
|
||||
- [Mounting Volumes to Sandboxes](https://daytona.io/docs/volumes#mounting-volumes-to-sandboxes)
|
||||
|
||||
+242
-218
@@ -1424,11 +1424,11 @@
|
||||
"objectID": 178
|
||||
},
|
||||
{
|
||||
"title": "Auto-stop and Auto-archive",
|
||||
"description": "Daytona Sandboxes can be automatically stopped and archived based on user-defined intervals.",
|
||||
"title": "Automated Lifecycle Management",
|
||||
"description": "Daytona Sandboxes can be automatically stopped, archived, and deleted based on user-defined intervals.",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/sandbox-management#auto-stop-and-auto-archive",
|
||||
"slug": "/sandbox-management#auto-stop-and-auto-archive",
|
||||
"url": "/docs/sandbox-management#automated-lifecycle-management",
|
||||
"slug": "/sandbox-management#automated-lifecycle-management",
|
||||
"objectID": 179
|
||||
},
|
||||
{
|
||||
@@ -1447,13 +1447,37 @@
|
||||
"slug": "/sandbox-management#auto-archive-interval",
|
||||
"objectID": 181
|
||||
},
|
||||
{
|
||||
"title": "Auto-delete Interval",
|
||||
"description": "The auto-delete interval parameter sets the amount of time after which a continuously stopped Sandbox will be automatically deleted.",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/sandbox-management#auto-delete-interval",
|
||||
"slug": "/sandbox-management#auto-delete-interval",
|
||||
"objectID": 182
|
||||
},
|
||||
{
|
||||
"title": "Delete the Sandbox immediately after it has been stopped",
|
||||
"description": "",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/sandbox-management#delete-the-sandbox-immediately-after-it-has-been-stopped",
|
||||
"slug": "/sandbox-management#delete-the-sandbox-immediately-after-it-has-been-stopped",
|
||||
"objectID": 183
|
||||
},
|
||||
{
|
||||
"title": "Disable auto-deletion",
|
||||
"description": "",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/sandbox-management#disable-auto-deletion",
|
||||
"slug": "/sandbox-management#disable-auto-deletion",
|
||||
"objectID": 184
|
||||
},
|
||||
{
|
||||
"title": "Run Indefinitely",
|
||||
"description": "By default, Sandboxes auto-stop after 15 minutes of inactivity.",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/sandbox-management#run-indefinitely",
|
||||
"slug": "/sandbox-management#run-indefinitely",
|
||||
"objectID": 182
|
||||
"objectID": 185
|
||||
},
|
||||
{
|
||||
"title": "Snapshots",
|
||||
@@ -1461,7 +1485,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/snapshots",
|
||||
"slug": "/snapshots",
|
||||
"objectID": 183
|
||||
"objectID": 186
|
||||
},
|
||||
{
|
||||
"title": "Creating Snapshots",
|
||||
@@ -1469,7 +1493,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/snapshots#creating-snapshots",
|
||||
"slug": "/snapshots#creating-snapshots",
|
||||
"objectID": 184
|
||||
"objectID": 187
|
||||
},
|
||||
{
|
||||
"title": "Snapshot Resources",
|
||||
@@ -1477,7 +1501,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/snapshots#snapshot-resources",
|
||||
"slug": "/snapshots#snapshot-resources",
|
||||
"objectID": 185
|
||||
"objectID": 188
|
||||
},
|
||||
{
|
||||
"title": "Create a Snapshot with custom resources",
|
||||
@@ -1485,7 +1509,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/snapshots#create-a-snapshot-with-custom-resources",
|
||||
"slug": "/snapshots#create-a-snapshot-with-custom-resources",
|
||||
"objectID": 186
|
||||
"objectID": 189
|
||||
},
|
||||
{
|
||||
"title": "Create a Sandbox with custom Snapshot",
|
||||
@@ -1493,7 +1517,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/snapshots#create-a-sandbox-with-custom-snapshot",
|
||||
"slug": "/snapshots#create-a-sandbox-with-custom-snapshot",
|
||||
"objectID": 187
|
||||
"objectID": 190
|
||||
},
|
||||
{
|
||||
"title": "Images from Private Registries",
|
||||
@@ -1501,7 +1525,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/snapshots#images-from-private-registries",
|
||||
"slug": "/snapshots#images-from-private-registries",
|
||||
"objectID": 188
|
||||
"objectID": 191
|
||||
},
|
||||
{
|
||||
"title": "Using a Local Image",
|
||||
@@ -1509,7 +1533,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/snapshots#using-a-local-image",
|
||||
"slug": "/snapshots#using-a-local-image",
|
||||
"objectID": 189
|
||||
"objectID": 192
|
||||
},
|
||||
{
|
||||
"title": "Deleting Snapshots",
|
||||
@@ -1517,7 +1541,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/snapshots#deleting-snapshots",
|
||||
"slug": "/snapshots#deleting-snapshots",
|
||||
"objectID": 190
|
||||
"objectID": 193
|
||||
},
|
||||
{
|
||||
"title": "Default Snapshot",
|
||||
@@ -1525,7 +1549,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/snapshots#default-snapshot",
|
||||
"slug": "/snapshots#default-snapshot",
|
||||
"objectID": 191
|
||||
"objectID": 194
|
||||
},
|
||||
{
|
||||
"title": "CLI",
|
||||
@@ -1533,135 +1557,15 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli",
|
||||
"slug": "/tools/cli",
|
||||
"objectID": 192
|
||||
},
|
||||
{
|
||||
"title": "daytona version",
|
||||
"description": "Print the version number",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-version",
|
||||
"slug": "/tools/cli#daytona-version",
|
||||
"objectID": 193
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox info",
|
||||
"description": "Get sandbox info",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-info",
|
||||
"slug": "/tools/cli#daytona-sandbox-info",
|
||||
"objectID": 194
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox list",
|
||||
"description": "List sandboxes",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-list",
|
||||
"slug": "/tools/cli#daytona-sandbox-list",
|
||||
"objectID": 195
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox start",
|
||||
"description": "Start a sandbox",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-start",
|
||||
"slug": "/tools/cli#daytona-sandbox-start",
|
||||
"objectID": 196
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox stop",
|
||||
"description": "Stop a sandbox",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-stop",
|
||||
"slug": "/tools/cli#daytona-sandbox-stop",
|
||||
"objectID": 197
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox",
|
||||
"description": "Manage Daytona sandboxes",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox",
|
||||
"slug": "/tools/cli#daytona-sandbox",
|
||||
"objectID": 198
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox create",
|
||||
"description": "Create a new sandbox",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-create",
|
||||
"slug": "/tools/cli#daytona-sandbox-create",
|
||||
"objectID": 199
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox delete",
|
||||
"description": "Delete a sandbox",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-delete",
|
||||
"slug": "/tools/cli#daytona-sandbox-delete",
|
||||
"objectID": 200
|
||||
},
|
||||
{
|
||||
"title": "daytona snapshot push",
|
||||
"description": "Push local snapshot",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-snapshot-push",
|
||||
"slug": "/tools/cli#daytona-snapshot-push",
|
||||
"objectID": 201
|
||||
},
|
||||
{
|
||||
"title": "daytona login",
|
||||
"description": "Log in to Daytona",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-login",
|
||||
"slug": "/tools/cli#daytona-login",
|
||||
"objectID": 202
|
||||
},
|
||||
{
|
||||
"title": "daytona logout",
|
||||
"description": "Logout from Daytona",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-logout",
|
||||
"slug": "/tools/cli#daytona-logout",
|
||||
"objectID": 203
|
||||
},
|
||||
{
|
||||
"title": "daytona snapshot",
|
||||
"description": "Manage Daytona snapshots",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-snapshot",
|
||||
"slug": "/tools/cli#daytona-snapshot",
|
||||
"objectID": 204
|
||||
},
|
||||
{
|
||||
"title": "daytona snapshot create",
|
||||
"description": "Create a snapshot",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-snapshot-create",
|
||||
"slug": "/tools/cli#daytona-snapshot-create",
|
||||
"objectID": 205
|
||||
},
|
||||
{
|
||||
"title": "daytona snapshot delete",
|
||||
"description": "Delete a snapshot",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-snapshot-delete",
|
||||
"slug": "/tools/cli#daytona-snapshot-delete",
|
||||
"objectID": 206
|
||||
},
|
||||
{
|
||||
"title": "daytona snapshot list",
|
||||
"description": "List all snapshots",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-snapshot-list",
|
||||
"slug": "/tools/cli#daytona-snapshot-list",
|
||||
"objectID": 207
|
||||
},
|
||||
{
|
||||
"title": "daytona",
|
||||
"description": "Daytona CLI",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona",
|
||||
"slug": "/tools/cli#daytona",
|
||||
"objectID": 208
|
||||
"objectID": 196
|
||||
},
|
||||
{
|
||||
"title": "daytona autocomplete",
|
||||
@@ -1669,7 +1573,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-autocomplete",
|
||||
"slug": "/tools/cli#daytona-autocomplete",
|
||||
"objectID": 209
|
||||
"objectID": 197
|
||||
},
|
||||
{
|
||||
"title": "daytona docs",
|
||||
@@ -1677,47 +1581,23 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-docs",
|
||||
"slug": "/tools/cli#daytona-docs",
|
||||
"objectID": 210
|
||||
"objectID": 198
|
||||
},
|
||||
{
|
||||
"title": "daytona organization",
|
||||
"description": "Manage Daytona organizations",
|
||||
"title": "daytona login",
|
||||
"description": "Log in to Daytona",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-organization",
|
||||
"slug": "/tools/cli#daytona-organization",
|
||||
"objectID": 211
|
||||
"url": "/docs/tools/cli#daytona-login",
|
||||
"slug": "/tools/cli#daytona-login",
|
||||
"objectID": 199
|
||||
},
|
||||
{
|
||||
"title": "daytona organization create",
|
||||
"description": "Create a new organization and set it as active",
|
||||
"title": "daytona logout",
|
||||
"description": "Logout from Daytona",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-organization-create",
|
||||
"slug": "/tools/cli#daytona-organization-create",
|
||||
"objectID": 212
|
||||
},
|
||||
{
|
||||
"title": "daytona organization delete",
|
||||
"description": "Delete an organization",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-organization-delete",
|
||||
"slug": "/tools/cli#daytona-organization-delete",
|
||||
"objectID": 213
|
||||
},
|
||||
{
|
||||
"title": "daytona organization list",
|
||||
"description": "List all organizations",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-organization-list",
|
||||
"slug": "/tools/cli#daytona-organization-list",
|
||||
"objectID": 214
|
||||
},
|
||||
{
|
||||
"title": "daytona organization use",
|
||||
"description": "Set active organization",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-organization-use",
|
||||
"slug": "/tools/cli#daytona-organization-use",
|
||||
"objectID": 215
|
||||
"url": "/docs/tools/cli#daytona-logout",
|
||||
"slug": "/tools/cli#daytona-logout",
|
||||
"objectID": 200
|
||||
},
|
||||
{
|
||||
"title": "daytona mcp",
|
||||
@@ -1725,23 +1605,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-mcp",
|
||||
"slug": "/tools/cli#daytona-mcp",
|
||||
"objectID": 216
|
||||
},
|
||||
{
|
||||
"title": "daytona mcp init",
|
||||
"description": "Initialize Daytona MCP Server with an agent (currently supported: claude, windsurf, cursor)",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-mcp-init",
|
||||
"slug": "/tools/cli#daytona-mcp-init",
|
||||
"objectID": 217
|
||||
},
|
||||
{
|
||||
"title": "daytona mcp start",
|
||||
"description": "Start Daytona MCP Server",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-mcp-start",
|
||||
"slug": "/tools/cli#daytona-mcp-start",
|
||||
"objectID": 218
|
||||
"objectID": 201
|
||||
},
|
||||
{
|
||||
"title": "daytona mcp config",
|
||||
@@ -1749,23 +1613,175 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-mcp-config",
|
||||
"slug": "/tools/cli#daytona-mcp-config",
|
||||
"objectID": 202
|
||||
},
|
||||
{
|
||||
"title": "daytona mcp init",
|
||||
"description": "Initialize Daytona MCP Server with an agent (currently supported: claude, windsurf, cursor)",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-mcp-init",
|
||||
"slug": "/tools/cli#daytona-mcp-init",
|
||||
"objectID": 203
|
||||
},
|
||||
{
|
||||
"title": "daytona mcp start",
|
||||
"description": "Start Daytona MCP Server",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-mcp-start",
|
||||
"slug": "/tools/cli#daytona-mcp-start",
|
||||
"objectID": 204
|
||||
},
|
||||
{
|
||||
"title": "daytona organization",
|
||||
"description": "Manage Daytona organizations",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-organization",
|
||||
"slug": "/tools/cli#daytona-organization",
|
||||
"objectID": 205
|
||||
},
|
||||
{
|
||||
"title": "daytona organization create",
|
||||
"description": "Create a new organization and set it as active",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-organization-create",
|
||||
"slug": "/tools/cli#daytona-organization-create",
|
||||
"objectID": 206
|
||||
},
|
||||
{
|
||||
"title": "daytona organization delete",
|
||||
"description": "Delete an organization",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-organization-delete",
|
||||
"slug": "/tools/cli#daytona-organization-delete",
|
||||
"objectID": 207
|
||||
},
|
||||
{
|
||||
"title": "daytona organization list",
|
||||
"description": "List all organizations",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-organization-list",
|
||||
"slug": "/tools/cli#daytona-organization-list",
|
||||
"objectID": 208
|
||||
},
|
||||
{
|
||||
"title": "daytona organization use",
|
||||
"description": "Set active organization",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-organization-use",
|
||||
"slug": "/tools/cli#daytona-organization-use",
|
||||
"objectID": 209
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox",
|
||||
"description": "Manage Daytona sandboxes",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox",
|
||||
"slug": "/tools/cli#daytona-sandbox",
|
||||
"objectID": 210
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox create",
|
||||
"description": "Create a new sandbox",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-create",
|
||||
"slug": "/tools/cli#daytona-sandbox-create",
|
||||
"objectID": 211
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox delete",
|
||||
"description": "Delete a sandbox",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-delete",
|
||||
"slug": "/tools/cli#daytona-sandbox-delete",
|
||||
"objectID": 212
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox info",
|
||||
"description": "Get sandbox info",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-info",
|
||||
"slug": "/tools/cli#daytona-sandbox-info",
|
||||
"objectID": 213
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox list",
|
||||
"description": "List sandboxes",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-list",
|
||||
"slug": "/tools/cli#daytona-sandbox-list",
|
||||
"objectID": 214
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox start",
|
||||
"description": "Start a sandbox",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-start",
|
||||
"slug": "/tools/cli#daytona-sandbox-start",
|
||||
"objectID": 215
|
||||
},
|
||||
{
|
||||
"title": "daytona sandbox stop",
|
||||
"description": "Stop a sandbox",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-sandbox-stop",
|
||||
"slug": "/tools/cli#daytona-sandbox-stop",
|
||||
"objectID": 216
|
||||
},
|
||||
{
|
||||
"title": "daytona snapshot",
|
||||
"description": "Manage Daytona snapshots",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-snapshot",
|
||||
"slug": "/tools/cli#daytona-snapshot",
|
||||
"objectID": 217
|
||||
},
|
||||
{
|
||||
"title": "daytona snapshot create",
|
||||
"description": "Create a snapshot",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-snapshot-create",
|
||||
"slug": "/tools/cli#daytona-snapshot-create",
|
||||
"objectID": 218
|
||||
},
|
||||
{
|
||||
"title": "daytona snapshot delete",
|
||||
"description": "Delete a snapshot",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-snapshot-delete",
|
||||
"slug": "/tools/cli#daytona-snapshot-delete",
|
||||
"objectID": 219
|
||||
},
|
||||
{
|
||||
"title": "daytona snapshot list",
|
||||
"description": "List all snapshots",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-snapshot-list",
|
||||
"slug": "/tools/cli#daytona-snapshot-list",
|
||||
"objectID": 220
|
||||
},
|
||||
{
|
||||
"title": "daytona snapshot push",
|
||||
"description": "Push local snapshot",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-snapshot-push",
|
||||
"slug": "/tools/cli#daytona-snapshot-push",
|
||||
"objectID": 221
|
||||
},
|
||||
{
|
||||
"title": "daytona version",
|
||||
"description": "Print the version number",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-version",
|
||||
"slug": "/tools/cli#daytona-version",
|
||||
"objectID": 222
|
||||
},
|
||||
{
|
||||
"title": "daytona volume",
|
||||
"description": "Manage Daytona volumes",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-volume",
|
||||
"slug": "/tools/cli#daytona-volume",
|
||||
"objectID": 220
|
||||
},
|
||||
{
|
||||
"title": "daytona volume list",
|
||||
"description": "List all volumes",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-volume-list",
|
||||
"slug": "/tools/cli#daytona-volume-list",
|
||||
"objectID": 221
|
||||
"objectID": 223
|
||||
},
|
||||
{
|
||||
"title": "daytona volume create",
|
||||
@@ -1773,15 +1789,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-volume-create",
|
||||
"slug": "/tools/cli#daytona-volume-create",
|
||||
"objectID": 222
|
||||
},
|
||||
{
|
||||
"title": "daytona volume get",
|
||||
"description": "Get volume details",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-volume-get",
|
||||
"slug": "/tools/cli#daytona-volume-get",
|
||||
"objectID": 223
|
||||
"objectID": 224
|
||||
},
|
||||
{
|
||||
"title": "daytona volume delete",
|
||||
@@ -1789,7 +1797,23 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-volume-delete",
|
||||
"slug": "/tools/cli#daytona-volume-delete",
|
||||
"objectID": 224
|
||||
"objectID": 225
|
||||
},
|
||||
{
|
||||
"title": "daytona volume get",
|
||||
"description": "Get volume details",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-volume-get",
|
||||
"slug": "/tools/cli#daytona-volume-get",
|
||||
"objectID": 226
|
||||
},
|
||||
{
|
||||
"title": "daytona volume list",
|
||||
"description": "List all volumes",
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/tools/cli#daytona-volume-list",
|
||||
"slug": "/tools/cli#daytona-volume-list",
|
||||
"objectID": 227
|
||||
},
|
||||
{
|
||||
"title": "Volumes",
|
||||
@@ -1797,7 +1821,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/volumes",
|
||||
"slug": "/volumes",
|
||||
"objectID": 225
|
||||
"objectID": 228
|
||||
},
|
||||
{
|
||||
"title": "Creating Volumes",
|
||||
@@ -1805,7 +1829,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/volumes#creating-volumes",
|
||||
"slug": "/volumes#creating-volumes",
|
||||
"objectID": 226
|
||||
"objectID": 229
|
||||
},
|
||||
{
|
||||
"title": "Mounting Volumes to Sandboxes",
|
||||
@@ -1813,7 +1837,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/volumes#mounting-volumes-to-sandboxes",
|
||||
"slug": "/volumes#mounting-volumes-to-sandboxes",
|
||||
"objectID": 227
|
||||
"objectID": 230
|
||||
},
|
||||
{
|
||||
"title": "Create a new volume or get an existing one",
|
||||
@@ -1821,7 +1845,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/volumes#create-a-new-volume-or-get-an-existing-one",
|
||||
"slug": "/volumes#create-a-new-volume-or-get-an-existing-one",
|
||||
"objectID": 228
|
||||
"objectID": 231
|
||||
},
|
||||
{
|
||||
"title": "Mount the volume to the sandbox",
|
||||
@@ -1829,7 +1853,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/volumes#mount-the-volume-to-the-sandbox",
|
||||
"slug": "/volumes#mount-the-volume-to-the-sandbox",
|
||||
"objectID": 229
|
||||
"objectID": 232
|
||||
},
|
||||
{
|
||||
"title": "When you're done with the sandbox, you can remove it",
|
||||
@@ -1837,7 +1861,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/volumes#when-youre-done-with-the-sandbox-you-can-remove-it",
|
||||
"slug": "/volumes#when-youre-done-with-the-sandbox-you-can-remove-it",
|
||||
"objectID": 230
|
||||
"objectID": 233
|
||||
},
|
||||
{
|
||||
"title": "The volume will persist even after the sandbox is removed",
|
||||
@@ -1845,7 +1869,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/volumes#the-volume-will-persist-even-after-the-sandbox-is-removed",
|
||||
"slug": "/volumes#the-volume-will-persist-even-after-the-sandbox-is-removed",
|
||||
"objectID": 231
|
||||
"objectID": 234
|
||||
},
|
||||
{
|
||||
"title": "Deleting Volumes",
|
||||
@@ -1853,7 +1877,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/volumes#deleting-volumes",
|
||||
"slug": "/volumes#deleting-volumes",
|
||||
"objectID": 232
|
||||
"objectID": 235
|
||||
},
|
||||
{
|
||||
"title": "Working with Volumes",
|
||||
@@ -1861,7 +1885,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/volumes#working-with-volumes",
|
||||
"slug": "/volumes#working-with-volumes",
|
||||
"objectID": 233
|
||||
"objectID": 236
|
||||
},
|
||||
{
|
||||
"title": "Limitations",
|
||||
@@ -1869,7 +1893,7 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/volumes#limitations",
|
||||
"slug": "/volumes#limitations",
|
||||
"objectID": 234
|
||||
"objectID": 237
|
||||
},
|
||||
{
|
||||
"title": "Web Terminal",
|
||||
@@ -1877,6 +1901,6 @@
|
||||
"tag": "Documentation",
|
||||
"url": "/docs/web-terminal",
|
||||
"slug": "/web-terminal",
|
||||
"objectID": 235
|
||||
"objectID": 238
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,8 @@
|
||||
### How to update SVG diagrams
|
||||
|
||||
1. Open XML file (e.g. `src/assets/docs/sandbox-states.drawio.xml`) in [draw.io](https://app.diagrams.net/)
|
||||
2. Make necessary changes
|
||||
3. Export as SVG with "Transparent Backround" toggled `on` and "Embed Fonts" toggled `off`
|
||||
4. Replace the existing SVG with the newly exported one
|
||||
5. In the new SVG, remove the `color-scheme: light dark;` CSS property declaration
|
||||
6. Export as XML and replace the existing XML with the newly exported one
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36" version="27.1.6">
|
||||
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36" version="27.2.0">
|
||||
<diagram name="Page-1" id="bhnGPeD7QPbymYHpg9xH">
|
||||
<mxGraphModel dx="766" dy="538" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="290" math="0" shadow="0">
|
||||
<mxGraphModel dx="1426" dy="766" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="290" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
@@ -9,7 +9,7 @@
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="177" y="42" />
|
||||
<mxPoint x="773" y="42" />
|
||||
<mxPoint x="827" y="42" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
@@ -27,7 +27,7 @@
|
||||
<mxPoint x="766" y="138.40999999999997" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="425" y="72" />
|
||||
<mxPoint x="773" y="72" />
|
||||
<mxPoint x="827" y="72" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
@@ -40,14 +40,17 @@
|
||||
<mxGeometry x="366" y="132" width="118" height="54" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ZXRL-tFffRt2OgFoSzfc-4" value="DELETED" style="rounded=1;whiteSpace=wrap;arcSize=50;strokeWidth=2;shape=ellipse;html=1;movable=1;resizable=1;rotatable=1;deletable=1;editable=1;locked=0;connectable=1;fontSize=14;perimeter=ellipsePerimeter;fillColor=#f5f5f5;fontColor=#000000;strokeColor=#666666;" parent="1" vertex="1">
|
||||
<mxGeometry x="726" y="128.41" width="94" height="61.18" as="geometry" />
|
||||
<mxGeometry x="780" y="130.41" width="94" height="61.18" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="Bm4ui8PYQ9D95VNtlp4L-11" value="d" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.75;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=14;fontColor=#595959;" parent="1" source="ZXRL-tFffRt2OgFoSzfc-5" target="ZXRL-tFffRt2OgFoSzfc-4" edge="1">
|
||||
<mxCell id="Bm4ui8PYQ9D95VNtlp4L-11" value="d" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=14;fontColor=#595959;" parent="1" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="668" y="102" />
|
||||
<mxPoint x="773" y="102" />
|
||||
<mxPoint x="680" y="134" />
|
||||
<mxPoint x="680" y="102" />
|
||||
<mxPoint x="827" y="102" />
|
||||
</Array>
|
||||
<mxPoint x="681" y="134" as="sourcePoint" />
|
||||
<mxPoint x="826.9999999999998" y="130.40999999999997" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="Bm4ui8PYQ9D95VNtlp4L-12" value="sandbox.delete()" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=14;fontColor=#595959;" parent="Bm4ui8PYQ9D95VNtlp4L-11" vertex="1" connectable="0">
|
||||
@@ -56,14 +59,7 @@
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="ZXRL-tFffRt2OgFoSzfc-5" value="ARCHIVED" style="whiteSpace=wrap;strokeWidth=2;rounded=1;html=1;fillColor=#d5e8d4;fontSize=14;strokeColor=#82b366;fontColor=#000000;" parent="1" vertex="1">
|
||||
<mxGeometry x="576" y="132" width="122" height="54" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ZXRL-tFffRt2OgFoSzfc-6" value="Daytona.create()" style="startArrow=none;endArrow=block;exitX=1;exitY=0.5;rounded=0;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=14;fontColor=#595959;" parent="1" target="ZXRL-tFffRt2OgFoSzfc-2" edge="1">
|
||||
<mxGeometry x="-0.7241" relative="1" as="geometry">
|
||||
<mxPoint x="56" y="161" as="sourcePoint" />
|
||||
<mxPoint x="128" y="161" as="targetPoint" />
|
||||
<mxPoint as="offset" />
|
||||
</mxGeometry>
|
||||
<mxGeometry x="620" y="134" width="122" height="54" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ZXRL-tFffRt2OgFoSzfc-7" value="sandbox.stop()" style="startArrow=none;endArrow=block;exitX=0.5;exitY=0;entryX=0.25;entryY=0;rounded=0;exitDx=0;exitDy=0;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;fontSize=14;fontColor=#595959;" parent="1" source="ZXRL-tFffRt2OgFoSzfc-2" target="ZXRL-tFffRt2OgFoSzfc-3" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
@@ -73,7 +69,7 @@
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="ZXRL-tFffRt2OgFoSzfc-8" value="auto-stop 
(15 min)" style="startArrow=none;endArrow=block;exitX=1;exitY=0.5;entryX=0;entryY=0.5;rounded=0;edgeStyle=orthogonalEdgeStyle;entryDx=0;entryDy=0;exitDx=0;exitDy=0;fontSize=14;fontColor=#595959;" parent="1" source="ZXRL-tFffRt2OgFoSzfc-2" target="ZXRL-tFffRt2OgFoSzfc-3" edge="1">
|
||||
<mxCell id="ZXRL-tFffRt2OgFoSzfc-8" value="auto-stop" style="startArrow=none;endArrow=block;exitX=1;exitY=0.5;entryX=0;entryY=0.5;rounded=0;edgeStyle=orthogonalEdgeStyle;entryDx=0;entryDy=0;exitDx=0;exitDy=0;fontSize=14;fontColor=#595959;fontStyle=2" parent="1" source="ZXRL-tFffRt2OgFoSzfc-2" target="ZXRL-tFffRt2OgFoSzfc-3" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="126.04265306122446" y="208" as="sourcePoint" />
|
||||
<mxPoint x="332.09627450980395" y="152.00000000000003" as="targetPoint" />
|
||||
@@ -92,24 +88,42 @@
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="455" y="102" />
|
||||
<mxPoint x="611" y="102" />
|
||||
<mxPoint x="655" y="102" />
|
||||
<mxPoint x="655" y="120" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="ZXRL-tFffRt2OgFoSzfc-12" value="auto-archive 
(7 days)" style="startArrow=none;endArrow=block;exitX=1;exitY=0.5;entryX=0;entryY=0.5;rounded=0;edgeStyle=orthogonalEdgeStyle;entryDx=0;entryDy=0;exitDx=0;exitDy=0;fontStyle=0;fontSize=14;fontColor=#595959;" parent="1" source="ZXRL-tFffRt2OgFoSzfc-3" target="ZXRL-tFffRt2OgFoSzfc-5" edge="1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
<mxCell id="ZXRL-tFffRt2OgFoSzfc-12" value="auto-archive" style="startArrow=none;endArrow=block;exitX=1;exitY=0.5;entryX=0;entryY=0.5;rounded=0;edgeStyle=orthogonalEdgeStyle;entryDx=0;entryDy=0;exitDx=0;exitDy=0;fontStyle=2;fontSize=14;fontColor=#595959;" parent="1" source="ZXRL-tFffRt2OgFoSzfc-3" target="ZXRL-tFffRt2OgFoSzfc-5" edge="1">
|
||||
<mxGeometry x="0.1304" y="1" relative="1" as="geometry">
|
||||
<mxPoint as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="ZXRL-tFffRt2OgFoSzfc-14" value="sandbox.start()" style="startArrow=none;endArrow=block;entryX=0.25;entryY=1;rounded=0;edgeStyle=orthogonalEdgeStyle;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fontSize=14;fontColor=#595959;" parent="1" source="ZXRL-tFffRt2OgFoSzfc-5" target="ZXRL-tFffRt2OgFoSzfc-2" edge="1">
|
||||
<mxCell id="ZXRL-tFffRt2OgFoSzfc-14" value="sandbox.start()" style="startArrow=none;endArrow=block;entryX=0.25;entryY=1;rounded=0;edgeStyle=orthogonalEdgeStyle;entryDx=0;entryDy=0;fontSize=14;fontColor=#595959;" parent="1" edge="1">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="636" y="186" />
|
||||
<mxPoint x="636" y="242" />
|
||||
<mxPoint x="177" y="242" />
|
||||
<mxPoint x="673" y="188" />
|
||||
<mxPoint x="673" y="244" />
|
||||
<mxPoint x="190" y="244" />
|
||||
</Array>
|
||||
<mxPoint x="636" y="212" as="sourcePoint" />
|
||||
<mxPoint x="673" y="188" as="sourcePoint" />
|
||||
<mxPoint x="190.00000000000006" y="190" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="L9USphHFUnbPNhMHQVU4-6" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" target="ZXRL-tFffRt2OgFoSzfc-4" edge="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="500" y="160" as="sourcePoint" />
|
||||
<mxPoint x="830" y="230" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="500" y="190" />
|
||||
<mxPoint x="500" y="210" />
|
||||
<mxPoint x="827" y="210" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="L9USphHFUnbPNhMHQVU4-9" value="<span style="color: rgb(89, 89, 89); font-family: Helvetica; font-size: 14px; font-style: italic; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: center; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: nowrap; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; float: none; display: inline !important;">auto-delete</span>" style="text;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="550" y="191.59" width="100" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
</mxfile>
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 31 KiB |
@@ -173,7 +173,8 @@ params = CreateSandboxFromSnapshotParams(
|
||||
snapshot="my-snapshot-id",
|
||||
env_vars={"DEBUG": "true"},
|
||||
auto_stop_interval=0,
|
||||
auto_archive_interval=60
|
||||
auto_archive_interval=60,
|
||||
auto_delete_interval=120
|
||||
)
|
||||
sandbox = await daytona.create(params, timeout=40)
|
||||
```
|
||||
@@ -233,6 +234,7 @@ params = CreateSandboxFromImageParams(
|
||||
resources=Resources(cpu=2, memory=4),
|
||||
auto_stop_interval=0,
|
||||
auto_archive_interval=60,
|
||||
auto_delete_interval=120
|
||||
)
|
||||
sandbox = await daytona.create(
|
||||
params,
|
||||
@@ -468,6 +470,9 @@ Base parameters for creating a new Sandbox.
|
||||
- `auto_archive_interval` _Optional[int]_ - Interval in minutes after which a continuously stopped Sandbox will
|
||||
automatically archive. Default is 7 days.
|
||||
0 means the maximum interval will be used.
|
||||
- `auto_delete_interval` _Optional[int]_ - Interval in minutes after which a continuously stopped Sandbox will
|
||||
automatically be deleted. By default, auto-delete is disabled.
|
||||
Negative value means disabled, 0 means delete immediately upon stopping.
|
||||
|
||||
## CreateSandboxFromImageParams
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ Represents a Daytona Sandbox.
|
||||
- `backup_created_at` _str_ - When the backup was created.
|
||||
- `auto_stop_interval` _int_ - Auto-stop interval in minutes.
|
||||
- `auto_archive_interval` _int_ - Auto-archive interval in minutes.
|
||||
- `auto_delete_interval` _int_ - Auto-delete interval in minutes.
|
||||
- `runner_domain` _str_ - Domain name of the Sandbox runner.
|
||||
- `volumes` _List[str]_ - Volumes attached to the Sandbox.
|
||||
- `build_info` _str_ - Build information for the Sandbox if it was created from dynamic build.
|
||||
@@ -338,9 +339,38 @@ The Sandbox will automatically archive after being continuously stopped for the
|
||||
|
||||
```python
|
||||
# Auto-archive after 1 hour
|
||||
sandbox.set_autoarchive_interval(60)
|
||||
sandbox.set_auto_archive_interval(60)
|
||||
# Or use the maximum interval
|
||||
sandbox.set_autoarchive_interval(0)
|
||||
sandbox.set_auto_archive_interval(0)
|
||||
```
|
||||
|
||||
#### AsyncSandbox.set\_auto\_delete\_interval
|
||||
|
||||
```python
|
||||
@intercept_errors(message_prefix="Failed to set auto-delete interval: ")
|
||||
async def set_auto_delete_interval(interval: int) -> None
|
||||
```
|
||||
|
||||
Sets the auto-delete interval for the Sandbox.
|
||||
|
||||
The Sandbox will automatically delete after being continuously stopped for the specified interval.
|
||||
|
||||
**Arguments**:
|
||||
|
||||
- `interval` _int_ - Number of minutes after which a continuously stopped Sandbox will be auto-deleted.
|
||||
Set to negative value to disable auto-delete. Set to 0 to delete immediately upon stopping.
|
||||
By default, auto-delete is disabled.
|
||||
|
||||
|
||||
**Example**:
|
||||
|
||||
```python
|
||||
# Auto-delete after 1 hour
|
||||
sandbox.set_auto_delete_interval(60)
|
||||
# Or delete immediately upon stopping
|
||||
sandbox.set_auto_delete_interval(0)
|
||||
# Or disable auto-delete
|
||||
sandbox.set_auto_delete_interval(-1)
|
||||
```
|
||||
|
||||
#### AsyncSandbox.get\_preview\_link
|
||||
|
||||
@@ -124,7 +124,8 @@ params = CreateSandboxFromSnapshotParams(
|
||||
snapshot="my-snapshot-id",
|
||||
env_vars={"DEBUG": "true"},
|
||||
auto_stop_interval=0,
|
||||
auto_archive_interval=60
|
||||
auto_archive_interval=60,
|
||||
auto_delete_interval=120
|
||||
)
|
||||
sandbox = daytona.create(params, timeout=40)
|
||||
```
|
||||
@@ -183,6 +184,7 @@ params = CreateSandboxFromImageParams(
|
||||
resources=Resources(cpu=2, memory=4),
|
||||
auto_stop_interval=0,
|
||||
auto_archive_interval=60,
|
||||
auto_delete_interval=120
|
||||
)
|
||||
sandbox = daytona.create(
|
||||
params,
|
||||
@@ -418,6 +420,9 @@ Base parameters for creating a new Sandbox.
|
||||
- `auto_archive_interval` _Optional[int]_ - Interval in minutes after which a continuously stopped Sandbox will
|
||||
automatically archive. Default is 7 days.
|
||||
0 means the maximum interval will be used.
|
||||
- `auto_delete_interval` _Optional[int]_ - Interval in minutes after which a continuously stopped Sandbox will
|
||||
automatically be deleted. By default, auto-delete is disabled.
|
||||
Negative value means disabled, 0 means delete immediately upon stopping.
|
||||
|
||||
## CreateSandboxFromImageParams
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ Represents a Daytona Sandbox.
|
||||
- `backup_created_at` _str_ - When the backup was created.
|
||||
- `auto_stop_interval` _int_ - Auto-stop interval in minutes.
|
||||
- `auto_archive_interval` _int_ - Auto-archive interval in minutes.
|
||||
- `auto_delete_interval` _int_ - Auto-delete interval in minutes.
|
||||
- `runner_domain` _str_ - Domain name of the Sandbox runner.
|
||||
- `volumes` _List[str]_ - Volumes attached to the Sandbox.
|
||||
- `build_info` _str_ - Build information for the Sandbox if it was created from dynamic build.
|
||||
@@ -338,9 +339,38 @@ The Sandbox will automatically archive after being continuously stopped for the
|
||||
|
||||
```python
|
||||
# Auto-archive after 1 hour
|
||||
sandbox.set_autoarchive_interval(60)
|
||||
sandbox.set_auto_archive_interval(60)
|
||||
# Or use the maximum interval
|
||||
sandbox.set_autoarchive_interval(0)
|
||||
sandbox.set_auto_archive_interval(0)
|
||||
```
|
||||
|
||||
#### Sandbox.set\_auto\_delete\_interval
|
||||
|
||||
```python
|
||||
@intercept_errors(message_prefix="Failed to set auto-delete interval: ")
|
||||
def set_auto_delete_interval(interval: int) -> None
|
||||
```
|
||||
|
||||
Sets the auto-delete interval for the Sandbox.
|
||||
|
||||
The Sandbox will automatically delete after being continuously stopped for the specified interval.
|
||||
|
||||
**Arguments**:
|
||||
|
||||
- `interval` _int_ - Number of minutes after which a continuously stopped Sandbox will be auto-deleted.
|
||||
Set to negative value to disable auto-delete. Set to 0 to delete immediately upon stopping.
|
||||
By default, auto-delete is disabled.
|
||||
|
||||
|
||||
**Example**:
|
||||
|
||||
```python
|
||||
# Auto-delete after 1 hour
|
||||
sandbox.set_auto_delete_interval(60)
|
||||
# Or delete immediately upon stopping
|
||||
sandbox.set_auto_delete_interval(0)
|
||||
# Or disable auto-delete
|
||||
sandbox.set_auto_delete_interval(-1)
|
||||
```
|
||||
|
||||
#### Sandbox.get\_preview\_link
|
||||
|
||||
@@ -298,9 +298,9 @@ All sandboxes have been deleted
|
||||
|
||||
:::
|
||||
|
||||
## Auto-stop and Auto-archive
|
||||
## Automated Lifecycle Management
|
||||
|
||||
Daytona Sandboxes can be automatically stopped and archived based on user-defined intervals.
|
||||
Daytona Sandboxes can be automatically stopped, archived, and deleted based on user-defined intervals.
|
||||
|
||||
### Auto-stop Interval
|
||||
|
||||
@@ -365,7 +365,54 @@ const sandbox = await daytona.create({
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Run Indefinitely
|
||||
### Auto-delete Interval
|
||||
|
||||
The auto-delete interval parameter sets the amount of time after which a continuously stopped Sandbox will be automatically deleted. By default, Sandboxes will never be automatically deleted.
|
||||
|
||||
The parameter can either be set to:
|
||||
|
||||
- a time interval in minutes
|
||||
- `-1`, which disables the auto-delete functionality
|
||||
- `0`, which means the Sandbox will be deleted immediately after stopping
|
||||
|
||||
If the parameter is not set, the Sandbox will not be deleted automatically.
|
||||
|
||||
<Tabs>
|
||||
<TabItem label="Python" icon="seti:python">
|
||||
```python
|
||||
sandbox = daytona.create(CreateSandboxFromSnapshotParams(
|
||||
snapshot="my-snapshot-name",
|
||||
auto_delete_interval=60, # Auto-delete after a Sandbox has been stopped for 1 hour
|
||||
))
|
||||
|
||||
# Delete the Sandbox immediately after it has been stopped
|
||||
|
||||
sandbox.set_auto_delete_interval(0)
|
||||
|
||||
# Disable auto-deletion
|
||||
|
||||
sandbox.set_auto_delete_interval(-1)
|
||||
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="TypeScript" icon="seti:typescript">
|
||||
```typescript
|
||||
const sandbox = await daytona.create({
|
||||
snapshot: "my-snapshot-name",
|
||||
autoDeleteInterval: 60, // Auto-delete after a Sandbox has been stopped for 1 hour
|
||||
});
|
||||
|
||||
// Delete the Sandbox immediately after it has been stopped
|
||||
await sandbox.setAutoDeleteInterval(0)
|
||||
|
||||
// Disable auto-deletion
|
||||
await sandbox.setAutoDeleteInterval(-1)
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Run Indefinitely
|
||||
|
||||
By default, Sandboxes auto-stop after 15 minutes of inactivity. To keep a Sandbox running without interruption, set the auto-stop interval to `0` when creating a new Sandbox:
|
||||
|
||||
|
||||
@@ -1597,6 +1597,21 @@ The workspace symbol request is sent from the client to the server to list proje
|
||||
| **`200`** | Auto-archive interval has been set |
|
||||
|
||||
|
||||
## POST /sandbox/\{sandboxId\}/autodelete/\{interval\}
|
||||
|
||||
### Parameters
|
||||
| Name | Location | Required | Type | Description |
|
||||
| :--- | :------- | :------- | :--- | :---------- |
|
||||
| **`X-Daytona-Organization-ID`** | header | false | undefined | Use with JWT to specify the organization ID |
|
||||
| **`sandboxId`** | path | true | undefined | ID of the sandbox |
|
||||
| **`interval`** | path | true | undefined | Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) |
|
||||
|
||||
### Responses
|
||||
| Status Code | Description |
|
||||
| :-------- | :---------- |
|
||||
| **`200`** | Auto-delete interval has been set |
|
||||
|
||||
|
||||
## POST /workspace/\{workspaceId\}/archive
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -4,474 +4,483 @@ description: A reference of supported operations using the Daytona CLI.
|
||||
sidebar:
|
||||
label: Daytona CLI Reference
|
||||
---
|
||||
import Aside from "@components/Aside.astro";
|
||||
import Label from "@components/Label.astro";
|
||||
|
||||
import Aside from '@components/Aside.astro'
|
||||
import Label from '@components/Label.astro'
|
||||
|
||||
The `daytona` command-line tool provides access to Daytona's core features including managing Snapshots and the lifecycle of Daytona Sandboxes. View the installation instructions by clicking [here](/docs/getting-started#setting-up-the-daytona-cli).
|
||||
|
||||
This reference lists all commands supported by the `daytona` command-line tool complete with a description of their behaviour, and any supported flags.
|
||||
You can access this documentation on a per-command basis by appending the `--help`/`-h` flag when invoking `daytona`.
|
||||
|
||||
## daytona version
|
||||
Print the version number
|
||||
|
||||
```shell
|
||||
daytona version [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox info
|
||||
Get sandbox info
|
||||
|
||||
```shell
|
||||
daytona sandbox info [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--verbose` | `-v` | Include verbose output |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox list
|
||||
List sandboxes
|
||||
|
||||
```shell
|
||||
daytona sandbox list [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--limit` | `-l` | Maximum number of items per page |
|
||||
| `--page` | `-p` | Page number for pagination (starting from 1) |
|
||||
| `--verbose` | `-v` | Include verbose output |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox start
|
||||
Start a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox start [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Start all sandboxes |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox stop
|
||||
Stop a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox stop [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Stop all sandboxes |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox
|
||||
Manage Daytona sandboxes
|
||||
|
||||
```shell
|
||||
daytona sandbox [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox create
|
||||
Create a new sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox create [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--auto-archive` | | Auto-archive interval in minutes (0 means the maximum interval will be used) |
|
||||
| `--auto-stop` | | Auto-stop interval in minutes (0 means disabled) |
|
||||
| `--class` | | Sandbox class type (small, medium, large) |
|
||||
| `--context` | `-c` | Files or directories to include in the build context (can be specified multiple times) |
|
||||
| `--cpu` | | CPU cores allocated to the sandbox |
|
||||
| `--disk` | | Disk space allocated to the sandbox in GB |
|
||||
| `--dockerfile` | `-f` | Path to Dockerfile for Sandbox snapshot |
|
||||
| `--env` | `-e` | Environment variables (format: KEY=VALUE) |
|
||||
| `--gpu` | | GPU units allocated to the sandbox |
|
||||
| `--label` | `-l` | Labels (format: KEY=VALUE) |
|
||||
| `--memory` | | Memory allocated to the sandbox in MB |
|
||||
| `--public` | | Make sandbox publicly accessible |
|
||||
| `--snapshot` | | Snapshot to use for the sandbox |
|
||||
| `--target` | | Target region (eu, us) |
|
||||
| `--user` | | User associated with the sandbox |
|
||||
| `--volume` | `-v` | Volumes to mount (format: VOLUME_NAME:MOUNT_PATH) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona sandbox delete
|
||||
Delete a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox delete [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Delete all sandboxes |
|
||||
| `--force` | `-f` | Force delete |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona snapshot push
|
||||
Push local snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot push [SNAPSHOT] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--entrypoint` | `-e` | The entrypoint command for the image |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona login
|
||||
Log in to Daytona
|
||||
|
||||
```shell
|
||||
daytona login [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--api-key` | | API key to use for authentication |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona logout
|
||||
Logout from Daytona
|
||||
|
||||
```shell
|
||||
daytona logout [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona snapshot
|
||||
Manage Daytona snapshots
|
||||
|
||||
```shell
|
||||
daytona snapshot [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona snapshot create
|
||||
Create a snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot create [SNAPSHOT] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--context` | `-c` | Files or directories to include in the build context (can be specified multiple times) |
|
||||
| `--dockerfile` | `-f` | Path to Dockerfile to build |
|
||||
| `--entrypoint` | `-e` | The entrypoint command for the snapshot |
|
||||
| `--image` | `-i` | The image name for the snapshot |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona snapshot delete
|
||||
Delete a snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot delete [SNAPSHOT_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Delete all snapshots |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona snapshot list
|
||||
List all snapshots
|
||||
|
||||
```shell
|
||||
daytona snapshot list [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--limit` | `-l` | Maximum number of items per page |
|
||||
| `--page` | `-p` | Page number for pagination (starting from 1) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona
|
||||
|
||||
Daytona CLI
|
||||
|
||||
```shell
|
||||
daytona [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--help` | | help for daytona |
|
||||
| `--version` | `-v` | Display the version of Daytona |
|
||||
|
||||
|
||||
## daytona autocomplete
|
||||
|
||||
Adds a completion script for your shell environment
|
||||
|
||||
```shell
|
||||
daytona autocomplete [bash|zsh|fish|powershell] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
<Aside type="note">
|
||||
If using bash shell environment, make sure you have bash-completion installed in order to get full autocompletion functionality.
|
||||
Linux Installation: ```sudo apt-get install bash-completion```
|
||||
macOS Installation: ```brew install bash-completion```
|
||||
If using bash shell environment, make sure you have bash-completion installed
|
||||
in order to get full autocompletion functionality. Linux Installation: ```sudo
|
||||
apt-get install bash-completion``` macOS Installation: ```brew install
|
||||
bash-completion```
|
||||
</Aside>
|
||||
|
||||
## daytona docs
|
||||
|
||||
Opens the Daytona documentation in your default browser.
|
||||
|
||||
```shell
|
||||
daytona docs [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona login
|
||||
|
||||
## daytona organization
|
||||
Manage Daytona organizations
|
||||
Log in to Daytona
|
||||
|
||||
```shell
|
||||
daytona organization [flags]
|
||||
daytona login [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--api-key` | | API key to use for authentication |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona logout
|
||||
|
||||
## daytona organization create
|
||||
Create a new organization and set it as active
|
||||
Logout from Daytona
|
||||
|
||||
```shell
|
||||
daytona organization create [ORGANIZATION_NAME] [flags]
|
||||
daytona logout [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona organization delete
|
||||
Delete an organization
|
||||
|
||||
```shell
|
||||
daytona organization delete [ORGANIZATION] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona organization list
|
||||
List all organizations
|
||||
|
||||
```shell
|
||||
daytona organization list [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona organization use
|
||||
Set active organization
|
||||
|
||||
```shell
|
||||
daytona organization use [ORGANIZATION] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona mcp
|
||||
|
||||
Manage Daytona MCP Server
|
||||
|
||||
```shell
|
||||
daytona mcp [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona mcp init
|
||||
Initialize Daytona MCP Server with an agent (currently supported: claude, windsurf, cursor)
|
||||
|
||||
|
||||
```shell
|
||||
daytona mcp init [AGENT_NAME] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona mcp start
|
||||
Start Daytona MCP Server
|
||||
|
||||
```shell
|
||||
daytona mcp start [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona mcp config
|
||||
|
||||
Outputs JSON configuration for Daytona MCP Server
|
||||
|
||||
```shell
|
||||
daytona mcp config [AGENT_NAME] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona mcp init
|
||||
|
||||
Initialize Daytona MCP Server with an agent (currently supported: claude, windsurf, cursor)
|
||||
|
||||
```shell
|
||||
daytona mcp init [AGENT_NAME] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona mcp start
|
||||
|
||||
Start Daytona MCP Server
|
||||
|
||||
```shell
|
||||
daytona mcp start [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona organization
|
||||
|
||||
Manage Daytona organizations
|
||||
|
||||
```shell
|
||||
daytona organization [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona organization create
|
||||
|
||||
Create a new organization and set it as active
|
||||
|
||||
```shell
|
||||
daytona organization create [ORGANIZATION_NAME] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona organization delete
|
||||
|
||||
Delete an organization
|
||||
|
||||
```shell
|
||||
daytona organization delete [ORGANIZATION] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona organization list
|
||||
|
||||
List all organizations
|
||||
|
||||
```shell
|
||||
daytona organization list [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona organization use
|
||||
|
||||
Set active organization
|
||||
|
||||
```shell
|
||||
daytona organization use [ORGANIZATION] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox
|
||||
|
||||
Manage Daytona sandboxes
|
||||
|
||||
```shell
|
||||
daytona sandbox [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox create
|
||||
|
||||
Create a new sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox create [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--auto-archive` | | Auto-archive interval in minutes (0 means the maximum interval will be used) |
|
||||
| `--auto-delete` | | Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) |
|
||||
| `--auto-stop` | | Auto-stop interval in minutes (0 means disabled) |
|
||||
| `--class` | | Sandbox class type (small, medium, large) |
|
||||
| `--context` | `-c` | Files or directories to include in the build context (can be specified multiple times) |
|
||||
| `--cpu` | | CPU cores allocated to the sandbox |
|
||||
| `--disk` | | Disk space allocated to the sandbox in GB |
|
||||
| `--dockerfile` | `-f` | Path to Dockerfile for Sandbox snapshot |
|
||||
| `--env` | `-e` | Environment variables (format: KEY=VALUE) |
|
||||
| `--gpu` | | GPU units allocated to the sandbox |
|
||||
| `--label` | `-l` | Labels (format: KEY=VALUE) |
|
||||
| `--memory` | | Memory allocated to the sandbox in MB |
|
||||
| `--public` | | Make sandbox publicly accessible |
|
||||
| `--snapshot` | | Snapshot to use for the sandbox |
|
||||
| `--target` | | Target region (eu, us) |
|
||||
| `--user` | | User associated with the sandbox |
|
||||
| `--volume` | `-v` | Volumes to mount (format: VOLUME_NAME:MOUNT_PATH) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox delete
|
||||
|
||||
Delete a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox delete [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Delete all sandboxes |
|
||||
| `--force` | `-f` | Force delete |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox info
|
||||
|
||||
Get sandbox info
|
||||
|
||||
```shell
|
||||
daytona sandbox info [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--verbose` | `-v` | Include verbose output |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox list
|
||||
|
||||
List sandboxes
|
||||
|
||||
```shell
|
||||
daytona sandbox list [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--limit` | `-l` | Maximum number of items per page |
|
||||
| `--page` | `-p` | Page number for pagination (starting from 1) |
|
||||
| `--verbose` | `-v` | Include verbose output |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox start
|
||||
|
||||
Start a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox start [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Start all sandboxes |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona sandbox stop
|
||||
|
||||
Stop a sandbox
|
||||
|
||||
```shell
|
||||
daytona sandbox stop [SANDBOX_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Stop all sandboxes |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona snapshot
|
||||
|
||||
Manage Daytona snapshots
|
||||
|
||||
```shell
|
||||
daytona snapshot [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona snapshot create
|
||||
|
||||
Create a snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot create [SNAPSHOT] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--context` | `-c` | Files or directories to include in the build context (can be specified multiple times) |
|
||||
| `--cpu` | | CPU cores that will be allocated to the underlying sandboxes (default: 1) |
|
||||
| `--disk` | | Disk space that will be allocated to the underlying sandboxes in GB (default: 3) |
|
||||
| `--dockerfile` | `-f` | Path to Dockerfile to build |
|
||||
| `--entrypoint` | `-e` | The entrypoint command for the snapshot |
|
||||
| `--image` | `-i` | The image name for the snapshot |
|
||||
| `--memory` | | Memory that will be allocated to the underlying sandboxes in GB (default: 1) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona snapshot delete
|
||||
|
||||
Delete a snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot delete [SNAPSHOT_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--all` | `-a` | Delete all snapshots |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona snapshot list
|
||||
|
||||
List all snapshots
|
||||
|
||||
```shell
|
||||
daytona snapshot list [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--limit` | `-l` | Maximum number of items per page |
|
||||
| `--page` | `-p` | Page number for pagination (starting from 1) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona snapshot push
|
||||
|
||||
Push local snapshot
|
||||
|
||||
```shell
|
||||
daytona snapshot push [SNAPSHOT] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--cpu` | | CPU cores that will be allocated to the underlying sandboxes (default: 1) |
|
||||
| `--disk` | | Disk space that will be allocated to the underlying sandboxes in GB (default: 3) |
|
||||
| `--entrypoint` | `-e` | The entrypoint command for the image |
|
||||
| `--memory` | | Memory that will be allocated to the underlying sandboxes in GB (default: 1) |
|
||||
| `--name` | `-n` | Specify the Snapshot name |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona version
|
||||
|
||||
Print the version number
|
||||
|
||||
```shell
|
||||
daytona version [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona volume
|
||||
|
||||
Manage Daytona volumes
|
||||
|
||||
```shell
|
||||
daytona volume [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona volume list
|
||||
List all volumes
|
||||
|
||||
```shell
|
||||
daytona volume list [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona volume create
|
||||
|
||||
Create a volume
|
||||
|
||||
```shell
|
||||
daytona volume create [NAME] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--size` | `-s` | Size of the volume in GB |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
|
||||
## daytona volume get
|
||||
Get volume details
|
||||
|
||||
```shell
|
||||
daytona volume get [VOLUME_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona volume delete
|
||||
|
||||
Delete a volume
|
||||
|
||||
```shell
|
||||
daytona volume delete [VOLUME_ID] [flags]
|
||||
```
|
||||
|
||||
__Flags__
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--help` | | help for daytona |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona volume get
|
||||
|
||||
Get volume details
|
||||
|
||||
```shell
|
||||
daytona volume get [VOLUME_ID] [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
## daytona volume list
|
||||
|
||||
List all volumes
|
||||
|
||||
```shell
|
||||
daytona volume list [flags]
|
||||
```
|
||||
|
||||
**Flags**
|
||||
| Long | Short | Description |
|
||||
| :--- | :---- | :---------- |
|
||||
| `--format` | `-f` | Output format. Must be one of (yaml, json) |
|
||||
| `--help` | | help for daytona |
|
||||
|
||||
@@ -103,7 +103,9 @@ const params: CreateSandboxFromSnapshotParams = {
|
||||
NODE_ENV: 'development',
|
||||
DEBUG: 'true'
|
||||
},
|
||||
autoStopInterval: 60
|
||||
autoStopInterval: 60,
|
||||
autoArchiveInterval: 60,
|
||||
autoDeleteInterval: 120
|
||||
};
|
||||
const sandbox = await daytona.create(params, { timeout: 100 });
|
||||
```
|
||||
@@ -152,7 +154,9 @@ const params: CreateSandboxFromImageParams = {
|
||||
cpu: 2,
|
||||
memory: 4 // 4GB RAM
|
||||
},
|
||||
autoStopInterval: 60
|
||||
autoStopInterval: 60,
|
||||
autoArchiveInterval: 60,
|
||||
autoDeleteInterval: 120
|
||||
};
|
||||
const sandbox = await daytona.create(params, { timeout: 100, onSnapshotCreateLogs: console.log });
|
||||
```
|
||||
@@ -334,6 +338,7 @@ Base parameters for creating a new Sandbox.
|
||||
**Properties**:
|
||||
|
||||
- `autoArchiveInterval?` _number_ - Auto-archive interval in minutes (0 means the maximum interval will be used). Default is 7 days.
|
||||
- `autoDeleteInterval?` _number_ - Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping). By default, auto-delete is disabled.
|
||||
- `autoStopInterval?` _number_ - Auto-stop interval in minutes (0 means disabled). Default is 15 minutes.
|
||||
- `envVars?` _Record\<string, string\>_ - Optional environment variables to set in the Sandbox
|
||||
- `labels?` _Record\<string, string\>_ - Sandbox labels
|
||||
@@ -348,6 +353,7 @@ Parameters for creating a new Sandbox.
|
||||
**Properties**:
|
||||
|
||||
- `autoArchiveInterval?` _number_
|
||||
- `autoDeleteInterval?` _number_
|
||||
- `autoStopInterval?` _number_
|
||||
- `envVars?` _Record\<string, string\>_
|
||||
- `image` _string \| Image_ - Custom Docker image to use for the Sandbox. If an Image object is provided,
|
||||
@@ -366,6 +372,7 @@ Parameters for creating a new Sandbox from a snapshot.
|
||||
**Properties**:
|
||||
|
||||
- `autoArchiveInterval?` _number_
|
||||
- `autoDeleteInterval?` _number_
|
||||
- `autoStopInterval?` _number_
|
||||
- `envVars?` _Record\<string, string\>_
|
||||
- `labels?` _Record\<string, string\>_
|
||||
|
||||
@@ -17,6 +17,13 @@ Represents a Daytona Sandbox.
|
||||
```ts
|
||||
SandboxDto.autoArchiveInterval
|
||||
```
|
||||
- `autoDeleteInterval?` _number_ - Auto-delete interval in minutes
|
||||
|
||||
##### Implementation of
|
||||
|
||||
```ts
|
||||
SandboxDto.autoDeleteInterval
|
||||
```
|
||||
- `autoStopInterval?` _number_ - Auto-stop interval in minutes
|
||||
|
||||
##### Implementation of
|
||||
@@ -387,6 +394,40 @@ await sandbox.setAutoArchiveInterval(0);
|
||||
|
||||
***
|
||||
|
||||
#### setAutoDeleteInterval()
|
||||
|
||||
```ts
|
||||
setAutoDeleteInterval(interval: number): Promise<void>
|
||||
```
|
||||
|
||||
Set the auto-delete interval for the Sandbox.
|
||||
|
||||
The Sandbox will automatically delete after being continuously stopped for the specified interval.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `interval` _number_ - Number of minutes after which a continuously stopped Sandbox will be auto-deleted.
|
||||
Set to negative value to disable auto-delete. Set to 0 to delete immediately upon stopping.
|
||||
By default, auto-delete is disabled.
|
||||
|
||||
|
||||
**Returns**:
|
||||
|
||||
- `Promise<void>`
|
||||
|
||||
**Example:**
|
||||
|
||||
```ts
|
||||
// Auto-delete after 1 hour
|
||||
await sandbox.setAutoDeleteInterval(60);
|
||||
// Or delete immediately upon stopping
|
||||
await sandbox.setAutoDeleteInterval(0);
|
||||
// Or disable auto-delete
|
||||
await sandbox.setAutoDeleteInterval(-1);
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
#### setAutostopInterval()
|
||||
|
||||
```ts
|
||||
|
||||
@@ -34,9 +34,8 @@ macOS Installation: \`\`\`brew install bash-completion\`\`\`
|
||||
}
|
||||
|
||||
async function fetchRawDocs(ref) {
|
||||
// TODO: switch back to GitHub API once the CLI is OSS
|
||||
const url = 'https://download.daytona.io/docs/cli/cli-ref.txt'
|
||||
// 'https://api.github.com/repos/daytonaio/daytona/contents/hack/docs'
|
||||
const url =
|
||||
'https://api.github.com/repos/daytonaio/daytona/contents/apps/cli/hack/docs'
|
||||
const request = await fetch(`${url}?ref=${ref}`)
|
||||
const response = await request.json()
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import asyncio
|
||||
|
||||
from daytona import AsyncDaytona, CreateSandboxFromSnapshotParams
|
||||
|
||||
|
||||
async def main():
|
||||
async with AsyncDaytona() as daytona:
|
||||
# Auto-delete is disabled by default
|
||||
sandbox1 = await daytona.create()
|
||||
print(sandbox1.auto_delete_interval)
|
||||
|
||||
# Auto-delete after the Sandbox has been stopped for 1 hour
|
||||
await sandbox1.set_auto_delete_interval(60)
|
||||
print(sandbox1.auto_delete_interval)
|
||||
|
||||
# Delete immediately upon stopping
|
||||
await sandbox1.set_auto_delete_interval(0)
|
||||
print(sandbox1.auto_delete_interval)
|
||||
|
||||
# Disable auto-delete
|
||||
await sandbox1.set_auto_delete_interval(-1)
|
||||
print(sandbox1.auto_delete_interval)
|
||||
|
||||
# Auto-delete after the Sandbox has been stopped for 1 day
|
||||
sandbox2 = await daytona.create(params=CreateSandboxFromSnapshotParams(auto_delete_interval=1440))
|
||||
print(sandbox2.auto_delete_interval)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
@@ -0,0 +1,29 @@
|
||||
from daytona import CreateSandboxFromSnapshotParams, Daytona
|
||||
|
||||
|
||||
def main():
|
||||
daytona = Daytona()
|
||||
|
||||
# Auto-delete is disabled by default
|
||||
sandbox1 = daytona.create()
|
||||
print(sandbox1.auto_delete_interval)
|
||||
|
||||
# Auto-delete after the Sandbox has been stopped for 1 hour
|
||||
sandbox1.set_auto_delete_interval(60)
|
||||
print(sandbox1.auto_delete_interval)
|
||||
|
||||
# Delete immediately upon stopping
|
||||
sandbox1.set_auto_delete_interval(0)
|
||||
print(sandbox1.auto_delete_interval)
|
||||
|
||||
# Disable auto-delete
|
||||
sandbox1.set_auto_delete_interval(-1)
|
||||
print(sandbox1.auto_delete_interval)
|
||||
|
||||
# Auto-delete after the Sandbox has been stopped for 1 day
|
||||
sandbox2 = daytona.create(params=CreateSandboxFromSnapshotParams(auto_delete_interval=1440))
|
||||
print(sandbox2.auto_delete_interval)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Daytona } from '@daytonaio/sdk'
|
||||
|
||||
async function main() {
|
||||
const daytona = new Daytona()
|
||||
|
||||
// Auto-delete is disabled by default
|
||||
const sandbox1 = await daytona.create()
|
||||
console.log(sandbox1.autoDeleteInterval)
|
||||
|
||||
// Auto-delete after the Sandbox has been stopped for 1 hour
|
||||
await sandbox1.setAutoDeleteInterval(60)
|
||||
console.log(sandbox1.autoDeleteInterval)
|
||||
|
||||
// Delete immediately upon stopping
|
||||
await sandbox1.setAutoDeleteInterval(0)
|
||||
console.log(sandbox1.autoDeleteInterval)
|
||||
|
||||
// Disable auto-delete
|
||||
await sandbox1.setAutoDeleteInterval(-1)
|
||||
console.log(sandbox1.autoDeleteInterval)
|
||||
|
||||
// Auto-delete after the Sandbox has been stopped for 1 day
|
||||
const sandbox2 = await daytona.create({
|
||||
autoDeleteInterval: 1440,
|
||||
})
|
||||
console.log(sandbox2.autoDeleteInterval)
|
||||
}
|
||||
|
||||
main().catch(console.error)
|
||||
@@ -85,6 +85,7 @@ async function main() {
|
||||
language: 'typescript',
|
||||
autoStopInterval: 60,
|
||||
autoArchiveInterval: 60,
|
||||
autoDeleteInterval: 120,
|
||||
},
|
||||
{
|
||||
onSnapshotCreateLogs: console.log,
|
||||
|
||||
Generated
+59
@@ -1533,6 +1533,47 @@ paths:
|
||||
summary: Set sandbox auto-archive interval
|
||||
tags:
|
||||
- sandbox
|
||||
/sandbox/{sandboxId}/autodelete/{interval}:
|
||||
post:
|
||||
operationId: setAutoDeleteInterval
|
||||
parameters:
|
||||
- description: Use with JWT to specify the organization ID
|
||||
explode: false
|
||||
in: header
|
||||
name: X-Daytona-Organization-ID
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
style: simple
|
||||
- description: ID of the sandbox
|
||||
explode: false
|
||||
in: path
|
||||
name: sandboxId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
style: simple
|
||||
- description: "Auto-delete interval in minutes (negative value means disabled,\
|
||||
\ 0 means delete immediately upon stopping)"
|
||||
explode: false
|
||||
in: path
|
||||
name: interval
|
||||
required: true
|
||||
schema:
|
||||
type: number
|
||||
style: simple
|
||||
responses:
|
||||
'200':
|
||||
description: Auto-delete interval has been set
|
||||
security:
|
||||
- bearer: []
|
||||
- oauth2:
|
||||
- openid
|
||||
- profile
|
||||
- email
|
||||
summary: Set sandbox auto-delete interval
|
||||
tags:
|
||||
- sandbox
|
||||
/sandbox/{sandboxId}/archive:
|
||||
post:
|
||||
operationId: archiveSandbox
|
||||
@@ -6712,6 +6753,7 @@ components:
|
||||
autoStopInterval: 30
|
||||
organizationId: organization123
|
||||
createdAt: 2024-10-01T12:00:00Z
|
||||
autoDeleteInterval: 30
|
||||
public: false
|
||||
errorReason: The sandbox is not running
|
||||
runnerDomain: runner.example.com
|
||||
@@ -6830,6 +6872,11 @@ components:
|
||||
description: Auto-archive interval in minutes
|
||||
example: 10080
|
||||
type: number
|
||||
autoDeleteInterval:
|
||||
description: "Auto-delete interval in minutes (negative value means disabled,\
|
||||
\ 0 means delete immediately upon stopping)"
|
||||
example: 30
|
||||
type: number
|
||||
runnerDomain:
|
||||
description: The domain name of the runner
|
||||
example: runner.example.com
|
||||
@@ -6917,6 +6964,7 @@ components:
|
||||
daytona.io/public: 'true'
|
||||
target: eu
|
||||
disk: 3
|
||||
autoDeleteInterval: 30
|
||||
public: false
|
||||
user: daytona
|
||||
class: small
|
||||
@@ -6990,6 +7038,11 @@ components:
|
||||
will be used)
|
||||
example: 10080
|
||||
type: integer
|
||||
autoDeleteInterval:
|
||||
description: "Auto-delete interval in minutes (negative value means disabled,\
|
||||
\ 0 means delete immediately upon stopping)"
|
||||
example: 30
|
||||
type: integer
|
||||
volumes:
|
||||
description: Array of volumes to attach to the sandbox
|
||||
items:
|
||||
@@ -8761,6 +8814,7 @@ components:
|
||||
autoStopInterval: 30
|
||||
organizationId: organization123
|
||||
createdAt: 2024-10-01T12:00:00Z
|
||||
autoDeleteInterval: 30
|
||||
snapshotState: None
|
||||
public: false
|
||||
errorReason: The sandbox is not running
|
||||
@@ -8884,6 +8938,11 @@ components:
|
||||
description: Auto-archive interval in minutes
|
||||
example: 10080
|
||||
type: number
|
||||
autoDeleteInterval:
|
||||
description: "Auto-delete interval in minutes (negative value means disabled,\
|
||||
\ 0 means delete immediately upon stopping)"
|
||||
example: 30
|
||||
type: number
|
||||
runnerDomain:
|
||||
description: The domain name of the runner
|
||||
example: runner.example.com
|
||||
|
||||
Generated
+117
@@ -148,6 +148,19 @@ type SandboxAPI interface {
|
||||
// SetAutoArchiveIntervalExecute executes the request
|
||||
SetAutoArchiveIntervalExecute(r SandboxAPISetAutoArchiveIntervalRequest) (*http.Response, error)
|
||||
|
||||
/*
|
||||
SetAutoDeleteInterval Set sandbox auto-delete interval
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param sandboxId ID of the sandbox
|
||||
@param interval Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
@return SandboxAPISetAutoDeleteIntervalRequest
|
||||
*/
|
||||
SetAutoDeleteInterval(ctx context.Context, sandboxId string, interval float32) SandboxAPISetAutoDeleteIntervalRequest
|
||||
|
||||
// SetAutoDeleteIntervalExecute executes the request
|
||||
SetAutoDeleteIntervalExecute(r SandboxAPISetAutoDeleteIntervalRequest) (*http.Response, error)
|
||||
|
||||
/*
|
||||
SetAutostopInterval Set sandbox auto-stop interval
|
||||
|
||||
@@ -1357,6 +1370,110 @@ func (a *SandboxAPIService) SetAutoArchiveIntervalExecute(r SandboxAPISetAutoArc
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type SandboxAPISetAutoDeleteIntervalRequest struct {
|
||||
ctx context.Context
|
||||
ApiService SandboxAPI
|
||||
sandboxId string
|
||||
interval float32
|
||||
xDaytonaOrganizationID *string
|
||||
}
|
||||
|
||||
// Use with JWT to specify the organization ID
|
||||
func (r SandboxAPISetAutoDeleteIntervalRequest) XDaytonaOrganizationID(xDaytonaOrganizationID string) SandboxAPISetAutoDeleteIntervalRequest {
|
||||
r.xDaytonaOrganizationID = &xDaytonaOrganizationID
|
||||
return r
|
||||
}
|
||||
|
||||
func (r SandboxAPISetAutoDeleteIntervalRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.SetAutoDeleteIntervalExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
SetAutoDeleteInterval Set sandbox auto-delete interval
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param sandboxId ID of the sandbox
|
||||
@param interval Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
@return SandboxAPISetAutoDeleteIntervalRequest
|
||||
*/
|
||||
func (a *SandboxAPIService) SetAutoDeleteInterval(ctx context.Context, sandboxId string, interval float32) SandboxAPISetAutoDeleteIntervalRequest {
|
||||
return SandboxAPISetAutoDeleteIntervalRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
sandboxId: sandboxId,
|
||||
interval: interval,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *SandboxAPIService) SetAutoDeleteIntervalExecute(r SandboxAPISetAutoDeleteIntervalRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SandboxAPIService.SetAutoDeleteInterval")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/sandbox/{sandboxId}/autodelete/{interval}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"sandboxId"+"}", url.PathEscape(parameterValueToString(r.sandboxId, "sandboxId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"interval"+"}", url.PathEscape(parameterValueToString(r.interval, "interval")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
if r.xDaytonaOrganizationID != nil {
|
||||
parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Daytona-Organization-ID", r.xDaytonaOrganizationID, "simple", "")
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type SandboxAPISetAutostopIntervalRequest struct {
|
||||
ctx context.Context
|
||||
ApiService SandboxAPI
|
||||
|
||||
+37
@@ -46,6 +46,8 @@ type CreateSandbox struct {
|
||||
AutoStopInterval *int32 `json:"autoStopInterval,omitempty"`
|
||||
// Auto-archive interval in minutes (0 means the maximum interval will be used)
|
||||
AutoArchiveInterval *int32 `json:"autoArchiveInterval,omitempty"`
|
||||
// Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
AutoDeleteInterval *int32 `json:"autoDeleteInterval,omitempty"`
|
||||
// Array of volumes to attach to the sandbox
|
||||
Volumes []SandboxVolume `json:"volumes,omitempty"`
|
||||
// Build information for the sandbox
|
||||
@@ -485,6 +487,38 @@ func (o *CreateSandbox) SetAutoArchiveInterval(v int32) {
|
||||
o.AutoArchiveInterval = &v
|
||||
}
|
||||
|
||||
// GetAutoDeleteInterval returns the AutoDeleteInterval field value if set, zero value otherwise.
|
||||
func (o *CreateSandbox) GetAutoDeleteInterval() int32 {
|
||||
if o == nil || IsNil(o.AutoDeleteInterval) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.AutoDeleteInterval
|
||||
}
|
||||
|
||||
// GetAutoDeleteIntervalOk returns a tuple with the AutoDeleteInterval field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateSandbox) GetAutoDeleteIntervalOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.AutoDeleteInterval) {
|
||||
return nil, false
|
||||
}
|
||||
return o.AutoDeleteInterval, true
|
||||
}
|
||||
|
||||
// HasAutoDeleteInterval returns a boolean if a field has been set.
|
||||
func (o *CreateSandbox) HasAutoDeleteInterval() bool {
|
||||
if o != nil && !IsNil(o.AutoDeleteInterval) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAutoDeleteInterval gets a reference to the given int32 and assigns it to the AutoDeleteInterval field.
|
||||
func (o *CreateSandbox) SetAutoDeleteInterval(v int32) {
|
||||
o.AutoDeleteInterval = &v
|
||||
}
|
||||
|
||||
// GetVolumes returns the Volumes field value if set, zero value otherwise.
|
||||
func (o *CreateSandbox) GetVolumes() []SandboxVolume {
|
||||
if o == nil || IsNil(o.Volumes) {
|
||||
@@ -598,6 +632,9 @@ func (o CreateSandbox) ToMap() (map[string]interface{}, error) {
|
||||
if !IsNil(o.AutoArchiveInterval) {
|
||||
toSerialize["autoArchiveInterval"] = o.AutoArchiveInterval
|
||||
}
|
||||
if !IsNil(o.AutoDeleteInterval) {
|
||||
toSerialize["autoDeleteInterval"] = o.AutoDeleteInterval
|
||||
}
|
||||
if !IsNil(o.Volumes) {
|
||||
toSerialize["volumes"] = o.Volumes
|
||||
}
|
||||
|
||||
Generated
+37
@@ -60,6 +60,8 @@ type Sandbox struct {
|
||||
AutoStopInterval *float32 `json:"autoStopInterval,omitempty"`
|
||||
// Auto-archive interval in minutes
|
||||
AutoArchiveInterval *float32 `json:"autoArchiveInterval,omitempty"`
|
||||
// Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
AutoDeleteInterval *float32 `json:"autoDeleteInterval,omitempty"`
|
||||
// The domain name of the runner
|
||||
RunnerDomain *string `json:"runnerDomain,omitempty"`
|
||||
// Array of volumes attached to the sandbox
|
||||
@@ -627,6 +629,38 @@ func (o *Sandbox) SetAutoArchiveInterval(v float32) {
|
||||
o.AutoArchiveInterval = &v
|
||||
}
|
||||
|
||||
// GetAutoDeleteInterval returns the AutoDeleteInterval field value if set, zero value otherwise.
|
||||
func (o *Sandbox) GetAutoDeleteInterval() float32 {
|
||||
if o == nil || IsNil(o.AutoDeleteInterval) {
|
||||
var ret float32
|
||||
return ret
|
||||
}
|
||||
return *o.AutoDeleteInterval
|
||||
}
|
||||
|
||||
// GetAutoDeleteIntervalOk returns a tuple with the AutoDeleteInterval field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Sandbox) GetAutoDeleteIntervalOk() (*float32, bool) {
|
||||
if o == nil || IsNil(o.AutoDeleteInterval) {
|
||||
return nil, false
|
||||
}
|
||||
return o.AutoDeleteInterval, true
|
||||
}
|
||||
|
||||
// HasAutoDeleteInterval returns a boolean if a field has been set.
|
||||
func (o *Sandbox) HasAutoDeleteInterval() bool {
|
||||
if o != nil && !IsNil(o.AutoDeleteInterval) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAutoDeleteInterval gets a reference to the given float32 and assigns it to the AutoDeleteInterval field.
|
||||
func (o *Sandbox) SetAutoDeleteInterval(v float32) {
|
||||
o.AutoDeleteInterval = &v
|
||||
}
|
||||
|
||||
// GetRunnerDomain returns the RunnerDomain field value if set, zero value otherwise.
|
||||
func (o *Sandbox) GetRunnerDomain() string {
|
||||
if o == nil || IsNil(o.RunnerDomain) {
|
||||
@@ -899,6 +933,9 @@ func (o Sandbox) ToMap() (map[string]interface{}, error) {
|
||||
if !IsNil(o.AutoArchiveInterval) {
|
||||
toSerialize["autoArchiveInterval"] = o.AutoArchiveInterval
|
||||
}
|
||||
if !IsNil(o.AutoDeleteInterval) {
|
||||
toSerialize["autoDeleteInterval"] = o.AutoDeleteInterval
|
||||
}
|
||||
if !IsNil(o.RunnerDomain) {
|
||||
toSerialize["runnerDomain"] = o.RunnerDomain
|
||||
}
|
||||
|
||||
Generated
+37
@@ -60,6 +60,8 @@ type Workspace struct {
|
||||
AutoStopInterval *float32 `json:"autoStopInterval,omitempty"`
|
||||
// Auto-archive interval in minutes
|
||||
AutoArchiveInterval *float32 `json:"autoArchiveInterval,omitempty"`
|
||||
// Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
AutoDeleteInterval *float32 `json:"autoDeleteInterval,omitempty"`
|
||||
// The domain name of the runner
|
||||
RunnerDomain *string `json:"runnerDomain,omitempty"`
|
||||
// Array of volumes attached to the sandbox
|
||||
@@ -640,6 +642,38 @@ func (o *Workspace) SetAutoArchiveInterval(v float32) {
|
||||
o.AutoArchiveInterval = &v
|
||||
}
|
||||
|
||||
// GetAutoDeleteInterval returns the AutoDeleteInterval field value if set, zero value otherwise.
|
||||
func (o *Workspace) GetAutoDeleteInterval() float32 {
|
||||
if o == nil || IsNil(o.AutoDeleteInterval) {
|
||||
var ret float32
|
||||
return ret
|
||||
}
|
||||
return *o.AutoDeleteInterval
|
||||
}
|
||||
|
||||
// GetAutoDeleteIntervalOk returns a tuple with the AutoDeleteInterval field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Workspace) GetAutoDeleteIntervalOk() (*float32, bool) {
|
||||
if o == nil || IsNil(o.AutoDeleteInterval) {
|
||||
return nil, false
|
||||
}
|
||||
return o.AutoDeleteInterval, true
|
||||
}
|
||||
|
||||
// HasAutoDeleteInterval returns a boolean if a field has been set.
|
||||
func (o *Workspace) HasAutoDeleteInterval() bool {
|
||||
if o != nil && !IsNil(o.AutoDeleteInterval) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAutoDeleteInterval gets a reference to the given float32 and assigns it to the AutoDeleteInterval field.
|
||||
func (o *Workspace) SetAutoDeleteInterval(v float32) {
|
||||
o.AutoDeleteInterval = &v
|
||||
}
|
||||
|
||||
// GetRunnerDomain returns the RunnerDomain field value if set, zero value otherwise.
|
||||
func (o *Workspace) GetRunnerDomain() string {
|
||||
if o == nil || IsNil(o.RunnerDomain) {
|
||||
@@ -1064,6 +1098,9 @@ func (o Workspace) ToMap() (map[string]interface{}, error) {
|
||||
if !IsNil(o.AutoArchiveInterval) {
|
||||
toSerialize["autoArchiveInterval"] = o.AutoArchiveInterval
|
||||
}
|
||||
if !IsNil(o.AutoDeleteInterval) {
|
||||
toSerialize["autoDeleteInterval"] = o.AutoDeleteInterval
|
||||
}
|
||||
if !IsNil(o.RunnerDomain) {
|
||||
toSerialize["runnerDomain"] = o.RunnerDomain
|
||||
}
|
||||
|
||||
@@ -2913,6 +2913,288 @@ class SandboxApi:
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
async def set_auto_delete_interval(
|
||||
self,
|
||||
sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
|
||||
interval: Annotated[Union[StrictFloat, StrictInt], Field(description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)")],
|
||||
x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> None:
|
||||
"""Set sandbox auto-delete interval
|
||||
|
||||
|
||||
:param sandbox_id: ID of the sandbox (required)
|
||||
:type sandbox_id: str
|
||||
:param interval: Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) (required)
|
||||
:type interval: float
|
||||
:param x_daytona_organization_id: Use with JWT to specify the organization ID
|
||||
:type x_daytona_organization_id: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._set_auto_delete_interval_serialize(
|
||||
sandbox_id=sandbox_id,
|
||||
interval=interval,
|
||||
x_daytona_organization_id=x_daytona_organization_id,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': None,
|
||||
}
|
||||
response_data = await self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
await response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
async def set_auto_delete_interval_with_http_info(
|
||||
self,
|
||||
sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
|
||||
interval: Annotated[Union[StrictFloat, StrictInt], Field(description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)")],
|
||||
x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[None]:
|
||||
"""Set sandbox auto-delete interval
|
||||
|
||||
|
||||
:param sandbox_id: ID of the sandbox (required)
|
||||
:type sandbox_id: str
|
||||
:param interval: Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) (required)
|
||||
:type interval: float
|
||||
:param x_daytona_organization_id: Use with JWT to specify the organization ID
|
||||
:type x_daytona_organization_id: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._set_auto_delete_interval_serialize(
|
||||
sandbox_id=sandbox_id,
|
||||
interval=interval,
|
||||
x_daytona_organization_id=x_daytona_organization_id,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': None,
|
||||
}
|
||||
response_data = await self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
await response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
async def set_auto_delete_interval_without_preload_content(
|
||||
self,
|
||||
sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
|
||||
interval: Annotated[Union[StrictFloat, StrictInt], Field(description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)")],
|
||||
x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""Set sandbox auto-delete interval
|
||||
|
||||
|
||||
:param sandbox_id: ID of the sandbox (required)
|
||||
:type sandbox_id: str
|
||||
:param interval: Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) (required)
|
||||
:type interval: float
|
||||
:param x_daytona_organization_id: Use with JWT to specify the organization ID
|
||||
:type x_daytona_organization_id: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._set_auto_delete_interval_serialize(
|
||||
sandbox_id=sandbox_id,
|
||||
interval=interval,
|
||||
x_daytona_organization_id=x_daytona_organization_id,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': None,
|
||||
}
|
||||
response_data = await self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _set_auto_delete_interval_serialize(
|
||||
self,
|
||||
sandbox_id,
|
||||
interval,
|
||||
x_daytona_organization_id,
|
||||
_request_auth,
|
||||
_content_type,
|
||||
_headers,
|
||||
_host_index,
|
||||
) -> RequestSerialized:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if sandbox_id is not None:
|
||||
_path_params['sandboxId'] = sandbox_id
|
||||
if interval is not None:
|
||||
_path_params['interval'] = interval
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
if x_daytona_organization_id is not None:
|
||||
_header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = [
|
||||
'bearer',
|
||||
'oauth2'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='POST',
|
||||
resource_path='/sandbox/{sandboxId}/autodelete/{interval}',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
body=_body_params,
|
||||
post_params=_form_params,
|
||||
files=_files,
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
async def set_autostop_interval(
|
||||
self,
|
||||
|
||||
+3
-1
@@ -42,10 +42,11 @@ class CreateSandbox(BaseModel):
|
||||
disk: Optional[StrictInt] = Field(default=None, description="Disk space allocated to the sandbox in GB")
|
||||
auto_stop_interval: Optional[StrictInt] = Field(default=None, description="Auto-stop interval in minutes (0 means disabled)", alias="autoStopInterval")
|
||||
auto_archive_interval: Optional[StrictInt] = Field(default=None, description="Auto-archive interval in minutes (0 means the maximum interval will be used)", alias="autoArchiveInterval")
|
||||
auto_delete_interval: Optional[StrictInt] = Field(default=None, description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)", alias="autoDeleteInterval")
|
||||
volumes: Optional[List[SandboxVolume]] = Field(default=None, description="Array of volumes to attach to the sandbox")
|
||||
build_info: Optional[CreateBuildInfo] = Field(default=None, description="Build information for the sandbox", alias="buildInfo")
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties: ClassVar[List[str]] = ["snapshot", "user", "env", "labels", "public", "class", "target", "cpu", "gpu", "memory", "disk", "autoStopInterval", "autoArchiveInterval", "volumes", "buildInfo"]
|
||||
__properties: ClassVar[List[str]] = ["snapshot", "user", "env", "labels", "public", "class", "target", "cpu", "gpu", "memory", "disk", "autoStopInterval", "autoArchiveInterval", "autoDeleteInterval", "volumes", "buildInfo"]
|
||||
|
||||
@field_validator('var_class')
|
||||
def var_class_validate_enum(cls, value):
|
||||
@@ -148,6 +149,7 @@ class CreateSandbox(BaseModel):
|
||||
"disk": obj.get("disk"),
|
||||
"autoStopInterval": obj.get("autoStopInterval"),
|
||||
"autoArchiveInterval": obj.get("autoArchiveInterval"),
|
||||
"autoDeleteInterval": obj.get("autoDeleteInterval"),
|
||||
"volumes": [SandboxVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None,
|
||||
"buildInfo": CreateBuildInfo.from_dict(obj["buildInfo"]) if obj.get("buildInfo") is not None else None
|
||||
})
|
||||
|
||||
@@ -50,6 +50,7 @@ class Sandbox(BaseModel):
|
||||
backup_created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the last backup", alias="backupCreatedAt")
|
||||
auto_stop_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-stop interval in minutes (0 means disabled)", alias="autoStopInterval")
|
||||
auto_archive_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-archive interval in minutes", alias="autoArchiveInterval")
|
||||
auto_delete_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)", alias="autoDeleteInterval")
|
||||
runner_domain: Optional[StrictStr] = Field(default=None, description="The domain name of the runner", alias="runnerDomain")
|
||||
volumes: Optional[List[SandboxVolume]] = Field(default=None, description="Array of volumes attached to the sandbox")
|
||||
build_info: Optional[BuildInfo] = Field(default=None, description="Build information for the sandbox", alias="buildInfo")
|
||||
@@ -58,7 +59,7 @@ class Sandbox(BaseModel):
|
||||
var_class: Optional[StrictStr] = Field(default=None, description="The class of the sandbox", alias="class")
|
||||
daemon_version: Optional[StrictStr] = Field(default=None, description="The version of the daemon running in the sandbox", alias="daemonVersion")
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "desiredState", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "daemonVersion"]
|
||||
__properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "desiredState", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "autoDeleteInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "daemonVersion"]
|
||||
|
||||
@field_validator('backup_state')
|
||||
def backup_state_validate_enum(cls, value):
|
||||
@@ -167,6 +168,7 @@ class Sandbox(BaseModel):
|
||||
"backupCreatedAt": obj.get("backupCreatedAt"),
|
||||
"autoStopInterval": obj.get("autoStopInterval"),
|
||||
"autoArchiveInterval": obj.get("autoArchiveInterval"),
|
||||
"autoDeleteInterval": obj.get("autoDeleteInterval"),
|
||||
"runnerDomain": obj.get("runnerDomain"),
|
||||
"volumes": [SandboxVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None,
|
||||
"buildInfo": BuildInfo.from_dict(obj["buildInfo"]) if obj.get("buildInfo") is not None else None,
|
||||
|
||||
@@ -51,6 +51,7 @@ class Workspace(BaseModel):
|
||||
backup_created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the last backup", alias="backupCreatedAt")
|
||||
auto_stop_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-stop interval in minutes (0 means disabled)", alias="autoStopInterval")
|
||||
auto_archive_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-archive interval in minutes", alias="autoArchiveInterval")
|
||||
auto_delete_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)", alias="autoDeleteInterval")
|
||||
runner_domain: Optional[StrictStr] = Field(default=None, description="The domain name of the runner", alias="runnerDomain")
|
||||
volumes: Optional[List[SandboxVolume]] = Field(default=None, description="Array of volumes attached to the sandbox")
|
||||
build_info: Optional[BuildInfo] = Field(default=None, description="Build information for the sandbox", alias="buildInfo")
|
||||
@@ -64,7 +65,7 @@ class Workspace(BaseModel):
|
||||
snapshot_created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the last snapshot", alias="snapshotCreatedAt")
|
||||
info: Optional[SandboxInfo] = Field(default=None, description="Additional information about the sandbox")
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "desiredState", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "daemonVersion", "name", "image", "snapshotState", "snapshotCreatedAt", "info"]
|
||||
__properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "desiredState", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "autoDeleteInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "daemonVersion", "name", "image", "snapshotState", "snapshotCreatedAt", "info"]
|
||||
|
||||
@field_validator('backup_state')
|
||||
def backup_state_validate_enum(cls, value):
|
||||
@@ -186,6 +187,7 @@ class Workspace(BaseModel):
|
||||
"backupCreatedAt": obj.get("backupCreatedAt"),
|
||||
"autoStopInterval": obj.get("autoStopInterval"),
|
||||
"autoArchiveInterval": obj.get("autoArchiveInterval"),
|
||||
"autoDeleteInterval": obj.get("autoDeleteInterval"),
|
||||
"runnerDomain": obj.get("runnerDomain"),
|
||||
"volumes": [SandboxVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None,
|
||||
"buildInfo": BuildInfo.from_dict(obj["buildInfo"]) if obj.get("buildInfo") is not None else None,
|
||||
|
||||
@@ -2913,6 +2913,288 @@ class SandboxApi:
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def set_auto_delete_interval(
|
||||
self,
|
||||
sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
|
||||
interval: Annotated[Union[StrictFloat, StrictInt], Field(description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)")],
|
||||
x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> None:
|
||||
"""Set sandbox auto-delete interval
|
||||
|
||||
|
||||
:param sandbox_id: ID of the sandbox (required)
|
||||
:type sandbox_id: str
|
||||
:param interval: Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) (required)
|
||||
:type interval: float
|
||||
:param x_daytona_organization_id: Use with JWT to specify the organization ID
|
||||
:type x_daytona_organization_id: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._set_auto_delete_interval_serialize(
|
||||
sandbox_id=sandbox_id,
|
||||
interval=interval,
|
||||
x_daytona_organization_id=x_daytona_organization_id,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def set_auto_delete_interval_with_http_info(
|
||||
self,
|
||||
sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
|
||||
interval: Annotated[Union[StrictFloat, StrictInt], Field(description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)")],
|
||||
x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[None]:
|
||||
"""Set sandbox auto-delete interval
|
||||
|
||||
|
||||
:param sandbox_id: ID of the sandbox (required)
|
||||
:type sandbox_id: str
|
||||
:param interval: Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) (required)
|
||||
:type interval: float
|
||||
:param x_daytona_organization_id: Use with JWT to specify the organization ID
|
||||
:type x_daytona_organization_id: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._set_auto_delete_interval_serialize(
|
||||
sandbox_id=sandbox_id,
|
||||
interval=interval,
|
||||
x_daytona_organization_id=x_daytona_organization_id,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def set_auto_delete_interval_without_preload_content(
|
||||
self,
|
||||
sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
|
||||
interval: Annotated[Union[StrictFloat, StrictInt], Field(description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)")],
|
||||
x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""Set sandbox auto-delete interval
|
||||
|
||||
|
||||
:param sandbox_id: ID of the sandbox (required)
|
||||
:type sandbox_id: str
|
||||
:param interval: Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping) (required)
|
||||
:type interval: float
|
||||
:param x_daytona_organization_id: Use with JWT to specify the organization ID
|
||||
:type x_daytona_organization_id: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._set_auto_delete_interval_serialize(
|
||||
sandbox_id=sandbox_id,
|
||||
interval=interval,
|
||||
x_daytona_organization_id=x_daytona_organization_id,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _set_auto_delete_interval_serialize(
|
||||
self,
|
||||
sandbox_id,
|
||||
interval,
|
||||
x_daytona_organization_id,
|
||||
_request_auth,
|
||||
_content_type,
|
||||
_headers,
|
||||
_host_index,
|
||||
) -> RequestSerialized:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if sandbox_id is not None:
|
||||
_path_params['sandboxId'] = sandbox_id
|
||||
if interval is not None:
|
||||
_path_params['interval'] = interval
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
if x_daytona_organization_id is not None:
|
||||
_header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = [
|
||||
'bearer',
|
||||
'oauth2'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='POST',
|
||||
resource_path='/sandbox/{sandboxId}/autodelete/{interval}',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
body=_body_params,
|
||||
post_params=_form_params,
|
||||
files=_files,
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def set_autostop_interval(
|
||||
self,
|
||||
|
||||
@@ -42,10 +42,11 @@ class CreateSandbox(BaseModel):
|
||||
disk: Optional[StrictInt] = Field(default=None, description="Disk space allocated to the sandbox in GB")
|
||||
auto_stop_interval: Optional[StrictInt] = Field(default=None, description="Auto-stop interval in minutes (0 means disabled)", alias="autoStopInterval")
|
||||
auto_archive_interval: Optional[StrictInt] = Field(default=None, description="Auto-archive interval in minutes (0 means the maximum interval will be used)", alias="autoArchiveInterval")
|
||||
auto_delete_interval: Optional[StrictInt] = Field(default=None, description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)", alias="autoDeleteInterval")
|
||||
volumes: Optional[List[SandboxVolume]] = Field(default=None, description="Array of volumes to attach to the sandbox")
|
||||
build_info: Optional[CreateBuildInfo] = Field(default=None, description="Build information for the sandbox", alias="buildInfo")
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties: ClassVar[List[str]] = ["snapshot", "user", "env", "labels", "public", "class", "target", "cpu", "gpu", "memory", "disk", "autoStopInterval", "autoArchiveInterval", "volumes", "buildInfo"]
|
||||
__properties: ClassVar[List[str]] = ["snapshot", "user", "env", "labels", "public", "class", "target", "cpu", "gpu", "memory", "disk", "autoStopInterval", "autoArchiveInterval", "autoDeleteInterval", "volumes", "buildInfo"]
|
||||
|
||||
@field_validator('var_class')
|
||||
def var_class_validate_enum(cls, value):
|
||||
@@ -148,6 +149,7 @@ class CreateSandbox(BaseModel):
|
||||
"disk": obj.get("disk"),
|
||||
"autoStopInterval": obj.get("autoStopInterval"),
|
||||
"autoArchiveInterval": obj.get("autoArchiveInterval"),
|
||||
"autoDeleteInterval": obj.get("autoDeleteInterval"),
|
||||
"volumes": [SandboxVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None,
|
||||
"buildInfo": CreateBuildInfo.from_dict(obj["buildInfo"]) if obj.get("buildInfo") is not None else None
|
||||
})
|
||||
|
||||
+3
-1
@@ -50,6 +50,7 @@ class Sandbox(BaseModel):
|
||||
backup_created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the last backup", alias="backupCreatedAt")
|
||||
auto_stop_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-stop interval in minutes (0 means disabled)", alias="autoStopInterval")
|
||||
auto_archive_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-archive interval in minutes", alias="autoArchiveInterval")
|
||||
auto_delete_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)", alias="autoDeleteInterval")
|
||||
runner_domain: Optional[StrictStr] = Field(default=None, description="The domain name of the runner", alias="runnerDomain")
|
||||
volumes: Optional[List[SandboxVolume]] = Field(default=None, description="Array of volumes attached to the sandbox")
|
||||
build_info: Optional[BuildInfo] = Field(default=None, description="Build information for the sandbox", alias="buildInfo")
|
||||
@@ -58,7 +59,7 @@ class Sandbox(BaseModel):
|
||||
var_class: Optional[StrictStr] = Field(default=None, description="The class of the sandbox", alias="class")
|
||||
daemon_version: Optional[StrictStr] = Field(default=None, description="The version of the daemon running in the sandbox", alias="daemonVersion")
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "desiredState", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "daemonVersion"]
|
||||
__properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "desiredState", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "autoDeleteInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "daemonVersion"]
|
||||
|
||||
@field_validator('backup_state')
|
||||
def backup_state_validate_enum(cls, value):
|
||||
@@ -167,6 +168,7 @@ class Sandbox(BaseModel):
|
||||
"backupCreatedAt": obj.get("backupCreatedAt"),
|
||||
"autoStopInterval": obj.get("autoStopInterval"),
|
||||
"autoArchiveInterval": obj.get("autoArchiveInterval"),
|
||||
"autoDeleteInterval": obj.get("autoDeleteInterval"),
|
||||
"runnerDomain": obj.get("runnerDomain"),
|
||||
"volumes": [SandboxVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None,
|
||||
"buildInfo": BuildInfo.from_dict(obj["buildInfo"]) if obj.get("buildInfo") is not None else None,
|
||||
|
||||
@@ -51,6 +51,7 @@ class Workspace(BaseModel):
|
||||
backup_created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the last backup", alias="backupCreatedAt")
|
||||
auto_stop_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-stop interval in minutes (0 means disabled)", alias="autoStopInterval")
|
||||
auto_archive_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-archive interval in minutes", alias="autoArchiveInterval")
|
||||
auto_delete_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)", alias="autoDeleteInterval")
|
||||
runner_domain: Optional[StrictStr] = Field(default=None, description="The domain name of the runner", alias="runnerDomain")
|
||||
volumes: Optional[List[SandboxVolume]] = Field(default=None, description="Array of volumes attached to the sandbox")
|
||||
build_info: Optional[BuildInfo] = Field(default=None, description="Build information for the sandbox", alias="buildInfo")
|
||||
@@ -64,7 +65,7 @@ class Workspace(BaseModel):
|
||||
snapshot_created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the last snapshot", alias="snapshotCreatedAt")
|
||||
info: Optional[SandboxInfo] = Field(default=None, description="Additional information about the sandbox")
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "desiredState", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "daemonVersion", "name", "image", "snapshotState", "snapshotCreatedAt", "info"]
|
||||
__properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "desiredState", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "autoDeleteInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "daemonVersion", "name", "image", "snapshotState", "snapshotCreatedAt", "info"]
|
||||
|
||||
@field_validator('backup_state')
|
||||
def backup_state_validate_enum(cls, value):
|
||||
@@ -186,6 +187,7 @@ class Workspace(BaseModel):
|
||||
"backupCreatedAt": obj.get("backupCreatedAt"),
|
||||
"autoStopInterval": obj.get("autoStopInterval"),
|
||||
"autoArchiveInterval": obj.get("autoArchiveInterval"),
|
||||
"autoDeleteInterval": obj.get("autoDeleteInterval"),
|
||||
"runnerDomain": obj.get("runnerDomain"),
|
||||
"volumes": [SandboxVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None,
|
||||
"buildInfo": BuildInfo.from_dict(obj["buildInfo"]) if obj.get("buildInfo") is not None else None,
|
||||
|
||||
Generated
+123
@@ -563,6 +563,57 @@ export const SandboxApiAxiosParamCreator = function (configuration?: Configurati
|
||||
options: localVarRequestOptions,
|
||||
}
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Set sandbox auto-delete interval
|
||||
* @param {string} sandboxId ID of the sandbox
|
||||
* @param {number} interval Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
* @param {string} [xDaytonaOrganizationID] Use with JWT to specify the organization ID
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
setAutoDeleteInterval: async (
|
||||
sandboxId: string,
|
||||
interval: number,
|
||||
xDaytonaOrganizationID?: string,
|
||||
options: RawAxiosRequestConfig = {},
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'sandboxId' is not null or undefined
|
||||
assertParamExists('setAutoDeleteInterval', 'sandboxId', sandboxId)
|
||||
// verify required parameter 'interval' is not null or undefined
|
||||
assertParamExists('setAutoDeleteInterval', 'interval', interval)
|
||||
const localVarPath = `/sandbox/{sandboxId}/autodelete/{interval}`
|
||||
.replace(`{${'sandboxId'}}`, encodeURIComponent(String(sandboxId)))
|
||||
.replace(`{${'interval'}}`, encodeURIComponent(String(interval)))
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL)
|
||||
let baseOptions
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }
|
||||
const localVarHeaderParameter = {} as any
|
||||
const localVarQueryParameter = {} as any
|
||||
|
||||
// authentication bearer required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||
|
||||
// authentication oauth2 required
|
||||
|
||||
if (xDaytonaOrganizationID != null) {
|
||||
localVarHeaderParameter['X-Daytona-Organization-ID'] = String(xDaytonaOrganizationID)
|
||||
}
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}
|
||||
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
}
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Set sandbox auto-stop interval
|
||||
@@ -1081,6 +1132,38 @@ export const SandboxApiFp = function (configuration?: Configuration) {
|
||||
configuration,
|
||||
)(axios, localVarOperationServerBasePath || basePath)
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Set sandbox auto-delete interval
|
||||
* @param {string} sandboxId ID of the sandbox
|
||||
* @param {number} interval Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
* @param {string} [xDaytonaOrganizationID] Use with JWT to specify the organization ID
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async setAutoDeleteInterval(
|
||||
sandboxId: string,
|
||||
interval: number,
|
||||
xDaytonaOrganizationID?: string,
|
||||
options?: RawAxiosRequestConfig,
|
||||
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.setAutoDeleteInterval(
|
||||
sandboxId,
|
||||
interval,
|
||||
xDaytonaOrganizationID,
|
||||
options,
|
||||
)
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0
|
||||
const localVarOperationServerBasePath =
|
||||
operationServerMap['SandboxApi.setAutoDeleteInterval']?.[localVarOperationServerIndex]?.url
|
||||
return (axios, basePath) =>
|
||||
createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration,
|
||||
)(axios, localVarOperationServerBasePath || basePath)
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Set sandbox auto-stop interval
|
||||
@@ -1391,6 +1474,25 @@ export const SandboxApiFactory = function (configuration?: Configuration, basePa
|
||||
.setAutoArchiveInterval(sandboxId, interval, xDaytonaOrganizationID, options)
|
||||
.then((request) => request(axios, basePath))
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Set sandbox auto-delete interval
|
||||
* @param {string} sandboxId ID of the sandbox
|
||||
* @param {number} interval Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
* @param {string} [xDaytonaOrganizationID] Use with JWT to specify the organization ID
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
setAutoDeleteInterval(
|
||||
sandboxId: string,
|
||||
interval: number,
|
||||
xDaytonaOrganizationID?: string,
|
||||
options?: RawAxiosRequestConfig,
|
||||
): AxiosPromise<void> {
|
||||
return localVarFp
|
||||
.setAutoDeleteInterval(sandboxId, interval, xDaytonaOrganizationID, options)
|
||||
.then((request) => request(axios, basePath))
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Set sandbox auto-stop interval
|
||||
@@ -1667,6 +1769,27 @@ export class SandboxApi extends BaseAPI {
|
||||
.then((request) => request(this.axios, this.basePath))
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Set sandbox auto-delete interval
|
||||
* @param {string} sandboxId ID of the sandbox
|
||||
* @param {number} interval Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
* @param {string} [xDaytonaOrganizationID] Use with JWT to specify the organization ID
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SandboxApi
|
||||
*/
|
||||
public setAutoDeleteInterval(
|
||||
sandboxId: string,
|
||||
interval: number,
|
||||
xDaytonaOrganizationID?: string,
|
||||
options?: RawAxiosRequestConfig,
|
||||
) {
|
||||
return SandboxApiFp(this.configuration)
|
||||
.setAutoDeleteInterval(sandboxId, interval, xDaytonaOrganizationID, options)
|
||||
.then((request) => request(this.axios, this.basePath))
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Set sandbox auto-stop interval
|
||||
|
||||
+6
@@ -103,6 +103,12 @@ export interface CreateSandbox {
|
||||
* @memberof CreateSandbox
|
||||
*/
|
||||
autoArchiveInterval?: number
|
||||
/**
|
||||
* Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
* @type {number}
|
||||
* @memberof CreateSandbox
|
||||
*/
|
||||
autoDeleteInterval?: number
|
||||
/**
|
||||
* Array of volumes to attach to the sandbox
|
||||
* @type {Array<SandboxVolume>}
|
||||
|
||||
Generated
+6
@@ -145,6 +145,12 @@ export interface Sandbox {
|
||||
* @memberof Sandbox
|
||||
*/
|
||||
autoArchiveInterval?: number
|
||||
/**
|
||||
* Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
* @type {number}
|
||||
* @memberof Sandbox
|
||||
*/
|
||||
autoDeleteInterval?: number
|
||||
/**
|
||||
* The domain name of the runner
|
||||
* @type {string}
|
||||
|
||||
Generated
+6
@@ -148,6 +148,12 @@ export interface Workspace {
|
||||
* @memberof Workspace
|
||||
*/
|
||||
autoArchiveInterval?: number
|
||||
/**
|
||||
* Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
||||
* @type {number}
|
||||
* @memberof Workspace
|
||||
*/
|
||||
autoDeleteInterval?: number
|
||||
/**
|
||||
* The domain name of the runner
|
||||
* @type {string}
|
||||
|
||||
@@ -60,7 +60,8 @@ sandbox = daytona.create(CreateSandboxFromSnapshotParams(
|
||||
language="python",
|
||||
env_vars={"PYTHON_ENV": "development"},
|
||||
auto_stop_interval=60, # Auto-stop after 1 hour of inactivity
|
||||
auto_archive_interval=60 # Auto-archive after a Sandbox has been stopped for 1 hour
|
||||
auto_archive_interval=60, # Auto-archive after a Sandbox has been stopped for 1 hour
|
||||
auto_delete_interval=120 # Auto-delete after a Sandbox has been stopped for 2 hours
|
||||
))
|
||||
```
|
||||
|
||||
|
||||
@@ -267,7 +267,8 @@ class AsyncDaytona:
|
||||
snapshot="my-snapshot-id",
|
||||
env_vars={"DEBUG": "true"},
|
||||
auto_stop_interval=0,
|
||||
auto_archive_interval=60
|
||||
auto_archive_interval=60,
|
||||
auto_delete_interval=120
|
||||
)
|
||||
sandbox = await daytona.create(params, timeout=40)
|
||||
```
|
||||
@@ -318,6 +319,7 @@ class AsyncDaytona:
|
||||
resources=Resources(cpu=2, memory=4),
|
||||
auto_stop_interval=0,
|
||||
auto_archive_interval=60,
|
||||
auto_delete_interval=120
|
||||
)
|
||||
sandbox = await daytona.create(
|
||||
params,
|
||||
@@ -377,6 +379,7 @@ class AsyncDaytona:
|
||||
target=str(target) if target else None,
|
||||
auto_stop_interval=params.auto_stop_interval,
|
||||
auto_archive_interval=params.auto_archive_interval,
|
||||
auto_delete_interval=params.auto_delete_interval,
|
||||
volumes=params.volumes,
|
||||
)
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ class AsyncSandbox(SandboxDto):
|
||||
backup_created_at (str): When the backup was created.
|
||||
auto_stop_interval (int): Auto-stop interval in minutes.
|
||||
auto_archive_interval (int): Auto-archive interval in minutes.
|
||||
auto_delete_interval (int): Auto-delete interval in minutes.
|
||||
runner_domain (str): Domain name of the Sandbox runner.
|
||||
volumes (List[str]): Volumes attached to the Sandbox.
|
||||
build_info (str): Build information for the Sandbox if it was created from dynamic build.
|
||||
@@ -367,9 +368,9 @@ class AsyncSandbox(SandboxDto):
|
||||
Example:
|
||||
```python
|
||||
# Auto-archive after 1 hour
|
||||
sandbox.set_autoarchive_interval(60)
|
||||
sandbox.set_auto_archive_interval(60)
|
||||
# Or use the maximum interval
|
||||
sandbox.set_autoarchive_interval(0)
|
||||
sandbox.set_auto_archive_interval(0)
|
||||
```
|
||||
"""
|
||||
if not isinstance(interval, int) or interval < 0:
|
||||
@@ -377,6 +378,30 @@ class AsyncSandbox(SandboxDto):
|
||||
await self._sandbox_api.set_auto_archive_interval(self.id, interval)
|
||||
self.auto_archive_interval = interval
|
||||
|
||||
@intercept_errors(message_prefix="Failed to set auto-delete interval: ")
|
||||
async def set_auto_delete_interval(self, interval: int) -> None:
|
||||
"""Sets the auto-delete interval for the Sandbox.
|
||||
|
||||
The Sandbox will automatically delete after being continuously stopped for the specified interval.
|
||||
|
||||
Args:
|
||||
interval (int): Number of minutes after which a continuously stopped Sandbox will be auto-deleted.
|
||||
Set to negative value to disable auto-delete. Set to 0 to delete immediately upon stopping.
|
||||
By default, auto-delete is disabled.
|
||||
|
||||
Example:
|
||||
```python
|
||||
# Auto-delete after 1 hour
|
||||
sandbox.set_auto_delete_interval(60)
|
||||
# Or delete immediately upon stopping
|
||||
sandbox.set_auto_delete_interval(0)
|
||||
# Or disable auto-delete
|
||||
sandbox.set_auto_delete_interval(-1)
|
||||
```
|
||||
"""
|
||||
await self._sandbox_api.set_auto_delete_interval(self.id, interval)
|
||||
self.auto_delete_interval = interval
|
||||
|
||||
@intercept_errors(message_prefix="Failed to get preview link: ")
|
||||
async def get_preview_link(self, port: int) -> PortPreviewUrl:
|
||||
"""Retrieves the preview link for the sandbox at the specified port. If the port is closed,
|
||||
@@ -434,6 +459,7 @@ class AsyncSandbox(SandboxDto):
|
||||
self.backup_created_at = sandbox_dto.backup_created_at
|
||||
self.auto_stop_interval = sandbox_dto.auto_stop_interval
|
||||
self.auto_archive_interval = sandbox_dto.auto_archive_interval
|
||||
self.auto_delete_interval = sandbox_dto.auto_delete_interval
|
||||
self.runner_domain = sandbox_dto.runner_domain
|
||||
self.volumes = sandbox_dto.volumes
|
||||
self.build_info = sandbox_dto.build_info
|
||||
|
||||
@@ -231,7 +231,8 @@ class Daytona:
|
||||
snapshot="my-snapshot-id",
|
||||
env_vars={"DEBUG": "true"},
|
||||
auto_stop_interval=0,
|
||||
auto_archive_interval=60
|
||||
auto_archive_interval=60,
|
||||
auto_delete_interval=120
|
||||
)
|
||||
sandbox = daytona.create(params, timeout=40)
|
||||
```
|
||||
@@ -282,6 +283,7 @@ class Daytona:
|
||||
resources=Resources(cpu=2, memory=4),
|
||||
auto_stop_interval=0,
|
||||
auto_archive_interval=60,
|
||||
auto_delete_interval=120
|
||||
)
|
||||
sandbox = daytona.create(
|
||||
params,
|
||||
@@ -341,6 +343,7 @@ class Daytona:
|
||||
target=str(target) if target else None,
|
||||
auto_stop_interval=params.auto_stop_interval,
|
||||
auto_archive_interval=params.auto_archive_interval,
|
||||
auto_delete_interval=params.auto_delete_interval,
|
||||
volumes=params.volumes,
|
||||
)
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ class Sandbox(SandboxDto):
|
||||
backup_created_at (str): When the backup was created.
|
||||
auto_stop_interval (int): Auto-stop interval in minutes.
|
||||
auto_archive_interval (int): Auto-archive interval in minutes.
|
||||
auto_delete_interval (int): Auto-delete interval in minutes.
|
||||
runner_domain (str): Domain name of the Sandbox runner.
|
||||
volumes (List[str]): Volumes attached to the Sandbox.
|
||||
build_info (str): Build information for the Sandbox if it was created from dynamic build.
|
||||
@@ -371,9 +372,9 @@ class Sandbox(SandboxDto):
|
||||
Example:
|
||||
```python
|
||||
# Auto-archive after 1 hour
|
||||
sandbox.set_autoarchive_interval(60)
|
||||
sandbox.set_auto_archive_interval(60)
|
||||
# Or use the maximum interval
|
||||
sandbox.set_autoarchive_interval(0)
|
||||
sandbox.set_auto_archive_interval(0)
|
||||
```
|
||||
"""
|
||||
if not isinstance(interval, int) or interval < 0:
|
||||
@@ -381,6 +382,30 @@ class Sandbox(SandboxDto):
|
||||
self._sandbox_api.set_auto_archive_interval(self.id, interval)
|
||||
self.auto_archive_interval = interval
|
||||
|
||||
@intercept_errors(message_prefix="Failed to set auto-delete interval: ")
|
||||
def set_auto_delete_interval(self, interval: int) -> None:
|
||||
"""Sets the auto-delete interval for the Sandbox.
|
||||
|
||||
The Sandbox will automatically delete after being continuously stopped for the specified interval.
|
||||
|
||||
Args:
|
||||
interval (int): Number of minutes after which a continuously stopped Sandbox will be auto-deleted.
|
||||
Set to negative value to disable auto-delete. Set to 0 to delete immediately upon stopping.
|
||||
By default, auto-delete is disabled.
|
||||
|
||||
Example:
|
||||
```python
|
||||
# Auto-delete after 1 hour
|
||||
sandbox.set_auto_delete_interval(60)
|
||||
# Or delete immediately upon stopping
|
||||
sandbox.set_auto_delete_interval(0)
|
||||
# Or disable auto-delete
|
||||
sandbox.set_auto_delete_interval(-1)
|
||||
```
|
||||
"""
|
||||
self._sandbox_api.set_auto_delete_interval(self.id, interval)
|
||||
self.auto_delete_interval = interval
|
||||
|
||||
@intercept_errors(message_prefix="Failed to get preview link: ")
|
||||
def get_preview_link(self, port: int) -> PortPreviewUrl:
|
||||
"""Retrieves the preview link for the sandbox at the specified port. If the port is closed,
|
||||
@@ -438,6 +463,7 @@ class Sandbox(SandboxDto):
|
||||
self.backup_created_at = sandbox_dto.backup_created_at
|
||||
self.auto_stop_interval = sandbox_dto.auto_stop_interval
|
||||
self.auto_archive_interval = sandbox_dto.auto_archive_interval
|
||||
self.auto_delete_interval = sandbox_dto.auto_delete_interval
|
||||
self.runner_domain = sandbox_dto.runner_domain
|
||||
self.volumes = sandbox_dto.volumes
|
||||
self.build_info = sandbox_dto.build_info
|
||||
|
||||
@@ -105,6 +105,9 @@ class CreateSandboxBaseParams(BaseModel):
|
||||
auto_archive_interval (Optional[int]): Interval in minutes after which a continuously stopped Sandbox will
|
||||
automatically archive. Default is 7 days.
|
||||
0 means the maximum interval will be used.
|
||||
auto_delete_interval (Optional[int]): Interval in minutes after which a continuously stopped Sandbox will
|
||||
automatically be deleted. By default, auto-delete is disabled.
|
||||
Negative value means disabled, 0 means delete immediately upon stopping.
|
||||
"""
|
||||
|
||||
language: Optional[CodeLanguage] = None
|
||||
@@ -114,6 +117,7 @@ class CreateSandboxBaseParams(BaseModel):
|
||||
public: Optional[bool] = None
|
||||
auto_stop_interval: Optional[int] = None
|
||||
auto_archive_interval: Optional[int] = None
|
||||
auto_delete_interval: Optional[int] = None
|
||||
volumes: Optional[List[VolumeMount]] = None
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ const sandbox = await daytona.create({
|
||||
envVars: { NODE_ENV: 'development' },
|
||||
autoStopInterval: 60, // Auto-stop after 1 hour of inactivity,
|
||||
autoArchiveInterval: 60, // Auto-archive after a Sandbox has been stopped for 1 hour
|
||||
autoDeleteInterval: 120, // Auto-delete after a Sandbox has been stopped for 2 hours
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ export interface Resources {
|
||||
* @property {boolean} [public] - Is the Sandbox port preview public
|
||||
* @property {number} [autoStopInterval] - Auto-stop interval in minutes (0 means disabled). Default is 15 minutes.
|
||||
* @property {number} [autoArchiveInterval] - Auto-archive interval in minutes (0 means the maximum interval will be used). Default is 7 days.
|
||||
* @property {number} [autoDeleteInterval] - Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping). By default, auto-delete is disabled.
|
||||
*/
|
||||
export type CreateSandboxBaseParams = {
|
||||
user?: string
|
||||
@@ -134,6 +135,7 @@ export type CreateSandboxBaseParams = {
|
||||
public?: boolean
|
||||
autoStopInterval?: number
|
||||
autoArchiveInterval?: number
|
||||
autoDeleteInterval?: number
|
||||
volumes?: VolumeMount[]
|
||||
}
|
||||
|
||||
@@ -327,7 +329,9 @@ export class Daytona {
|
||||
* NODE_ENV: 'development',
|
||||
* DEBUG: 'true'
|
||||
* },
|
||||
* autoStopInterval: 60
|
||||
* autoStopInterval: 60,
|
||||
* autoArchiveInterval: 60,
|
||||
* autoDeleteInterval: 120
|
||||
* };
|
||||
* const sandbox = await daytona.create(params, { timeout: 100 });
|
||||
*/
|
||||
@@ -360,7 +364,9 @@ export class Daytona {
|
||||
* cpu: 2,
|
||||
* memory: 4 // 4GB RAM
|
||||
* },
|
||||
* autoStopInterval: 60
|
||||
* autoStopInterval: 60,
|
||||
* autoArchiveInterval: 60,
|
||||
* autoDeleteInterval: 120
|
||||
* };
|
||||
* const sandbox = await daytona.create(params, { timeout: 100, onSnapshotCreateLogs: console.log });
|
||||
*/
|
||||
@@ -450,6 +456,7 @@ export class Daytona {
|
||||
disk: resources?.disk,
|
||||
autoStopInterval: params.autoStopInterval,
|
||||
autoArchiveInterval: params.autoArchiveInterval,
|
||||
autoDeleteInterval: params.autoDeleteInterval,
|
||||
volumes: params.volumes,
|
||||
},
|
||||
undefined,
|
||||
|
||||
@@ -55,6 +55,7 @@ export interface SandboxCodeToolbox {
|
||||
* @property {string} [backupCreatedAt] - When the backup was created
|
||||
* @property {number} [autoStopInterval] - Auto-stop interval in minutes
|
||||
* @property {number} [autoArchiveInterval] - Auto-archive interval in minutes
|
||||
* @property {number} [autoDeleteInterval] - Auto-delete interval in minutes
|
||||
* @property {string} [runnerDomain] - Domain name of the Sandbox runner
|
||||
* @property {Array<SandboxVolume>} [volumes] - Volumes attached to the Sandbox
|
||||
* @property {BuildInfo} [buildInfo] - Build information for the Sandbox if it was created from dynamic build
|
||||
@@ -87,6 +88,7 @@ export class Sandbox implements SandboxDto {
|
||||
public backupCreatedAt?: string
|
||||
public autoStopInterval?: number
|
||||
public autoArchiveInterval?: number
|
||||
public autoDeleteInterval?: number
|
||||
public runnerDomain?: string
|
||||
public volumes?: Array<SandboxVolume>
|
||||
public buildInfo?: BuildInfo
|
||||
@@ -382,6 +384,29 @@ export class Sandbox implements SandboxDto {
|
||||
this.autoArchiveInterval = interval
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the auto-delete interval for the Sandbox.
|
||||
*
|
||||
* The Sandbox will automatically delete after being continuously stopped for the specified interval.
|
||||
*
|
||||
* @param {number} interval - Number of minutes after which a continuously stopped Sandbox will be auto-deleted.
|
||||
* Set to negative value to disable auto-delete. Set to 0 to delete immediately upon stopping.
|
||||
* By default, auto-delete is disabled.
|
||||
* @returns {Promise<void>}
|
||||
*
|
||||
* @example
|
||||
* // Auto-delete after 1 hour
|
||||
* await sandbox.setAutoDeleteInterval(60);
|
||||
* // Or delete immediately upon stopping
|
||||
* await sandbox.setAutoDeleteInterval(0);
|
||||
* // Or disable auto-delete
|
||||
* await sandbox.setAutoDeleteInterval(-1);
|
||||
*/
|
||||
public async setAutoDeleteInterval(interval: number): Promise<void> {
|
||||
await this.sandboxApi.setAutoDeleteInterval(this.id, interval)
|
||||
this.autoDeleteInterval = interval
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the preview link for the sandbox at the specified port. If the port is closed,
|
||||
* it will be opened automatically. For private sandboxes, a token is included to grant access
|
||||
@@ -443,6 +468,7 @@ export class Sandbox implements SandboxDto {
|
||||
this.backupCreatedAt = sandboxDto.backupCreatedAt
|
||||
this.autoStopInterval = sandboxDto.autoStopInterval
|
||||
this.autoArchiveInterval = sandboxDto.autoArchiveInterval
|
||||
this.autoDeleteInterval = sandboxDto.autoDeleteInterval
|
||||
this.runnerDomain = sandboxDto.runnerDomain
|
||||
this.volumes = sandboxDto.volumes
|
||||
this.buildInfo = sandboxDto.buildInfo
|
||||
|
||||
+1
-1
@@ -63,4 +63,4 @@ disable = [
|
||||
"C0302", # too-many-lines
|
||||
]
|
||||
const-rgx = "(([A-Z_][A-Z0-9_]*)|([a-z_][a-z0-9_]*))"
|
||||
allowed-redefined-builtins = ["id"]
|
||||
allowed-redefined-builtins = ["id"]
|
||||
Reference in New Issue
Block a user