actinia-core icon indicating copy to clipboard operation
actinia-core copied to clipboard

Export not allowed for the requested URL

Open veroandreo opened this issue 2 years ago • 2 comments

Hi,

I'm testing export options and found 2 actinia endpoints to do so which minimum requirement is role:user. However, when I run them with curl I get the following:

curl ${AUTH} -X GET "${actinia}/api/v1/locations/latlong_wgs84/mapsets/hansen_global_forest_south_america/raster_layers/lossyear/geotiff_async"
{"message": "The method is not allowed for the requested URL."}

curl ${AUTH} -X GET "${actinia}/api/v1/locations/latlong_wgs84/mapsets/hansen_global_forest_south_america/raster_layers/lossyear/geotiff_async_orig"
{"message": "The method is not allowed for the requested URL."}

I use actinia.mundialis.de and my user is veroandreo. Is this a permission setting in the user or in the location/mapset?

veroandreo avatar Oct 21 '21 14:10 veroandreo

Hi @veroandreo, First of all, thanks a lot for your extensive testing! These endpoints require HTTP POST requests instead of GET requests, so the syntax would be:

curl ${AUTH} -X POST "${actinia}/api/v1/locations/latlong_wgs84/mapsets/hansen_global_forest_south_america/raster_layers/lossyear/geotiff_async"

In the background, an actinia process chain is posted to actinia, and in the response you will see a status URL that you can use to poll the status of the export, for example:

# just a syntax example
curl ${AUTH} -X GET https://actinia.mundialis.de/api/v1/resources/veroandreo/resource_id-e0b4ef04-b050-47f9-98be-a81b5c70ec91

From there you will receive an actinia response that has a urls: { resources: [... section at the bottom. You can use the link from there to download the resulting .tif dataset.

please note the difference between the two endpoints:

  • .../geotiff_async uses the current computational region of the target mapset to delimit the raster boundaries of the output .tif. If you would like to download only a specific subset of the raster, you would have to POST a processing chain to the mapset, containing a g.region and exporter module. (However, it would be a nice extension to be able to use the .../geotiff_async endpoint and POST .json containing the desired raster extent)
  • .../geotiff_async_export tries to download the entire raster map by first setting the region to the specified raster. However, there is a certain cell limit attributed to each user and if that cell limit is exceeded, the process fails. Depending on the raster map, it might be too large to be allowed for download.

griembauer avatar Oct 25 '21 11:10 griembauer

Hey, Guido

Thanks for the explanation. I overlooked the POST part. Now it works, though I'm not allowed to get it at the original resolution given my role.

If you allow me the suggestion, maybe add those details in the documentation, so users get a quicker and clear understanding of which endpoint to use.

image

veroandreo avatar Oct 25 '21 12:10 veroandreo