custom_domains
Creates, updates, deletes, gets or lists a custom_domains resource.
Overview​
| Name | custom_domains |
| Type | Resource |
| Id | railway.networking.custom_domains |
Fields​
The following fields are returned by SELECT queries:
- list
- get
One row per CustomDomain.
| Name | Datatype | Description |
|---|---|---|
id | string | |
edge_id | string | |
environment_id | string | |
project_id | string | |
service_id | string | |
created_at | string (date-time) | |
deleted_at | string (date-time) | |
domain | string | |
is_railway_domain | boolean | |
status | object | CustomDomainStatus object |
sync_status | string | (ACTIVE, CREATING, DELETED, DELETING, UNSPECIFIED, UPDATING) |
target_port | integer | |
updated_at | string (date-time) |
One CustomDomain row.
| Name | Datatype | Description |
|---|---|---|
id | string | |
edge_id | string | |
environment_id | string | |
project_id | string | |
service_id | string | |
created_at | string (date-time) | |
deleted_at | string (date-time) | |
domain | string | |
is_railway_domain | boolean | |
status | object | CustomDomainStatus object |
sync_status | string | (ACTIVE, CREATING, DELETED, DELETING, UNSPECIFIED, UPDATING) |
target_port | integer | |
updated_at | string (date-time) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | environment_id, project_id, service_id | Lists CustomDomain objects of a AllDomains. Backed by the Railway GraphQL query domains.customDomains. | |
get | select | id, project_id | Fetch details for a custom domain. Backed by the Railway GraphQL query customDomain. | |
create | insert | domain, environment_id, project_id, service_id | Creates a new custom domain. Backed by the Railway GraphQL mutation customDomainCreate. | |
update | update | environment_id, id | Updates a custom domain. Backed by the Railway GraphQL mutation customDomainUpdate. | |
delete | delete | id | Deletes a custom domain. Backed by the Railway GraphQL mutation customDomainDelete. | |
issue_certificate | exec | id | Issues a new certificate. Backed by the Railway GraphQL mutation customDomainIssueCertificate. |
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 |
|---|---|---|
environment_id | string | |
id | string | |
project_id | string | |
service_id | string | |
domain | string |
SELECT examples​
- list
- get
Lists CustomDomain objects of a AllDomains. Backed by the Railway GraphQL query domains.customDomains.
SELECT
id,
edge_id,
environment_id,
project_id,
service_id,
created_at,
deleted_at,
domain,
is_railway_domain,
status,
sync_status,
target_port,
updated_at
FROM railway.networking.custom_domains
WHERE environment_id = '{{ environment_id }}' -- required
AND project_id = '{{ project_id }}' -- required
AND service_id = '{{ service_id }}' -- required
;
Fetch details for a custom domain. Backed by the Railway GraphQL query customDomain.
SELECT
id,
edge_id,
environment_id,
project_id,
service_id,
created_at,
deleted_at,
domain,
is_railway_domain,
status,
sync_status,
target_port,
updated_at
FROM railway.networking.custom_domains
WHERE id = '{{ id }}' -- required
AND project_id = '{{ project_id }}' -- required
;
INSERT examples​
- create
- Manifest
Creates a new custom domain. Backed by the Railway GraphQL mutation customDomainCreate.
INSERT INTO railway.networking.custom_domains (
domain,
environment_id,
project_id,
service_id,
target_port
)
SELECT
'{{ domain }}' /* required */,
'{{ environment_id }}' /* required */,
'{{ project_id }}' /* required */,
'{{ service_id }}' /* required */,
{{ target_port }}
RETURNING
id,
edge_id,
environment_id,
project_id,
service_id,
created_at,
deleted_at,
domain,
is_railway_domain,
status,
sync_status,
target_port,
updated_at
;
# Description fields are for documentation purposes
- name: custom_domains
props:
- name: domain
value: "{{ domain }}"
- name: environment_id
value: "{{ environment_id }}"
- name: project_id
value: "{{ project_id }}"
- name: service_id
value: "{{ service_id }}"
- name: target_port
value: {{ target_port }}
UPDATE examples​
- update
Updates a custom domain. Backed by the Railway GraphQL mutation customDomainUpdate.
UPDATE railway.networking.custom_domains
SET
target_port = '{{ target_port }}'
WHERE
environment_id = '{{ environment_id }}' --required
AND id = '{{ id }}' --required
RETURNING
result;
DELETE examples​
- delete
Deletes a custom domain. Backed by the Railway GraphQL mutation customDomainDelete.
DELETE FROM railway.networking.custom_domains
WHERE
id = '{{ id }}' --required
;
Lifecycle Methods​
- issue_certificate
Issues a new certificate. Backed by the Railway GraphQL mutation customDomainIssueCertificate.
EXEC railway.networking.custom_domains.issue_certificate
@id='{{ id }}' --required
;