Commit 77299ba1 authored by Matthias's avatar Matthias
Browse files

chang parameter name and add commented out new call for future changes in json

parent 5d8c73dc
Pipeline #11645 passed with stages
in 4 minutes and 55 seconds
......@@ -7,7 +7,7 @@ import json
class MonitorDrupalJsonApiRecordSet(Resource):
# Todo write/correct comment for swagger
def get(self, topic_name):
def get(self, recordSetId):
"""
Get uuid of updated recordset form drupal, gets more information form \
drupal and puts it into the dedicated kafka topic
......@@ -16,7 +16,7 @@ class MonitorDrupalJsonApiRecordSet(Resource):
- Monitor Drupal JSON API
parameters:
- in: path
name: topic_name
name: recordSetId
required: true
description: The UUID of the updated recordset
example: 0c4c777c-94f8-45ba-945a-bfe6967d40da
......@@ -42,17 +42,22 @@ class MonitorDrupalJsonApiRecordSet(Resource):
# 1. request info from drupal with received uuid
try:
drupalResponse =\
drupalRecordSet =\
requests.get('https://mb-wf1.memobase.unibas.ch/jsonapi/node/' +
'institution/' + topic_name).json()['data']
'institution/' + recordSetId).json()['data']
# drupalImportProcess =\
# requests.get('https://mb-wf1.memobase.unibas.ch//jsonapi/node/' +
# 'import_process?filter[field_record_set.id][value]=' +
# recordSetId).json()['data']
topicValue = {
'type': drupalResponse['type'],
'status': drupalResponse['attributes']['status'],
'title': drupalResponse['attributes']['title'],
'field_memobase_id': drupalResponse['attributes']['field_memobase_id'],
'field_text': drupalResponse['attributes']['field_text'],
'field_import_process': drupalResponse['relationships']['field_import_process'],
'field_institution': drupalResponse['relationships']['field_institution']
'type': drupalRecordSet['type'],
'status': drupalRecordSet['attributes']['status'],
'title': drupalRecordSet['attributes']['title'],
'field_memobase_id': drupalRecordSet['attributes']['field_memobase_id'],
'field_text': drupalRecordSet['attributes']['field_text'],
'field_import_process': drupalRecordSet['field_import_process'],
'field_institution': drupalRecordSet['relationships']['field_institution']
}
except Exception as ex:
report += 'Exception: ' + str(ex) + '\n'
......
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