Commit 5aa67950 authored by Lionel Walter's avatar Lionel Walter
Browse files

Merge branch 'MEMO-515' of...

Merge branch 'MEMO-515' of gitlab.switch.ch:memoriav/memobase-2020/services/import-process/import-api into MEMO-515
parents 9c01e50c 841bdfd3
Pipeline #13505 failed with stages
in 1 minute and 25 seconds
......@@ -5,7 +5,7 @@ import yaml
class FetchMappingFile(Resource):
def get(self, recordset_id, mapping_file_name):
def get(self, recordset_id, file_name):
"""
Fetches the mapping file form the sftp-server
---
......@@ -19,7 +19,7 @@ class FetchMappingFile(Resource):
example: AfZ-Becker-Audiovisuals
type: string
- in: path
name: mapping_file_name
name: file_name
required: true
description: The name of the mapping file
example: mapping.yml
......@@ -47,7 +47,7 @@ class FetchMappingFile(Resource):
# port = 80
# user = 'mb_sftp'
# pwd = '***'
remotePath = '/swissbib_index/mb_sftp/' + recordset_id + '/config/' + mapping_file_name
remotePath = '/swissbib_index/mb_sftp/' + recordset_id + '/config/' + file_name
mappingFileContents = ''
status = 'SUCCESS'
......
import time
from flask_restful import Resource, reqparse, current_app
from flasgger import swag_from
from import_api_app.models.Error import ImportApiError
from import_api_app.resources.KafkaTopics import create_topics
from import_api_app.resources.HelmStart import start
from import_api_app.resources.JobReport import get_report
from import_api_app.resources.WriteJobResultsToDrupal import write_results
from import_api_app.models.Drupal import update_status
from kubernetes import client
from threading import Thread
import time
import requests
import yaml
import json
......@@ -61,7 +56,6 @@ class JobStart(Resource):
# mapping_file_url = 'http://0.0.0.0:5000/v1/mappingfile/' +\
# job_parameters['recordSetId'] + '/' + 'mapping.yml'
response = requests.get(mapping_file_url)
mapping_file_content = response.content
mapping_file_content = yaml.dump(json.loads(mapping_file_content))
config_map_name = process_id+"-mapper-service-mapping-config"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment