Commit 10fc6648 authored by Lionel Walter's avatar Lionel Walter
Browse files

Rename models to helpers

parent 902b2686
......@@ -22,7 +22,7 @@ from import_api_app.resources.FetchMappingFile import FetchMappingFile
# from import_api_app.resources.HelmStop import HelmStop
import os
from import_api_app.models.Error import ImportApiError
from import_api_app.helpers.Error import ImportApiError
def create_app(test_config=None):
......
from import_api_app.models.Error import ImportApiError
from import_api_app.helpers.Error import ImportApiError
from flask_restful import current_app
from datetime import datetime
import requests
......
......@@ -4,7 +4,7 @@ from import_api_app.utility import generate_helm_name
import import_api_app.helm as helm
import os
from subprocess import CalledProcessError
from import_api_app.models.Error import ImportApiError
from import_api_app.helpers.Error import ImportApiError
def start(process_id, job_name, job_parameters):
......
......@@ -2,7 +2,7 @@ from kafka import KafkaConsumer, KafkaAdminClient
from kafka.admin import NewTopic
from flask_restful import current_app
from kafka.errors import KafkaError
from import_api_app.models.Error import ImportApiError
from import_api_app.helpers.Error import ImportApiError
import time
......
......@@ -3,7 +3,7 @@ from kafka import KafkaConsumer
from kafka.errors import KafkaError
import json
from import_api_app.models.Error import ImportApiError
from import_api_app.helpers.Error import ImportApiError
def get_report(topic_name):
......
......@@ -21,7 +21,7 @@ MAPPER_CHART_VERSION="0.14.3-chart"
MEDIA_CHART_VERSION="0.1.3-chart"
MME_CHART_VERSION="0.1.11-chart"
NORM_CHART_VERSION="0.5.3-chart"
INGESTER_CHART_VERSION="0.2.6-chart"
INGESTER_CHART_VERSION="0.2.7-chart"
helm chart pull ${TFV_REGISTRY}:${TFV_CHART_VERSION}
helm chart export ${TFV_REGISTRY}:${TFV_CHART_VERSION} -d charts/
......
from flask_restful import Resource, reqparse
from flasgger import swag_from
from import_api_app.models.Error import ImportApiError
from import_api_app.models.Helm import start
from import_api_app.helpers.Error import ImportApiError
from import_api_app.helpers.Helm import start
class HelmStart(Resource):
......
......@@ -37,7 +37,7 @@ parameters:
type: string
name: job_name
example: text-file-validation
enum: ['text-file-validation', 'table-data-transform', 'mapper-service','media-linker', 'normalization-service', 'media-metadata-extractor']
enum: ['text-file-validation', 'table-data-transform', 'xml-data-transform', 'mapper-service','media-linker', 'media-metadata-extractor', 'normalization-service', 'fedora-ingest-service']
required: true
responses:
......
from flask_restful import Resource
from flasgger import swag_from
from import_api_app.models.Error import ImportApiError
from import_api_app.models.Helm import stop
from import_api_app.helpers.Error import ImportApiError
from import_api_app.helpers.Helm import stop
class HelmStop(Resource):
......
......@@ -13,7 +13,7 @@ parameters:
type: string
name: job_name
example: text-file-validation
enum: ['text-file-validation', 'table-data-transform', 'mapper-service','media-linker', 'normalization-service', 'media-metadata-extractor']
enum: ['text-file-validation', 'table-data-transform', 'xml-data-transform', 'mapper-service','media-linker', 'media-metadata-extractor', 'normalization-service', 'fedora-ingest-service']
required: true
responses:
......
from flask_restful import Resource
from import_api_app.models.Error import ImportApiError
from import_api_app.models.Report import get_report
from import_api_app.helpers.Error import ImportApiError
from import_api_app.helpers.Report import get_report
class JobReport(Resource):
......
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.helpers.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 import_api_app.helpers.Drupal import update_status
from kubernetes import client
from threading import Thread
......@@ -64,12 +64,15 @@ class JobStart(Resource):
# load mapping file from url
config_map_name = process_id+"-normalization-service-local-transform-config"
create_config_map_from_file(
record_set_id,
job_parameters['configFileName'],
config_map_name,
current_app.config['NAMESPACE']
)
try:
create_config_map_from_file(
record_set_id,
job_parameters['configFileName'],
config_map_name,
current_app.config['NAMESPACE']
)
except ImportApiError as e:
return {'error': e.message}, 500
try:
create_topics(topics)
......
......@@ -53,7 +53,7 @@ parameters:
type: string
name: job_name
example: text-file-validation
enum: ['text-file-validation', 'table-data-transform', 'mapper-service','media-linker', 'normalization-service', 'media-metadata-extractor']
enum: ['text-file-validation', 'table-data-transform', 'xml-data-transform', 'mapper-service','media-linker', 'media-metadata-extractor', 'normalization-service', 'fedora-ingest-service']
required: true
responses:
......
......@@ -13,7 +13,7 @@ parameters:
type: string
name: job_name
example: text-file-validation
enum: ['text-file-validation', 'table-data-transform', 'mapper-service','media-linker', 'normalization-service', 'media-metadata-extractor']
enum: ['text-file-validation', 'table-data-transform', 'xml-data-transform', 'mapper-service','media-linker', 'media-metadata-extractor', 'normalization-service', 'fedora-ingest-service']
required: true
responses:
......
from flask_restful import Resource, reqparse
from import_api_app.models.Error import ImportApiError
from import_api_app.models.KafkaTopics import create_topics, list_topics, delete_topics
from import_api_app.helpers.Error import ImportApiError
from import_api_app.helpers.KafkaTopics import create_topics, list_topics, delete_topics
class KafkaTopics(Resource):
......
......@@ -14,8 +14,9 @@ class ReadJobOptionsFromDrupal(Resource):
type: string
name: job_name
default: table-data-transform
enum: ['text-file-validation', 'table-data-transform', 'mapper-service',
'media-linker', 'normalization-service', 'media-metadata-extractor']
enum: ['text-file-validation', 'table-data-transform', 'xml-data-transform',
'mapper-service','media-linker', 'media-metadata-extractor', 'normalization-service',
'fedora-ingest-service']
required: true
- in: path
type: string
......
from flask_restful import Resource
from import_api_app.models.Drupal import write_results
from import_api_app.models.Error import ImportApiError
from import_api_app.helpers.Drupal import write_results
from import_api_app.helpers.Error import ImportApiError
class WriteJobResultToDrupal(Resource):
......
Supports Markdown
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