first commit
This commit is contained in:
@@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
from airflow import DAG
|
||||||
|
from airflow.operators.dummy import DummyOperator
|
||||||
|
# from airflow.operators.python import PythonOperator
|
||||||
|
from airflow.operators.python_operator import PythonOperator
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from airflow.models import Variable
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
default_args = {
|
||||||
|
'owner': 'WrenchBoard',
|
||||||
|
'depends_on_past': False,
|
||||||
|
'start_date': datetime(2022, 1, 1),
|
||||||
|
'email_on_failure': False,
|
||||||
|
'email_on_retry': False,
|
||||||
|
'retries': 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def WrenchCronApproveReminderApi(**kwargs):
|
||||||
|
url = kwargs["api_host"] + "/v1/new-account"
|
||||||
|
querystring= {"testuser":"ameye"}
|
||||||
|
response = requests.request("GET", url, params=querystring)
|
||||||
|
print(response.text)
|
||||||
|
|
||||||
|
with DAG(
|
||||||
|
dag_id="WRENCBOARD_CRON_APPROVEREMINDER",
|
||||||
|
default_args=default_args,
|
||||||
|
start_date=datetime(2024, 9, 1, 10, 00),
|
||||||
|
schedule_interval=timedelta(minutes=360),
|
||||||
|
catchup=False) as dag:
|
||||||
|
t1 = PythonOperator(
|
||||||
|
task_id = "wrenchboard_approvereminder",
|
||||||
|
python_callable= WrenchCronApproveReminderApi,
|
||||||
|
op_kwargs={
|
||||||
|
"api_host" : Variable.get("API_WRENCHBOARD_HOST")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
t2 = DummyOperator(
|
||||||
|
task_id="end"
|
||||||
|
)
|
||||||
|
|
||||||
|
t1 >> t2
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
from airflow import DAG
|
||||||
|
from airflow.operators.dummy import DummyOperator
|
||||||
|
# from airflow.operators.python import PythonOperator
|
||||||
|
from airflow.operators.python_operator import PythonOperator
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from airflow.models import Variable
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
default_args = {
|
||||||
|
'owner': 'WrenchBoard',
|
||||||
|
'depends_on_past': False,
|
||||||
|
'start_date': datetime(2022, 1, 1),
|
||||||
|
'email_on_failure': False,
|
||||||
|
'email_on_retry': False,
|
||||||
|
'retries': 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def WrenchCronDueReminderApi(**kwargs):
|
||||||
|
url = kwargs["api_host"] + "/v1/due-reminder"
|
||||||
|
querystring= {"testuser":"ameye"}
|
||||||
|
response = requests.request("GET", url, params=querystring)
|
||||||
|
print(response.text)
|
||||||
|
|
||||||
|
with DAG(
|
||||||
|
dag_id="WRENCBOARD_CRON_DUEREMINDER",
|
||||||
|
default_args=default_args,
|
||||||
|
start_date=datetime(2024, 9, 1, 10, 00),
|
||||||
|
schedule_interval=timedelta(minutes=300),
|
||||||
|
catchup=False) as dag:
|
||||||
|
t1 = PythonOperator(
|
||||||
|
task_id = "wrenchboard_duereminder",
|
||||||
|
python_callable= WrenchCronDueReminderApi,
|
||||||
|
op_kwargs={
|
||||||
|
"api_host" : Variable.get("API_WRENCHBOARD_HOST")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
t2 = DummyOperator(
|
||||||
|
task_id="end"
|
||||||
|
)
|
||||||
|
|
||||||
|
t1 >> t2
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
from airflow import DAG
|
||||||
|
from airflow.operators.dummy import DummyOperator
|
||||||
|
# from airflow.operators.python import PythonOperator
|
||||||
|
from airflow.operators.python_operator import PythonOperator
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from airflow.models import Variable
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
default_args = {
|
||||||
|
'owner': 'WrenchBoard',
|
||||||
|
'depends_on_past': False,
|
||||||
|
'start_date': datetime(2022, 1, 1),
|
||||||
|
'email_on_failure': False,
|
||||||
|
'email_on_retry': False,
|
||||||
|
'retries': 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def WrenchCronNewaccountApi(**kwargs):
|
||||||
|
url = kwargs["api_host"] + "/v1/new-account"
|
||||||
|
querystring= {"testuser":"ameye"}
|
||||||
|
response = requests.request("GET", url, params=querystring)
|
||||||
|
print(response.text)
|
||||||
|
|
||||||
|
with DAG(
|
||||||
|
dag_id="WRENCBOARD_CRON_NEWACCOUNT",
|
||||||
|
default_args=default_args,
|
||||||
|
start_date=datetime(2024, 9, 1, 10, 00),
|
||||||
|
schedule_interval=timedelta(minutes=360),
|
||||||
|
catchup=False) as dag:
|
||||||
|
t1 = PythonOperator(
|
||||||
|
task_id = "wrench_cron_newaccount",
|
||||||
|
python_callable= WrenchCronNewaccountApi,
|
||||||
|
op_kwargs={
|
||||||
|
"api_host" : Variable.get("API_WRENCHBOARD_HOST")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
t2 = DummyOperator(
|
||||||
|
task_id="end"
|
||||||
|
)
|
||||||
|
|
||||||
|
t1 >> t2
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
from airflow import DAG
|
||||||
|
from airflow.operators.dummy import DummyOperator
|
||||||
|
# from airflow.operators.python import PythonOperator
|
||||||
|
from airflow.operators.python_operator import PythonOperator
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from airflow.models import Variable
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
default_args = {
|
||||||
|
'owner': 'WrenchBoard',
|
||||||
|
'depends_on_past': False,
|
||||||
|
'start_date': datetime(2022, 1, 1),
|
||||||
|
'email_on_failure': False,
|
||||||
|
'email_on_retry': False,
|
||||||
|
'retries': 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def WrenchCronOfferPendingApi(**kwargs):
|
||||||
|
url = kwargs["api_host"] + "/v1/offer-pending"
|
||||||
|
querystring= {"testuser":"ameye"}
|
||||||
|
response = requests.request("GET", url, params=querystring)
|
||||||
|
print(response.text)
|
||||||
|
|
||||||
|
with DAG(
|
||||||
|
dag_id="WRENCBOARD_CRON_OFFERPENDING",
|
||||||
|
default_args=default_args,
|
||||||
|
start_date=datetime(2024, 9, 1, 10, 00),
|
||||||
|
schedule_interval=timedelta(minutes=2),
|
||||||
|
catchup=False) as dag:
|
||||||
|
t1 = PythonOperator(
|
||||||
|
task_id = "wrenchboard_offerpending",
|
||||||
|
python_callable= WrenchCronOfferPendingApi,
|
||||||
|
op_kwargs={
|
||||||
|
"api_host" : Variable.get("API_WRENCHBOARD_HOST")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
t2 = DummyOperator(
|
||||||
|
task_id="end"
|
||||||
|
)
|
||||||
|
|
||||||
|
t1 >> t2
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
from airflow import DAG
|
||||||
|
from airflow.operators.dummy import DummyOperator
|
||||||
|
# from airflow.operators.python import PythonOperator
|
||||||
|
from airflow.operators.python_operator import PythonOperator
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from airflow.models import Variable
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
default_args = {
|
||||||
|
'owner': 'WrenchBoard',
|
||||||
|
'depends_on_past': False,
|
||||||
|
'start_date': datetime(2022, 1, 1),
|
||||||
|
'email_on_failure': False,
|
||||||
|
'email_on_retry': False,
|
||||||
|
'retries': 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def WrenchCronSignUpReportApi(**kwargs):
|
||||||
|
url = kwargs["api_host"] + "/v1/signup-report"
|
||||||
|
querystring= {"testuser":"ameye"}
|
||||||
|
response = requests.request("GET", url, params=querystring)
|
||||||
|
print(response.text)
|
||||||
|
|
||||||
|
with DAG(
|
||||||
|
dag_id="WRENCBOARD_CRON_SIGNUPREPORT",
|
||||||
|
default_args=default_args,
|
||||||
|
start_date=datetime(2024, 9, 1, 10, 00),
|
||||||
|
schedule_interval=timedelta(minutes=120),
|
||||||
|
catchup=False) as dag:
|
||||||
|
t1 = PythonOperator(
|
||||||
|
task_id = "wrenchboard_signupreport",
|
||||||
|
python_callable= WrenchCronSignUpReportApi,
|
||||||
|
op_kwargs={
|
||||||
|
"api_host" : Variable.get("API_WRENCHBOARD_HOST")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
t2 = DummyOperator(
|
||||||
|
task_id="end"
|
||||||
|
)
|
||||||
|
|
||||||
|
t1 >> t2
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user