R
Railway15mo ago
Yash

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
Percy
Percy15mo ago
Project ID: N/A
Yash
YashOP15mo ago
N/A
Yash
YashOP15mo ago
i'm not too good at this, any guide on how i can trigger this from my code?
Brody
Brody15mo ago
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 restart
Yash
YashOP14mo ago
thanks for this man, i'm still figuring how to work this out, but helps
Brody
Brody14mo ago
if you need any more info let me know
Want results from more Discord servers?
Add your server