Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
김진영
airflow-test
Commits
81dd05e5
Commit
81dd05e5
authored
May 13, 2022
by
김진영
Browse files
Update batch_test.py
parent
0c9aab19
Changes
1
Hide whitespace changes
Inline
Side-by-side
batch_test.py
View file @
81dd05e5
...
@@ -3,7 +3,7 @@ from textwrap import dedent
...
@@ -3,7 +3,7 @@ from textwrap import dedent
import
pendulum
import
pendulum
from
airflow.operators.bash
import
BashOperator
from
airflow.operators.bash
import
BashOperator
from
airflow
import
DAG
from
airflow
import
DAG
from
data
/
gasan_data
import
gasanData
from
data
.
gasan_data
import
gasanData
local_tz
=
pendulum
.
timezone
(
"Asia/Seoul"
)
local_tz
=
pendulum
.
timezone
(
"Asia/Seoul"
)
...
@@ -47,7 +47,7 @@ with DAG(
...
@@ -47,7 +47,7 @@ with DAG(
# gasan 작업 병렬처리
# gasan 작업 병렬처리
post_gasan_tasks
=
[]
post_gasan_tasks
=
[]
for
i
,
data
in
enumerate
(
gasan
_d
ata
):
for
i
,
data
in
enumerate
(
gasan
D
ata
):
post_gasan_task
=
BashOperator
(
post_gasan_task
=
BashOperator
(
task_id
=
'post_gasan'
+
str
(
i
+
1
),
task_id
=
'post_gasan'
+
str
(
i
+
1
),
bash_command
=
"curl -X
\'
POST
\'
\'
http://10.231.238.224:30999/api/v1/camera/writeimage
\'
-H
\'
Content-Type: application/json
\'
-d
\'
{
\"
id
\"
:
\"
test
\"
,
\"
pw
\"
:
\"
test
\"
,
\"
ip
\"
:
\"
%s
\"
,
\"
serialNum
\"
:
\"
%s
\"
,
\"
camName
\"
:
\"
%s
\"
}
\'
"
%
(
data
[
"ip"
],
data
[
"serialNum"
],
data
[
"camName"
]),
bash_command
=
"curl -X
\'
POST
\'
\'
http://10.231.238.224:30999/api/v1/camera/writeimage
\'
-H
\'
Content-Type: application/json
\'
-d
\'
{
\"
id
\"
:
\"
test
\"
,
\"
pw
\"
:
\"
test
\"
,
\"
ip
\"
:
\"
%s
\"
,
\"
serialNum
\"
:
\"
%s
\"
,
\"
camName
\"
:
\"
%s
\"
}
\'
"
%
(
data
[
"ip"
],
data
[
"serialNum"
],
data
[
"camName"
]),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment