Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 3a34f44

Browse files
authored
refactor(docs): add resources, regions and preview port docs (#320)
Signed-off-by: Luka Brecic <[email protected]>
1 parent 594f96e commit 3a34f44

File tree

6 files changed

+316
-72
lines changed

6 files changed

+316
-72
lines changed

public/llms-full.txt

Lines changed: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,6 +1504,38 @@ Organization and they may proceed by issuing a new API key and creating sandboxe
15041504

15051505
The Settings subpage in the Dashboard allows you to view the Organization ID and Name and to delete the Organization if you don't need it anymore. This action is irreversible, so please proceed with caution. Personal Organizations are there by default and cannot be deleted.
15061506

1507+
title: Other
1508+
1509+
import { Tabs, TabItem } from '@astrojs/starlight/components';
1510+
1511+
## Region Selection
1512+
1513+
Daytona is currently available in the following regions:
1514+
1515+
- United States (US)
1516+
- Europe (EU)
1517+
1518+
You can select the region during the Daytona [configuration](/docs/configuration) step.
1519+
1520+
```python
1521+
from daytona_sdk import Daytona, DaytonaConfig, SandboxTargetRegion
1522+
1523+
config = DaytonaConfig(
1524+
target=SandboxTargetRegion.US
1525+
)
1526+
1527+
daytona = Daytona(config)
1528+
1529+
```
1530+
1531+
```typescript
1532+
import { Daytona, SandboxTargetRegion } from '@daytonaio/sdk';
1533+
1534+
const daytona: Daytona = new Daytona({
1535+
target: SandboxTargetRegion.US
1536+
});
1537+
```
1538+
15071539
title: Process and Code Execution
15081540

15091541
import { Tabs, TabItem } from '@astrojs/starlight/components';
@@ -1793,6 +1825,52 @@ const sandbox = await daytona.create({ id: 'my-sandbox' });
17931825
Daytona keeps a pool of ready-to-go "warm" Sandboxes. When available, they are automatically used if a custom ID _isn't_ provided and the default image is used, reducing the creation time down to a fraction of a second.
17941826
:::
17951827

1828+
### Sandbox Resources
1829+
1830+
You can configure the compute resources allocated to your Sandbox using the `SandboxResources` class. This allows you to specify the number of CPU cores, the memory and disk space.
1831+
1832+
```python
1833+
from daytona_sdk import Daytona, CreateSandboxParams, SandboxResources
1834+
1835+
daytona = Daytona()
1836+
1837+
# Create a Sandbox with custom resources
1838+
1839+
resources = SandboxResources(
1840+
cpu=2, # 2 CPU cores
1841+
memory=4, # 4GB RAM
1842+
disk=20, # 20GB disk space
1843+
)
1844+
1845+
params = CreateSandboxParams(
1846+
language="python",
1847+
resources=resources
1848+
)
1849+
1850+
sandbox = daytona.create(params)
1851+
1852+
```
1853+
```typescript
1854+
import { Daytona } from '@daytonaio/sdk';
1855+
1856+
const daytona = new Daytona();
1857+
1858+
// Create a Sandbox with custom resources
1859+
const sandbox = await daytona.create({
1860+
language: 'typescript',
1861+
resources: {
1862+
cpu: 2, // 2 CPU cores
1863+
memory: 4, // 4GB RAM
1864+
disk: 20, // 20GB disk space
1865+
}
1866+
});
1867+
```
1868+
1869+
1870+
:::note
1871+
All resource parameters are optional. If not specified, Daytona will use default values appropriate for the selected language and use case.
1872+
:::
1873+
17961874
## Sandbox Information
17971875

17981876
Daytona SDK provides methods to get information about a Sandbox, such as ID, root directory, and status using Python and TypeScript.
@@ -1811,10 +1889,6 @@ name = sandbox.instance.name
18111889
image = sandbox.instance.image
18121890
state = sandbox.instance.state
18131891

1814-
# Get the preview link for an app running on port 3000
1815-
1816-
preview_link = sandbox.get_preview_link(3000)
1817-
18181892
```
18191893
```typescript
18201894
// Get Sandbox ID
@@ -1828,7 +1902,22 @@ const name = sandbox.instance.name
18281902
const image = sandbox.instance.image
18291903
const state = sandbox.instance.state
18301904

1905+
```
1906+
1907+
1908+
### Sandbox Preview Port
1909+
1910+
Daytona SDK also provides a method to get the preview port for the Sandbox.
1911+
1912+
```python
1913+
# Get the preview link for an app running on port 3000
1914+
1915+
preview_link = sandbox.get_preview_link(3000)
1916+
1917+
```
1918+
```typescript
18311919
// Get the preview link for an app running on port 3000
1920+
18321921
const previewLink = sandbox.getPreviewLink(3000)
18331922

18341923
```

public/llms.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
- [Available Assignments](https://daytona.io/docs/organizations#available-assignments)
6262
- [Managing Invitations](https://daytona.io/docs/organizations#managing-invitations)
6363
- [Settings](https://daytona.io/docs/organizations#settings)
64+
- [Other](https://daytona.io/docs/other)
65+
- [Region Selection](https://daytona.io/docs/other#region-selection)
6466
- [Process and Code Execution](https://daytona.io/docs/process-code-execution)
6567
- [Code Execution](https://daytona.io/docs/process-code-execution#code-execution)
6668
- [Running Code](https://daytona.io/docs/process-code-execution#running-code)
@@ -82,7 +84,9 @@
8284
- [Sandbox Management](https://daytona.io/docs/sandbox-management)
8385
- [Creating Sandboxes](https://daytona.io/docs/sandbox-management#creating-sandboxes)
8486
- [Basic Sandbox Creation](https://daytona.io/docs/sandbox-management#basic-sandbox-creation)
87+
- [Sandbox Resources](https://daytona.io/docs/sandbox-management#sandbox-resources)
8588
- [Sandbox Information](https://daytona.io/docs/sandbox-management#sandbox-information)
89+
- [Sandbox Preview Port](https://daytona.io/docs/sandbox-management#sandbox-preview-port)
8690
- [Remove Sandbox](https://daytona.io/docs/sandbox-management#remove-sandbox)
8791
- [Sandbox States and Persistence](https://daytona.io/docs/sandbox-management#sandbox-states-and-persistence)
8892
- [Running](https://daytona.io/docs/sandbox-management#running)

0 commit comments

Comments
 (0)