add_datax_task.py 503 B

123456789101112131415161718192021222324
  1. import time
  2. import requests
  3. from config import *
  4. with open('./hive2hive.json', 'r') as f:
  5. script_str = f.read()
  6. cmd_parameter = '-j "-Xms2G -Xmx2G" -p "-Dct=hangzhou" '
  7. name = f'datax_task_{int(time.time())}'
  8. data = {
  9. "name": name,
  10. "file_urls": [],
  11. "script": script_str,
  12. # "cmd": "echo 'hello'",
  13. "cmd_parameters": cmd_parameter,
  14. "envs": {},
  15. "run_image": "SXKJ:32775/pod_datax:0.9",
  16. "task_type": "datax",
  17. "user_id": 33
  18. }
  19. print(f'http://{host}/jpt/jpt_task')