I have ran this example using this job
Everything worked well.
Now I am trying to see if there is a way to pass parameters to jobs running on Cloud Run.
I understand I can use the command to create jobs with a --message-body
argument like this:
gcloud scheduler jobs create http JOB_NAME \
--location REGION \
--schedule="*/3 * * * *" \
--uri="https://REGION-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/PROJECT_ID/jobs/CLOUD_RUN_JOB_NAME:run" \
--http-method POST \
--oauth-service-account-email [email protected]
--message-body="This is the body"
However while checking the documentation for Cloud Run jobs here.
I don't see parameters being mentioned anywhere. The idea is that depending on a JSON that contains the parameters we can run different kind of jobs (it's a same job that changes its operation based on the parameters)
message-body
. For example, create a JSON object, convert to a string and then base64 encode for the body. On the receiving side, you would grab the POST message body, base64decode ... – Mountainjob execute
API support a body? – Clericalism