I am using Container Builder to process huge JSON files and transform them. It's a nice possibility of a non-standard usage of it as described here.
Is it possible to trigger a container builder build and pass a parameter to it via cloud functions? This would allow to act on newly uploaded files in GCS and process them via container builder automatically.
Currently I am trying to use the REST API for triggering it (I am new to Node.js), but I get a 404 on my URL. I am developing on a Cloud Shell instance with full API access.
The URL that I am trying to trigger via a PUT
request and a JSON body containing the JSON equivalent of a successfully ran cloudbuild.yaml
is: https://cloudbuild.googleapis.com/v1/projects/[PROJECT_ID]/builds
I am using the requests library from Node.js:
request({ url: "https://cloudbuild.googleapis.com/v1/projects/[PROJECT_ID]/builds",
method: 'PUT',
json: {"steps":[{"name":"gcr.io/cloud-builders/gsutil",(...),
function(error, response, body){
console.log(error)
console.log(response)
console.log(body)
})