@@ -1287,8 +1287,12 @@ def commit_thumbnail_file(property_key, normalized_type, user_token, existing_da
1287
1287
1288
1288
logger .info (f"Commit the uploaded thumbnail file of tmp file id { tmp_file_id } for entity { entity_uuid } via ingest-api call..." )
1289
1289
1290
+ request_headers = {
1291
+ 'Authorization' : f'Bearer { user_token } '
1292
+ }
1293
+
1290
1294
# Disable ssl certificate verification
1291
- response = requests .post (url = ingest_api_target_url , headers = schema_manager . _create_request_headers ( user_token ) , json = json_to_post , verify = False )
1295
+ response = requests .post (url = ingest_api_target_url , headers = request_headers , json = json_to_post , verify = False )
1292
1296
1293
1297
if response .status_code != 200 :
1294
1298
msg = f"Failed to commit the thumbnail file of tmp file id { tmp_file_id } via ingest-api for entity uuid: { entity_uuid } "
@@ -1387,8 +1391,12 @@ def delete_thumbnail_file(property_key, normalized_type, user_token, existing_da
1387
1391
1388
1392
logger .info (f"Remove the uploaded thumbnail file { file_uuid } for entity { entity_uuid } via ingest-api call..." )
1389
1393
1394
+ request_headers = {
1395
+ 'Authorization' : f'Bearer { user_token } '
1396
+ }
1397
+
1390
1398
# Disable ssl certificate verification
1391
- response = requests .post (url = ingest_api_target_url , headers = schema_manager . _create_request_headers ( user_token ) , json = json_to_post , verify = False )
1399
+ response = requests .post (url = ingest_api_target_url , headers = request_headers , json = json_to_post , verify = False )
1392
1400
1393
1401
# response.json() returns an empty array because
1394
1402
# there's no thumbnail file left once the only one gets removed
@@ -1457,10 +1465,12 @@ def sync_component_dataset_status(property_key, normalized_type, user_token, exi
1457
1465
creation_action = schema_neo4j_queries .get_entity_creation_action_activity (schema_manager .get_neo4j_driver_instance (), child_uuid )
1458
1466
if creation_action == 'Multi-Assay Split' :
1459
1467
url = schema_manager .get_entity_api_url () + SchemaConstants .ENTITY_API_UPDATE_ENDPOINT + '/' + child_uuid
1460
- header = schema_manager ._create_request_headers (user_token )
1468
+ request_headers = {
1469
+ 'Authorization' : f'Bearer { user_token } '
1470
+ }
1461
1471
header [SchemaConstants .HUBMAP_APP_HEADER ] = SchemaConstants .INGEST_API_APP
1462
1472
header [SchemaConstants .INTERNAL_TRIGGER ] = SchemaConstants .COMPONENT_DATASET
1463
- response = requests .put (url = url , headers = header , json = status_body )
1473
+ response = requests .put (url = url , headers = request_headers , json = status_body )
1464
1474
1465
1475
1466
1476
####################################################################################################
@@ -2082,8 +2092,12 @@ def _commit_files(target_property_key, property_key, normalized_type, user_token
2082
2092
2083
2093
logger .info (f"Commit the uploaded file of temp_file_id { temp_file_id } for entity { entity_uuid } via ingest-api call..." )
2084
2094
2095
+ request_headers = {
2096
+ 'Authorization' : f'Bearer { user_token } '
2097
+ }
2098
+
2085
2099
# Disable ssl certificate verification
2086
- response = requests .post (url = ingest_api_target_url , headers = schema_manager . _create_request_headers ( user_token ) , json = json_to_post , verify = False )
2100
+ response = requests .post (url = ingest_api_target_url , headers = request_headers , json = json_to_post , verify = False )
2087
2101
2088
2102
if response .status_code != 200 :
2089
2103
msg = f"Failed to commit the file of temp_file_id { temp_file_id } via ingest-api for entity uuid: { entity_uuid } "
@@ -2188,9 +2202,13 @@ def _delete_files(target_property_key, property_key, normalized_type, user_token
2188
2202
}
2189
2203
2190
2204
logger .info (f"Remove the uploaded files for entity { entity_uuid } via ingest-api call..." )
2205
+
2206
+ request_headers = {
2207
+ 'Authorization' : f'Bearer { user_token } '
2208
+ }
2191
2209
2192
2210
# Disable ssl certificate verification
2193
- response = requests .post (url = ingest_api_target_url , headers = schema_manager . _create_request_headers ( user_token ) , json = json_to_post , verify = False )
2211
+ response = requests .post (url = ingest_api_target_url , headers = request_headers , json = json_to_post , verify = False )
2194
2212
2195
2213
if response .status_code != 200 :
2196
2214
msg = f"Failed to remove the files via ingest-api for entity uuid: { entity_uuid } "
0 commit comments