Skip to content
Snippets Groups Projects
Commit 38602d62 authored by Shane Hutchins's avatar Shane Hutchins
Browse files

Adding potential support for global policies (instance policies) in translate api

parent ac728f92
No related branches found
No related tags found
1 merge request!343Notice Update, Updated libraries, Version change and Backup API
Pipeline #185930 failed
......@@ -155,6 +155,8 @@ def translate_preprocess(posted_data, data_partition):
elif original_query.startswith('data.osdu.partition.'):
# "query": "data.osdu.partition.{{partition_id}}.search.allow == true"
policy_id = original_query.split('.')[4]
elif original_query.startswith('data.osdu.instance.'):
policy_id = original_query.split('.')[3]
else:
raise HTTPException(status_code=HTTP_400_BAD_REQUEST, detail=f"Translate API Error: expected query in format data.osdu.partition...")
path = conf.PARTITION_BUNDLE_ROOT.format(data_partition) + "/{0}".format(policy_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment