drives
Creates, updates, deletes, gets or lists a drives resource.
Overview
| Name | drives |
| Type | Resource |
| Id | vercel.sandboxes.drives |
Fields
The following fields are returned by SELECT queries:
- list
This object contains information related to a Vercel Sandbox Drive.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique drive ID. (example: drive_abc123) |
name | string | The unique drive name within the project. (example: workspace) |
current_session_id | string | Current session ID the drive is attached to, if any. (example: sbx_123) (wire: currentSessionId) |
project_id | string | The project that owns the drive. (example: prj_abc123) (wire: projectId) |
current_sandbox_name | string | Current sandbox name the drive is attached to, if any. (example: my-sandbox) (wire: currentSandboxName) |
created_at | number | The time when the drive was created, in milliseconds since the epoch. (wire: createdAt) |
max_size_bytes | number | The maximum drive size in bytes. (wire: maxSizeBytes) |
region | string | The region where the drive is stored. (example: iad1) |
updated_at | number | The last time the drive was updated, in milliseconds since the epoch. (wire: updatedAt) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | project_id, limit, cursor, sort_by, name_prefix, sort_order, team_id, slug | Retrieves a paginated list of drives belonging to a specific project. Drives are in private beta. Register your interest to get access: https://vercel.com/changelog/drives-for-vercel-sandbox-in-private-beta | |
get_or_create | insert | name | team_id, slug | Gets an existing drive by project and name, or creates it when it does not exist. Drives are in private beta. Register your interest to get access: https://vercel.com/changelog/drives-for-vercel-sandbox-in-private-beta |
delete | delete | name | project_id, team_id, slug | Deletes a drive by project and name. Attached drives cannot be deleted. Stop or replace the session currently using the drive before retrying deletion. Drives are in private beta. Register your interest to get access: https://vercel.com/changelog/drives-for-vercel-sandbox-in-private-beta |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
name | string | Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores). |
cursor | string | Opaque pagination cursor from a previous response. |
limit | number | Maximum number of drives to return in the response. Used for pagination. |
name_prefix | string | Filter drives whose name starts with this prefix. Only valid when sortBy=name. (wire: namePrefix) |
project_id | string | The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project. (wire: projectId) |
slug | string | The Team slug to perform the request on behalf of. |
sort_by | string | Field to sort drives by. (wire: sortBy) |
sort_order | string | Sort direction for results. (wire: sortOrder) |
team_id | string | The Team identifier to perform the request on behalf of. (wire: teamId) |
SELECT examples
- list
Retrieves a paginated list of drives belonging to a specific project. Drives are in private beta. Register your interest to get access: https://vercel.com/changelog/drives-for-vercel-sandbox-in-private-beta
SELECT
id,
name,
current_session_id,
project_id,
current_sandbox_name,
created_at,
max_size_bytes,
region,
updated_at
FROM vercel.sandboxes.drives
WHERE project_id = '{{ project_id }}'
AND limit = '{{ limit }}'
AND cursor = '{{ cursor }}'
AND sort_by = '{{ sort_by }}'
AND name_prefix = '{{ name_prefix }}'
AND sort_order = '{{ sort_order }}'
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
INSERT examples
- get_or_create
- Manifest
Gets an existing drive by project and name, or creates it when it does not exist. Drives are in private beta. Register your interest to get access: https://vercel.com/changelog/drives-for-vercel-sandbox-in-private-beta
INSERT INTO vercel.sandboxes.drives (
project_id,
max_size_bytes,
region,
name,
team_id,
slug
)
SELECT
'{{ project_id }}',
{{ max_size_bytes }},
'{{ region }}',
'{{ name }}',
'{{ team_id }}',
'{{ slug }}'
RETURNING
drive
;
# Description fields are for documentation purposes
- name: drives
props:
- name: name
value: "{{ name }}"
description: Required parameter for the drives resource.
- name: project_id
value: "{{ project_id }}"
description: |
The project ID or name to associate the drive with. Required unless using a Vercel OIDC token scoped to a project.
- name: max_size_bytes
value: {{ max_size_bytes }}
description: |
Maximum drive size in bytes. Defaults to 1 TiB when omitted (1 GiB for Hobby). The maximum quota is 16 TiB. Request a quota above 16 TiB at https://vercel.com/help.
- name: region
value: "{{ region }}"
description: |
Region where the drive is stored. Defaults to iad1.
valid_values: ['iad1', 'sfo1', 'cle1', 'cdg1', 'fra1', 'arn1', 'sin1', 'pdx1', 'lhr1', 'icn1', 'bom1', 'cpt1', 'dub1', 'gru1', 'hkg1', 'syd1', 'yul1', 'hnd1', 'kix1']
default: iad1
- name: team_id
value: "{{ team_id }}"
description: The Team identifier to perform the request on behalf of.
description: The Team identifier to perform the request on behalf of.
- name: slug
value: "{{ slug }}"
description: The Team slug to perform the request on behalf of.
description: The Team slug to perform the request on behalf of.
DELETE examples
- delete
Deletes a drive by project and name. Attached drives cannot be deleted. Stop or replace the session currently using the drive before retrying deletion. Drives are in private beta. Register your interest to get access: https://vercel.com/changelog/drives-for-vercel-sandbox-in-private-beta
DELETE FROM vercel.sandboxes.drives
WHERE name = '{{ name }}' --required
AND project_id = '{{ project_id }}'
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;