Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manually trigger GCP pub sub functions

I have some GCP functions which use pub sub to run on a schedule. I would like to be able to also run them ad hoc. I am positive I was able to do this from the GCP console UI, but for the life of me can't find the button again. Does anyone know how to do this? Or failing that, is it possible to run functions ad hoc with the gcloud command line tool? I know I could deploy them as HTTP functions as well to enable me to hit the HTTP endpoint to trigger the functions, but I don't want to have to deploy all my functions as pub sub as well as HTTP.

like image 546
Max888 Avatar asked Dec 09 '25 17:12

Max888


1 Answers

You can use gcloud to send a message to a topic. I suggest reading the documentation.

gcloud pubsub topics publish your-topic --message=your-message
like image 181
Doug Stevenson Avatar answered Dec 11 '25 21:12

Doug Stevenson