{"openapi":"3.0.2","info":{"title":"Service Data Download","description":"Service for data download usage","version":"2.2.16"},"paths":{"/v1/health":{"get":{"summary":"Health check for RDS, Redis and Kafka","operationId":"check_db_connection_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"summary":"Root","description":"Healthcheck route.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/download/status/{hash_code}":{"get":{"tags":["v1/data-download"],"summary":"Check download status","description":"Summary:\n    The API is to return the download status by the hashcode\n\nParameter:\n    - hash_code(str): hashcode return from /v1/download/pre\n\nReturn:\n    - 200","operationId":"data_download_status_v1_download_status__hash_code__get","parameters":[{"required":true,"schema":{"title":"Hash Code"},"name":"hash_code","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetDataDownloadStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/download/{hash_code}":{"get":{"tags":["v1/data-download"],"summary":"Download the data, asynchronously streams a file as the response.","description":"Summary:\n    The API is the actual download api to send file to the frontend\n    specified by hashcode\n\nParameter:\n    - hash_code(str): hashcode return from /v1/download/pre\n\nReturn:\n    - file response","operationId":"data_download_v1_download__hash_code__get","parameters":[{"required":true,"schema":{"title":"Hash Code","type":"string"},"name":"hash_code","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/download/pre/":{"post":{"tags":["v2/data-download"],"summary":"Pre download process, zip as a package if more than 1 file, used in project files download and dataset single file download.","description":"Summary:\n    The API serves as the pre file download operation. Since the file\n    downloading is a background job, this api will download target\n    files and zip them under the tmp folder.\n\n    Afterwards, the frontend will all the /v1/downlaod/<hashcode> to\n    download the zipped file or a single file\n\nPayload:\n     - files(list): the list of target id file will be\n        downloaded (either in project or dataset)\n     - operator(str): the user who takes the operation\n     - container_code(str): the unique code of project\n     - container_type(str): the type of container will be project/dataset\n     - approval_request_id(UUID): the unique identifier for approval\n\nHeader:\n     - authorization(str): the access token from auth service\n     - refresh_token(str): the refresh token from auth service\nCookies:\n     - session_id(str): the session id generate for each user login\n\nReturn:\n    - 200","operationId":"data_pre_download_v2_download_pre__post","parameters":[{"required":false,"schema":{"title":"Session-Id"},"name":"session-id","in":"header"},{"required":true,"schema":{"title":"Authorization"},"name":"Authorization","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreDataDownloadPOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreDataDownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/dataset/download/pre":{"post":{"tags":["v2/data-download"],"summary":"Download all files & schemas in a dataset","description":"Summary:\n    The API serves as the pre download for whole dataset. All files\n    and schemas will be download and packed as zip file under tmp folder.\n\n    Afterwards, the frontend will all the /v1/downlaod/<hashcode> to\n    download the zipped file or a single file\n\nPayload:\n    - dataset_code(list): the unique code of dataset\n    - operator(str): the user who takes the operation\n\nHeader:\n     - authorization(str): the access token from auth service\n     - refresh_token(str): the refresh token from auth service\nCookies:\n     - session_id(str): the session id generate for each user login\n\nReturn:\n    - 200","operationId":"dataset_pre_download_v2_dataset_download_pre_post","parameters":[{"required":false,"schema":{"title":"Session-Id"},"name":"session-id","in":"header"},{"required":true,"schema":{"title":"Authorization"},"name":"Authorization","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetPrePOST"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"DatasetPrePOST":{"title":"DatasetPrePOST","required":["dataset_code","operator"],"type":"object","properties":{"dataset_code":{"title":"Dataset Code","type":"string"},"operator":{"title":"Operator","type":"string"}},"description":"Pre download dataset payload model."},"EAPIResponseCode":{"title":"EAPIResponseCode","enum":[200,500,400,404,403,401,409],"description":"An enumeration."},"GetDataDownloadStatusResponse":{"title":"GetDataDownloadStatusResponse","type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"object","default":{},"example":{"session_id":"unique_session_id","job_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","source":"./test_project/workdir/test_project_zipped_1613507376.zip","action":"data_download","status":"READY_FOR_DOWNLOADING","project_code":"test_project","operator":"zhengyang","progress":0,"payload":{"hash_code":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmdWxsX3BhdGgiOiIuL3Rlc3RfcHJvamVjdC93b3JrZGlyL3Rlc3RfcHJvamVjdF96aXBwZWRfMTYxMzUwNzM3Ni56aXAiLCJpc3N1ZXIiOiJTRVJWSUNFIERBVEEgRE9XTkxPQUQgIiwib3BlcmF0b3IiOiJ6aGVuZ3lhbmciLCJzZXNzaW9uX2lkIjoidW5pcXVlX3Nlc3Npb25faWQiLCJqb2JfaWQiOiJkYXRhLWRvd25sb2FkLTE2MTM1MDczNzYiLCJwcm9qZWN0X2NvZGUiOiJ0ZXN0X3Byb2plY3QiLCJpYXQiOjE2MTM1MDczNzYsImV4cCI6MTYxMzUwNzY3Nn0.ipzWy6y79QxRGhQQ_VWIk-Lz8Iv8zU7JHGF3ZBoNt-g"},"update_timestamp":"1613507385"}}},"description":"Get data download status."},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"PreDataDownloadPOST":{"title":"PreDataDownloadPOST","required":["files","operator","container_code","container_type"],"type":"object","properties":{"files":{"title":"Files","type":"array","items":{"type":"object"}},"operator":{"title":"Operator","type":"string"},"container_code":{"title":"Container Code","type":"string"},"container_type":{"title":"Container Type","type":"string"},"approval_request_id":{"title":"Approval Request Id","type":"string","format":"uuid"}},"description":"Pre download payload model."},"PreDataDownloadResponse":{"title":"PreDataDownloadResponse","type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"object","default":{},"example":{"session_id":"unique_session_id","job_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","source":"./test_project/workdir/test_project_zipped_1613507376.zip","action":"data_download","status":"ZIPPING","project_code":"test_project","operator":"zhengyang","progress":0,"payload":{"hash_code":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmdWxsX3BhdGgiOiIuL3Rlc3RfcHJvamVjdC93b3JrZGlyL3Rlc3RfcHJvamVjdF96aXBwZWRfMTYxMzUwNzM3Ni56aXAiLCJpc3N1ZXIiOiJTRVJWSUNFIERBVEEgRE9XTkxPQUQgIiwib3BlcmF0b3IiOiJ6aGVuZ3lhbmciLCJzZXNzaW9uX2lkIjoidW5pcXVlX3Nlc3Npb25faWQiLCJqb2JfaWQiOiJkYXRhLWRvd25sb2FkLTE2MTM1MDczNzYiLCJwcm9qZWN0X2NvZGUiOiJ0ZXN0X3Byb2plY3QiLCJpYXQiOjE2MTM1MDczNzYsImV4cCI6MTYxMzUwNzY3Nn0.ipzWy6y79QxRGhQQ_VWIk-Lz8Iv8zU7JHGF3ZBoNt-g"},"update_timestamp":"1613507376"}}},"description":"Pre download response class."},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}}}}}