original_docstring: Upload a DAG File to Airflow
docstring: Upload a DAG File to Airflow
docstring_tokens: Upload a DAG File to Airflow
code: def post(self):
          """Upload a DAG File to Airflow"""
          args = self.post_parser.parse_args()
          file = args.get(FILE_KEY)
          dag_file_path = os.path.join(settings.DAGS_FOLDER, file.filename)
  
          validate_file_for_upload(file)
          if os.path.isfile(dag_file_path):
              abort(CONFLICT_RESPONSE_CODE, message="File Already Exists")
  
          file.save(dag_file_path)
          return Response(status=POST_RESPONSE_SUCCESS_CODE)
code_tokens: def post ( self ) : args = self . post_parser . parse_args ( ) file = args . get ( FILE_KEY ) dag_file_path = os . path . join ( settings . DAGS_FOLDER , file . filename ) validate_file_for_upload ( file ) if os . path . isfile ( dag_file_path ) : abort ( CONFLICT_RESPONSE_CODE , message = "File Already Exists" ) file . save ( dag_file_path ) return Response ( status = POST_RESPONSE_SUCCESS_CODE )
short_docstring: Upload a DAG File to Airflow
short_docstring_tokens: Upload a DAG File to Airflow
comment: """Upload a DAG File to Airflow"""