Skip to main content

volume_instances

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

Overview​

Namevolume_instances
TypeResource
Idrailway.storage.volume_instances

Fields​

The following fields are returned by SELECT queries:

One VolumeInstance row.

NameDatatypeDescription
idstring
environment_idstring
external_idstring
service_idstring
volume_idstring
created_atstring (date-time)
current_size_mbnumber
deleted_atstring (date-time)
environmentobjectEnvironment object
is_pending_deletionboolean
mount_pathstring
regionstring
size_mbinteger
statestring (DELETED, DELETING, ERROR, MIGRATING, MIGRATION_PENDING, READY, RESTORING, UPDATING)
volumeobjectVolume object

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectidGet a single volume instance by id. Backed by the Railway GraphQL query volumeInstance.
listselectenvironment_idproject_idLists VolumeInstance objects of a Environment. Backed by the Railway GraphQL query environment.volumeInstances.
updateupdatevolume_idUpdate a volume instance. If no environmentId is provided, all volume instances for the volume will be updated. Backed by the Railway GraphQL mutation volumeInstanceUpdate.
pitr_restoreexectarget_timestamp, volume_instance_idnew_service_name, source_repo_pathPoint-in-time restore. Creates a brand-new database service in the project, recovered to the target timestamp from the source service's backup history. The source service stays online and untouched. Backed by the Railway GraphQL mutation volumeInstancePITRRestore.

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
environment_idstring
idstring
project_idstring
new_service_namestringOptional name for the new restored service. Defaults to '<source>-restored-YYYYMMDD-HHMM'.
source_repo_pathstringOpaque identifier for one archive history, from the multi-history picker when the source bucket holds more than one. It scopes both the restore-window pre-check and the restored fork's archive source, treating the selected history as frozen. Pass null to restore the source's current history.
target_timestampstring (date-time)Point-in-time target. Must be within the available restore window.
volume_idstringThe id of the volume to update.
volume_instance_idstringThe id of the volume instance to restore from.

SELECT examples​

Get a single volume instance by id. Backed by the Railway GraphQL query volumeInstance.

SELECT
id,
environment_id,
external_id,
service_id,
volume_id,
created_at,
current_size_mb,
deleted_at,
environment,
is_pending_deletion,
mount_path,
region,
size_mb,
state,
volume
FROM railway.storage.volume_instances
WHERE id = '{{ id }}' -- required
;

UPDATE examples​

Update a volume instance. If no environmentId is provided, all volume instances for the volume will be updated. Backed by the Railway GraphQL mutation volumeInstanceUpdate.

UPDATE railway.storage.volume_instances
SET
environment_id = '{{ environment_id }}',
mount_path = '{{ mount_path }}',
service_id = '{{ service_id }}',
state = '{{ state }}'
WHERE
volume_id = '{{ volume_id }}' --required
RETURNING
result;

Lifecycle Methods​

Point-in-time restore. Creates a brand-new database service in the project, recovered to the target timestamp from the source service's backup history. The source service stays online and untouched. Backed by the Railway GraphQL mutation volumeInstancePITRRestore.

EXEC railway.storage.volume_instances.pitr_restore
@target_timestamp='{{ target_timestamp }}', --required
@volume_instance_id='{{ volume_instance_id }}', --required
@new_service_name='{{ new_service_name }}',
@source_repo_path='{{ source_repo_path }}'
;