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

10 months 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

10 months ago

N/A


jaredlunde
EMPLOYEE

10 months ago

I thinkdeploymentInstanceExecutionCreate is what you're looking for


10 months ago

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


10 months ago

me


10 months ago

That works lol


10 months ago

Any ideas on the above


10 months ago

is this a native railway backup?


10 months ago

@patod01 ^^


patod01
HOBBYOP

10 months ago

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


patod01
HOBBYOP

10 months ago

that was more of an example rather than my actual case


patod01
HOBBYOP

10 months ago

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


patod01
HOBBYOP

10 months 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

10 months 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

10 months ago

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


10 months ago

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


patod01
HOBBYOP

10 months 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

10 months ago

it's undefined atm


10 months ago

a lot?


patod01
HOBBYOP

10 months ago

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


10 months 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

10 months 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


10 months 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

10 months ago

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


10 months ago

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


patod01
HOBBYOP

10 months ago

the rate limit is not a problem


patod01
HOBBYOP

10 months ago

let me illustrate better what I imagined


10 months ago

either way, just call the restart mutation


patod01
HOBBYOP

10 months ago

asndfkgjasndfg


patod01
HOBBYOP

10 months ago

looking for it


patod01
HOBBYOP

10 months ago

this one? deploymentRestart


10 months ago

pretty sure


patod01
HOBBYOP

10 months ago

yay! thank you!


10 months ago

!s


Status changed to Solved adam 10 months ago


Loading...