Commit ccb43296 authored by Siarhei Khaletski (EPAM)'s avatar Siarhei Khaletski (EPAM) 🚩
Browse files

Merge branch 'File_service_api_v2' into 'master'

Change API version of File Service

See merge request !13
parents 9ed23c4a 83716162
......@@ -148,7 +148,7 @@ class FileHandler(HeadersMixin):
:rtype: FileUploadUrlResponse
"""
logger.debug("Getting upload signed url.")
endpoint = f"{self._file_service_host}/v1/files/uploadURL"
endpoint = f"{self._file_service_host}/v2/files/uploadURL"
response = self._send_get_request(headers, endpoint).json()
logger.debug("Signed url got.")
upload_url_response = FileUploadUrlResponse(file_id=response["FileID"],
......@@ -168,7 +168,7 @@ class FileHandler(HeadersMixin):
:rtype: FileDownloadUrlResponse
"""
logger.debug("Getting download signed url.")
endpoint = f"{self._file_service_host}/v1/files/{record_id}/downloadURL"
endpoint = f"{self._file_service_host}/v2/files/{record_id}/downloadURL"
response = self._send_get_request(headers, endpoint).json()
logger.debug("Signed url got.")
download_url_response = self._handle_download_url_response(response)
......@@ -269,7 +269,7 @@ class FileHandler(HeadersMixin):
f"surrogate_name_{file_record['data']['DatasetProperties']['FileSourceInfo']['PreloadFilePath'].split('/')[-1]}"
logger.info(f"Generated name: {file_record['data']['Name']}")
logger.info("Sending file record metadata to File service")
endpoint = f"{self._file_service_host}/v1/files/metadata"
endpoint = f"{self._file_service_host}/v2/files/metadata"
response = self._send_post_request(self.request_headers, endpoint, json.dumps(file_record))
return response.json()["id"]
......
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