buckets
Creates, updates, deletes, gets or lists a buckets resource.
Overview​
| Name | buckets |
| Type | Resource |
| Id | railway.storage.buckets |
Fields​
The following fields are returned by SELECT queries:
- list
One row per Bucket.
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | |
group_id | string | |
parent_service_id | string | |
project_id | string | |
created_at | string (date-time) | |
deleted_at | string (date-time) | |
project | object | Project object |
updated_at | string (date-time) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | project_id | Lists Bucket objects of a Project. Backed by the Railway GraphQL query project.buckets. | |
create | insert | project_id | Create a bucket in a project. Backed by the Railway GraphQL mutation bucketCreate. | |
update | update | id, name | Updates a bucket. Backed by the Railway GraphQL mutation bucketUpdate. |
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 |
|---|---|---|
project_id | string | |
id | string | |
name | string | The name of the bucket. |
SELECT examples​
- list
Lists Bucket objects of a Project. Backed by the Railway GraphQL query project.buckets.
SELECT
id,
name,
group_id,
parent_service_id,
project_id,
created_at,
deleted_at,
project,
updated_at
FROM railway.storage.buckets
WHERE project_id = '{{ project_id }}' -- required
;
INSERT examples​
- create
- Manifest
Create a bucket in a project. Backed by the Railway GraphQL mutation bucketCreate.
INSERT INTO railway.storage.buckets (
environment_id,
name,
project_id
)
SELECT
'{{ environment_id }}',
'{{ name }}',
'{{ project_id }}' /* required */
RETURNING
id,
name,
group_id,
parent_service_id,
project_id,
created_at,
deleted_at,
project,
updated_at
;
# Description fields are for documentation purposes
- name: buckets
props:
- name: environment_id
value: "{{ environment_id }}"
description: |
[unimplemented] The environment to deploy the bucket instances into. If `null`, the bucket will not be deployed to any environment. `undefined` will deploy to all environments.
- name: name
value: "{{ name }}"
description: |
The name of the bucket.
- name: project_id
value: "{{ project_id }}"
description: |
The project to create the bucket in.
UPDATE examples​
- update
Updates a bucket. Backed by the Railway GraphQL mutation bucketUpdate.
UPDATE railway.storage.buckets
SET
WHERE
id = '{{ id }}' --required
AND name = '{{ name }}' --required
RETURNING
id,
name,
group_id,
parent_service_id,
project_id,
created_at,
deleted_at,
project,
updated_at;