I am using Cloud functions to trigger Airflow DAG when ever the file is placed in the cloud storage.
It was working for .csv file but my requirement is cloud function should trigger DAG when any type of file (say .json file) is placed in the cloud storage.
I have given configuration like,
index.js:
'use strict';
const fetch = require('node-fetch');
const FormData = require('form-data');
var config = require('./config.json');
exports.triggerGCSDag = function triggerGCSDag(data,context) {
const PROJECT_ID = config.PROJECT_ID;
const CLIENT_ID = config.CLIENT_ID;
const WEBSERVER_ID = config.WEBSERVER_ID;
const USER_AGENT =config.USER_AGENT;
const BODY = {'conf': JSON.stringify(data)};
const file = data;
const file_format=config.file_format;
const folder_array=config.folder_name;
const DAG_ARRAY=config.DAG_NAME;
.
.
.
But DAG is not triggered whenever .json or csv file placed in the cloud storage.
Please help me in out to set config.json for file format csv and json so that cf will trigger Airflow DAG