Skip to main content

volumes

Creates, updates, deletes, gets or lists a volumes resource.

Overview​

Namevolumes
TypeResource
Idrailway.storage.volumes

Fields​

The following fields are returned by SELECT queries:

One row per Volume.

NameDatatypeDescription
idstring
namestring
project_idstring
created_atstring (date-time)
projectobjectProject object

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectproject_idLists Volume objects of a Project. Backed by the Railway GraphQL query project.volumes.
createinsertmount_path, project_idCreate a persistent volume in a project. Backed by the Railway GraphQL mutation volumeCreate.
updateupdatevolume_idUpdate a persistent volume in a project. Backed by the Railway GraphQL mutation volumeUpdate.
deletedeletevolume_idDelete a persistent volume in a project. Backed by the Railway GraphQL mutation volumeDelete.

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.

NameDatatypeDescription
project_idstring
mount_pathstringThe path in the container to mount the volume to.
volume_idstring

SELECT examples​

Lists Volume objects of a Project. Backed by the Railway GraphQL query project.volumes.

SELECT
id,
name,
project_id,
created_at,
project
FROM railway.storage.volumes
WHERE project_id = '{{ project_id }}' -- required
;

INSERT examples​

Create a persistent volume in a project. Backed by the Railway GraphQL mutation volumeCreate.

INSERT INTO railway.storage.volumes (
environment_id,
mount_path,
project_id,
region,
service_id
)
SELECT
'{{ environment_id }}',
'{{ mount_path }}' /* required */,
'{{ project_id }}' /* required */,
'{{ region }}',
'{{ service_id }}'
RETURNING
id,
name,
project_id,
created_at,
project
;

UPDATE examples​

Update a persistent volume in a project. Backed by the Railway GraphQL mutation volumeUpdate.

UPDATE railway.storage.volumes
SET
name = '{{ name }}'
WHERE
volume_id = '{{ volume_id }}' --required
RETURNING
id,
name,
project_id,
created_at,
project;

DELETE examples​

Delete a persistent volume in a project. Backed by the Railway GraphQL mutation volumeDelete.

DELETE FROM railway.storage.volumes
WHERE
volume_id = '{{ volume_id }}' --required
;