what is the equivalent public API call for a cronjob service trigger?
patod01
HOBBYOP

a year ago

Let's say I want to trigger a back up from a database with a command in my CLI. What mutation should I use? deploymentRestart and deploymentTriggerCreate look like good candidates

Solved

33 Replies

patod01
HOBBYOP

a year ago

N/A


jaredlunde
EMPLOYEE

a year ago

I thinkdeploymentInstanceExecutionCreate is what you're looking for


a year ago

@Brody any idea who the best person to ask for API questions is?


a year ago

me


a year ago

That works lol


a year ago

Any ideas on the above


a year ago

is this a native railway backup?


a year ago

@patod01 ^^


patod01
HOBBYOP

a year ago

i'm back! Thank you, Adam, for the sponsor


patod01
HOBBYOP

a year ago

that was more of an example rather than my actual case


patod01
HOBBYOP

a year ago

all that I need is being able of triggering a service as a cronjob would do, but from the API


patod01
HOBBYOP

a year ago

the service in question is a docker instance. I could duplicate it so I can give it 2 cronjobs, because I need it to run in different moments depending of the day. On fridays it must run at 2pm and the rest of the week it must run at 6pm


patod01
HOBBYOP

a year ago

the problem increases in complexity when I need to add a new volume and a new cronjob for each duplication of the service.


patod01
HOBBYOP

a year ago

The service is a script that runs, does what it needs to do and then exits.


a year ago

how many services do you think you'd end up having?


patod01
HOBBYOP

a year ago

the problem is that the image it depends on is heavy. The image alone is 1 giga. So I thought it would be better to have a simple bun function that calls it every time and having that bun function with a cronjob to check if it has to call the service every hour, for example


patod01
HOBBYOP

a year ago

it's undefined atm


a year ago

a lot?


patod01
HOBBYOP

a year ago

idk if it's a lot, but 20 for me is crazy


a year ago

could you bake in a simple binary into your desired image, then that binary could run as PID 1, start a web server, then you can call it to start the job, then you'd only need one service


patod01
HOBBYOP

a year ago

well, I haven't thought enough the cronjob, but in essence, it would be 1 service per cronjob if I can't make use of the api


a year ago

I really can't recommend doing that if there is going to be a lot of jobs, find a way to have a single service do the jobs


patod01
HOBBYOP

a year ago

oh ): is it for the rate limit of the api?


a year ago

yes but I just don't think the strategy you have in mind is the best


patod01
HOBBYOP

a year ago

the rate limit is not a problem


patod01
HOBBYOP

a year ago

let me illustrate better what I imagined


a year ago

either way, just call the restart mutation


patod01
HOBBYOP

a year ago

asndfkgjasndfg


patod01
HOBBYOP

a year ago

looking for it


patod01
HOBBYOP

a year ago

this one? deploymentRestart


a year ago

pretty sure


patod01
HOBBYOP

a year ago

yay! thank you!


a year ago

!s


Status changed to Solved adam about 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...