Skip to content
what is the equivalent public API call for a cronjob service trigger?
patod01
OP

2 years 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
OP

2 years ago

N/A


jaredlunde
EMPLOYEE

2 years ago

I thinkdeploymentInstanceExecutionCreate is what you're looking for


2 years ago

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


2 years ago

me


2 years ago

That works lol


2 years ago

Any ideas on the above


2 years ago

is this a native railway backup?


2 years ago

@patod01 ^^


patod01
OP

2 years ago

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


patod01
OP

2 years ago

that was more of an example rather than my actual case


patod01
OP

2 years ago

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


patod01
OP

2 years 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
OP

2 years 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
OP

2 years ago

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


2 years ago

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


patod01
OP

2 years 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
OP

2 years ago

it's undefined atm


2 years ago

a lot?


patod01
OP

2 years ago

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


2 years 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
OP

2 years 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


2 years 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
OP

2 years ago

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


2 years ago

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


patod01
OP

2 years ago

the rate limit is not a problem


patod01
OP

2 years ago

let me illustrate better what I imagined


2 years ago

either way, just call the restart mutation


patod01
OP

2 years ago

asndfkgjasndfg


patod01
OP

2 years ago

looking for it


patod01
OP

2 years ago

this one? deploymentRestart


2 years ago

pretty sure


patod01
OP

2 years ago

yay! thank you!


2 years ago

!s


Status changed to Solved adam • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...