Is there a railway api for restarting a service?
Hi Folks,
Is there an api i can use to trigger a restart for a service?
Thanks guys
7 Replies
Project ID:
N/A
N/A
i'm not too good at this, any guide on how i can trigger this from my code?
some tips / info
- you would need to use railways public api
- it's a graphql api
- that's the mutation you would have to use
- you'd want to use a graphql client library to make the job easier
- that mutation requires a deploymentId input
- if your code is restarting itself there is a
RAILWAY_DEPLOYMENT_ID
environment variable
- if your code is restarting a different service you will have to call the deployments
query and filter the results by created date and pick the latest successful deployment to restartthanks for this man, i'm still figuring how to work this out, but helps
if you need any more info let me know