Due to a scheduled upgrade to version 14.10, GitLab will be unavailabe on Monday 30.05., from 19:00 until 20:00.

Commit fe2848f2 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Remove old helm functionality

parent 06518f55
from flask_restful import Resource, reqparse
from flasgger import swag_from
from import_api_app.helpers.Error import ImportApiError
from import_api_app.helpers.Helm import start
class HelmStart(Resource):
@swag_from('HelmStart.yml')
def post(self, institution_id, record_set_id, process_id, job_name):
parser = reqparse.RequestParser()
parser.add_argument('job-parameters', type=dict)
args = parser.parse_args()
job_parameters = args['job-parameters']
job_parameters['institutionId'] = institution_id
job_parameters['recordSetId'] = record_set_id
job_parameters['processId'] = process_id
try:
return start(process_id, job_name, job_parameters)
except ImportApiError as e:
return {'error': e.message}, 500
Start a job in the kubernetes cluster (using helm charts)
---
tags:
- Helm
parameters:
- in: body
name: body
schema:
id: job-parameters
properties:
job-parameters:
type: object
properties:
appDirectory:
type: string
example: BECKER
description: The directory in the SFTP server
- in: path
name: institution_id
required: true
description: The Institution Identifier. We start with Drupal Node Id and will use the official identifier once it has been defined.
default: 123
type: string
- in: path
name: record_set_id
required: true
description: The ID of the Record Set (Bestand). We start with Drupal Node Id and will use the official identifier once it has been defined.
default: 456
type: string
- in: path
name: process_id
required: true
description: The identifier of the import process. Must be lowercase and
contain only letters, numbers and -.
default: 789
- in: path
type: string
name: job_name
example: text-file-validation
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:
201:
description: Success, job is started
schema:
id: helm-result
properties:
status:
type: string
example: SUCCESS/FAILURE
enum: ['SUCCESS', 'FAILURE']
message:
type: string
example: 'NAME: j0001.
LAST DEPLOYED: Thu May 14 16:15:54 2020.
NAMESPACE: memobase. STATUS: deployed. REVISION: 1.
TEST SUITE: None.'
job_id:
type: string
example: j0001
500:
description: It was impossible to start the job
schema:
$ref: '#/definitions/helm-result'
from flask_restful import Resource
from flasgger import swag_from
from import_api_app.helpers.Error import ImportApiError
from import_api_app.helpers.Helm import stop
class HelmStop(Resource):
# Todo validate requests
# @swag.validate('job-parameters')
@swag_from('HelmStop.yml')
def delete(self, process_id, job_name):
try:
return stop(process_id, job_name)
except ImportApiError:
return {'error': 'Unexpected Helm error'}, 500
Stop a job in the kubernetes cluster (using helm charts)
---
tags:
- Helm
parameters:
- in: path
name: process_id
required: true
description: The identifier of the import process. Must be lowercase and
contain only letters, numbers and -.
default: 789
- in: path
type: string
name: job_name
example: text-file-validation
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:
200:
description: Success, job is deleted
schema:
id: helm-result
properties:
status:
type: string
example: SUCCESS/FAILURE
enum: ['SUCCESS', 'FAILURE']
message:
type: string
example: 'NAME: j0001. LAST DEPLOYED: Thu May 14 16:15 2020.
NAMESPACE: memobase. STATUS: deployed.
REVISION: 1. TEST SUITE: None.'
job_id:
type: string
example: j0001
500:
description: It was impossible to stop the job
schema:
$ref: '#/definitions/helm-result'
\ No newline at end of file
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