Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use URL_PREFIX from actinia_core app #8

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/actinia_satellite_plugin/ephemeral_landsat_ndvi_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from actinia_core.models.response_models import UnivarResultModel, ProcessingResponseModel
from actinia_core.core.common.landsat_processing_library import LandsatProcessing
from actinia_core.models.response_models import ProcessingErrorResponseModel
from actinia_core.core.common.app import URL_PREFIX

__license__ = "GPLv3"
__author__ = "Sören Gebbert"
Expand Down Expand Up @@ -54,8 +55,8 @@ class LandsatNDVIResponseModel(ProcessingResponseModel):
"api_info": {
"endpoint": "asyncephemerallandsatprocessingresource",
"method": "POST",
"path": "/api/v1/landsat_process/LC80440342016259LGN00/TOAR/NDVI",
"request_url": "http://localhost:5000/api/v1/landsat_process/LC80440342016259LGN00/TOAR/NDVI"
"path": f"{URL_PREFIX}/landsat_process/LC80440342016259LGN00/TOAR/NDVI",
"request_url": f"http://localhost:5000{URL_PREFIX}/landsat_process/LC80440342016259LGN00/TOAR/NDVI"
},
"datetime": "2018-05-30 11:22:58.315162",
"http_code": 200,
Expand Down Expand Up @@ -635,10 +636,10 @@ class LandsatNDVIResponseModel(ProcessingResponseModel):
"timestamp": 1527679378.31516,
"urls": {
"resources": [
"http://localhost:5000/api/v1/resource/superadmin/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/tmp80apvh0h.png",
"http://localhost:5000/api/v1/resource/superadmin/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/LC80440342016259LGN00_TOAR_NDVI.tiff"
f"http://localhost:5000{URL_PREFIX}/resource/superadmin/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/tmp80apvh0h.png",
f"http://localhost:5000{URL_PREFIX}/resource/superadmin/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/LC80440342016259LGN00_TOAR_NDVI.tiff"
],
"status": "http://localhost:5000/api/v1/resources/superadmin/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc"
"status": f"http://localhost:5000{URL_PREFIX}/resources/superadmin/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc"
},
"user_id": "superadmin"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from actinia_core.core.common.app import auth
from actinia_core.core.common.api_logger import log_api_call
from actinia_core.models.response_models import ProcessingErrorResponseModel
from actinia_core.core.common.app import URL_PREFIX

__license__ = "GPLv3"
__author__ = "Sören Gebbert"
Expand All @@ -30,19 +31,19 @@ class SentinelNDVIResponseModel(ProcessingResponseModel):
It is used as schema to define the *process_result* in a ProcessingResponseModel derivative.
"""
type = 'object'
properties = deepcopy(ProcessingResponseModel.properties)
properties = deepcopy(ProcessingResponseModel.properties)
properties["process_results"] = {}
properties["process_results"]["type"] = "array"
properties["process_results"]["items"] = UnivarResultModel
required = deepcopy(ProcessingResponseModel.required)
required = deepcopy(ProcessingResponseModel.required)
example = {
"accept_datetime": "2018-05-30 12:25:43.987713",
"accept_timestamp": 1527683143.9877105,
"api_info": {
"endpoint": "asyncephemeralsentinel2processingresource",
"method": "POST",
"path": "/api/v1/sentinel2_process/ndvi/S2A_MSIL1C_20161206T030112_N0204_R032_T50RKR_20161206T030749",
"request_url": "http://localhost:8080/api/v1/sentinel2_process/ndvi/S2A_MSIL1C_20161206T030112_N0204_R032_T50RKR_20161206T030749"
"path": f"{URL_PREFIX}/sentinel2_process/ndvi/S2A_MSIL1C_20161206T030112_N0204_R032_T50RKR_20161206T030749",
"request_url": f"http://localhost:8080{URL_PREFIX}/sentinel2_process/ndvi/S2A_MSIL1C_20161206T030112_N0204_R032_T50RKR_20161206T030749"
},
"datetime": "2018-05-30 12:29:11.800608",
"http_code": 200,
Expand Down Expand Up @@ -617,10 +618,10 @@ class SentinelNDVIResponseModel(ProcessingResponseModel):
"timestamp": 1527683351.8002071,
"urls": {
"resources": [
"http://localhost:8080/api/v1/resource/superadmin/resource_id-6b849585-576f-40b5-a514-34a7cf1f97ce/tmpsaeegg0q.png",
"http://localhost:8080/api/v1/resource/superadmin/resource_id-6b849585-576f-40b5-a514-34a7cf1f97ce/ndvi.tiff"
f"http://localhost:8080{URL_PREFIX}/resource/superadmin/resource_id-6b849585-576f-40b5-a514-34a7cf1f97ce/tmpsaeegg0q.png",
f"http://localhost:8080{URL_PREFIX}/resource/superadmin/resource_id-6b849585-576f-40b5-a514-34a7cf1f97ce/ndvi.tiff"
],
"status": "http://localhost:8080/api/v1/resources/superadmin/resource_id-6b849585-576f-40b5-a514-34a7cf1f97ce"
"status": f"http://localhost:8080{URL_PREFIX}/resources/superadmin/resource_id-6b849585-576f-40b5-a514-34a7cf1f97ce"
},
"user_id": "superadmin"
}
Expand Down