Skip to content

Commit

Permalink
Using v2 (#277)
Browse files Browse the repository at this point in the history
* docs using v2

* update actinia version to v2

* linting

Co-authored-by: anikaweinmann <aweinmann@mundialis.de>
  • Loading branch information
anikaweinmann and anikaweinmann committed Nov 23, 2021
1 parent 63048c7 commit 4826b26
Show file tree
Hide file tree
Showing 18 changed files with 174 additions and 159 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,48 +47,48 @@ Actinia is also available on [OSGeoLive](https://live.osgeo.org/en/overview/acti
* List all locations that are available in the actinia persistent database:

```bash
curl -u 'demouser:gu3st!pa55w0rd' -X GET "https://actinia.mundialis.de/api/v1/locations"
curl -u 'demouser:gu3st!pa55w0rd' -X GET "https://actinia.mundialis.de/api/v2/locations"
```

* List all mapsets in the location latlong_wgs84:

```bash
curl -u 'demouser:gu3st!pa55w0rd' -X GET "https://actinia.mundialis.de/api/v1/locations/latlong_wgs84/mapsets"
curl -u 'demouser:gu3st!pa55w0rd' -X GET "https://actinia.mundialis.de/api/v2/locations/latlong_wgs84/mapsets"
```

* List all space-time raster datasets (STRDS) in location latlong_wgs84 and mapset Sentinel_timeseries:

```bash
curl -u 'demouser:gu3st!pa55w0rd' -X GET "https://actinia.mundialis.de/api/v1/locations/latlong_wgs84/mapsets/modis_ndvi_global/strds"
curl -u 'demouser:gu3st!pa55w0rd' -X GET "https://actinia.mundialis.de/api/v2/locations/latlong_wgs84/mapsets/modis_ndvi_global/strds"
```

* List all raster map layers of the STRDS:

```bash
curl -u 'demouser:gu3st!pa55w0rd' -X GET "https://actinia.mundialis.de/api/v1/locations/latlong_wgs84/mapsets/modis_ndvi_global/strds/ndvi_16_5600m/raster_layers"
curl -u 'demouser:gu3st!pa55w0rd' -X GET "https://actinia.mundialis.de/api/v2/locations/latlong_wgs84/mapsets/modis_ndvi_global/strds/ndvi_16_5600m/raster_layers"
```

### Landsat and Sentinel-2 NDVI computation

* Compute the NDVI of the top of athmosphere (TOAR) corrected Landsat4 scene LC80440342016259LGN00:

```bash
curl -u 'demouser:gu3st!pa55w0rd' -X POST "https://actinia.mundialis.de/api/v1/landsat_process/LC80440342016259LGN00/TOAR/NDVI"
curl -u 'demouser:gu3st!pa55w0rd' -X POST "https://actinia.mundialis.de/api/v2/landsat_process/LC80440342016259LGN00/TOAR/NDVI"
```

* NDVI computation of Sentinel-2A scene S2A_MSIL1C_20170212T104141_N0204_R008_T31TGJ_20170212T104138:

```bash
curl -u 'demouser:gu3st!pa55w0rd' -X POST "https://actinia.mundialis.de/api/v1/sentinel2_process/ndvi/S2A_MSIL1C_20170212T104141_N0204_R008_T31TGJ_20170212T104138"
curl -u 'demouser:gu3st!pa55w0rd' -X POST "https://actinia.mundialis.de/api/v2/sentinel2_process/ndvi/S2A_MSIL1C_20170212T104141_N0204_R008_T31TGJ_20170212T104138"
```

The results of the asynchronous computations are available as GeoTIFF file in a cloud storage for download.

### List of available endpoints

To see a simple **list of endpoints** (and more), consult the "paths" section in the [API JSON](https://actinia.mundialis.de/api/v1/swagger.json); or, to list the available endpoints on command line, run
To see a simple **list of endpoints** (and more), consult the "paths" section in the [API JSON](https://actinia.mundialis.de/api/v2/swagger.json); or, to list the available endpoints on command line, run

```bash
# sudo npm install -g json
curl -u 'demouser:gu3st!pa55w0rd' -X GET https://actinia.mundialis.de/api/v1/swagger.json | json paths | json -ka
curl -u 'demouser:gu3st!pa55w0rd' -X GET https://actinia.mundialis.de/api/v2/swagger.json | json paths | json -ka
```
6 changes: 3 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ docker-compose -f docker/docker-compose.yml up
```
Now you have a running actinia instance locally! Check with
```
curl http://127.0.0.1:8088/api/v1/version
curl http://127.0.0.1:8088/api/v2/version
```

* Having __trouble__? See [How to fix common startup errors](#startup-errors) below.
Expand Down Expand Up @@ -144,7 +144,7 @@ grass /actinia_core/grassdb/nc_spm_08/PERMANENT --exec v.info -g myrandom
You now have some data which you can access through actinia. To get information
via API, start actinia with gunicorn and run
```
curl -u actinia-gdi:actinia-gdi http://127.0.0.1:8088/api/v1/locations/nc_spm_08/mapsets
curl -u actinia-gdi:actinia-gdi http://127.0.0.1:8088/api/v2/locations/nc_spm_08/mapsets
```
The folder where you downloaded the data into (`/actinia_core/grassdb`) is mounted into your docker container via the compose file, so all data is kept, even if your docker container restarts.

Expand Down Expand Up @@ -182,7 +182,7 @@ Examples:
* https://actinia.mundialis.de/latest/version
* https://actinia.mundialis.de/latest/health_check
* requires authorization (actinia user):
* https://actinia.mundialis.de/api/v1/locations
* https://actinia.mundialis.de/api/v2/locations

# Cloud deployment with multiple actinia_core instances

Expand Down
2 changes: 1 addition & 1 deletion docker/create-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo "
> build/stylesheets/actinia.css

# download the json file locally
wget -O build/actinia.json "http://127.0.0.1:8088/api/v1/swagger.json"
wget -O build/actinia.json "http://127.0.0.1:8088/api/v2/swagger.json"

# run spectacle to generate the api docs
docker run -v $(pwd)/build:/tmp -t sourcey/spectacle \
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ and compile it.
7. Check the service with curl

```bash
export ACTINIA_URL=http://localhost:5000/api/v1
ACTINIA_VERSION="v2"
export ACTINIA_URL="http://localhost:5000/api/${ACTINIA_VERSION}"
export AUTH='-u superadmin:abcdefgh'

curl ${AUTH} -X GET ${ACTINIA_URL}/locations
Expand Down
48 changes: 24 additions & 24 deletions docs/docs/tutorial_data_access.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ The output should look similar to this then:
"api_info": {
"endpoint": "locationmanagementresourceuser",
"method": "GET",
"path": "/api/v1/locations/nc_spm_08/info",
"request_url": "http://actinia.mundialis.de/api/v1/locations/nc_spm_08/info"
"path": "/api/v2/locations/nc_spm_08/info",
"request_url": "http://actinia.mundialis.de/api/v2/locations/nc_spm_08/info"
},
"datetime": "2019-08-01 20:30:05.881138",
"http_code": 200,
Expand Down Expand Up @@ -154,7 +154,7 @@ The output should look similar to this then:
"timestamp": 1564691405.8811285,
"urls": {
"resources": [],
"status": "http://actinia.mundialis.de/api/v1/resources/demouser/resource_id-181a0936-9deb-481c-a1a6-6c9f46f97594"
"status": "http://actinia.mundialis.de/api/v2/resources/demouser/resource_id-181a0936-9deb-481c-a1a6-6c9f46f97594"
},
"user_id": "demouser"
}
Expand All @@ -177,8 +177,8 @@ in the *process\_results* section:
"api_info": {
"endpoint": "listmapsetsresource",
"method": "GET",
"path": "/api/v1/locations/nc_spm_08/mapsets",
"request_url": "http://actinia.mundialis.de/api/v1/locations/nc_spm_08/mapsets"
"path": "/api/v2/locations/nc_spm_08/mapsets",
"request_url": "http://actinia.mundialis.de/api/v2/locations/nc_spm_08/mapsets"
},
"datetime": "2019-08-01 20:31:11.430294",
"http_code": 200,
Expand Down Expand Up @@ -225,7 +225,7 @@ in the *process\_results* section:
"timestamp": 1564691471.4302812,
"urls": {
"resources": [],
"status": "http://actinia.mundialis.de/api/v1/resources/demouser/resource_id-8365e42b-8111-4026-abb0-df86677ff3b9"
"status": "http://actinia.mundialis.de/api/v2/resources/demouser/resource_id-8365e42b-8111-4026-abb0-df86677ff3b9"
},
"user_id": "demouser"
}
Expand All @@ -248,8 +248,8 @@ location in the *process\_results* section:
"api_info": {
"endpoint": "mapsetmanagementresourceuser",
"method": "GET",
"path": "/api/v1/locations/nc_spm_08/mapsets/PERMANENT/info",
"request_url": "http://actinia.mundialis.de/api/v1/locations/nc_spm_08/mapsets/PERMANENT/info"
"path": "/api/v2/locations/nc_spm_08/mapsets/PERMANENT/info",
"request_url": "http://actinia.mundialis.de/api/v2/locations/nc_spm_08/mapsets/PERMANENT/info"
},
"datetime": "2019-08-01 20:31:51.810266",
"http_code": 200,
Expand Down Expand Up @@ -327,7 +327,7 @@ location in the *process\_results* section:
"timestamp": 1564691511.8102555,
"urls": {
"resources": [],
"status": "http://actinia.mundialis.de/api/v1/resources/demouser/resource_id-d949c5c7-9ab9-4ca9-afbf-6b91d7abec5a"
"status": "http://actinia.mundialis.de/api/v2/resources/demouser/resource_id-d949c5c7-9ab9-4ca9-afbf-6b91d7abec5a"
},
"user_id": "demouser"
}
Expand All @@ -354,8 +354,8 @@ The response lists all raster layers of the mapset in the
"api_info": {
"endpoint": "rasterlayersresource",
"method": "GET",
"path": "/api/v1/locations/ECAD/mapsets/PERMANENT/raster_layers",
"request_url": "http://actinia.mundialis.de/api/v1/locations/ECAD/mapsets/PERMANENT/raster_layers"
"path": "/api/v2/locations/ECAD/mapsets/PERMANENT/raster_layers",
"request_url": "http://actinia.mundialis.de/api/v2/locations/ECAD/mapsets/PERMANENT/raster_layers"
},
"datetime": "2018-05-30 09:13:51.745702",
"http_code": 200,
Expand Down Expand Up @@ -408,7 +408,7 @@ The response lists all raster layers of the mapset in the
"timestamp": 1527671631.745685,
"urls": {
"resources": [],
"status": "http://actinia.mundialis.de/api/v1/resources/demouser/resource_id-114c7229-da85-4866-a33e-38172835e05f"
"status": "http://actinia.mundialis.de/api/v2/resources/demouser/resource_id-114c7229-da85-4866-a33e-38172835e05f"
},
"user_id": "demouser"
}
Expand All @@ -432,8 +432,8 @@ section:
"api_info": {
"endpoint": "rasterlayerresource",
"method": "GET",
"path": "/api/v1/locations/ECAD/mapsets/PERMANENT/raster_layers/temperature_mean_yearly_celsius_60",
"request_url": "http://actinia.mundialis.de/api/v1/locations/ECAD/mapsets/PERMANENT/raster_layers/temperature_mean_yearly_celsius_60"
"path": "/api/v2/locations/ECAD/mapsets/PERMANENT/raster_layers/temperature_mean_yearly_celsius_60",
"request_url": "http://actinia.mundialis.de/api/v2/locations/ECAD/mapsets/PERMANENT/raster_layers/temperature_mean_yearly_celsius_60"
},
"datetime": "2018-05-30 09:17:15.437797",
"http_code": 200,
Expand Down Expand Up @@ -503,7 +503,7 @@ section:
"timestamp": 1527671835.4377818,
"urls": {
"resources": [],
"status": "http://actinia.mundialis.de/api/v1/resources/demouser/resource_id-7d4f36ba-3410-4281-b3e4-7b4aeff5f978"
"status": "http://actinia.mundialis.de/api/v2/resources/demouser/resource_id-7d4f36ba-3410-4281-b3e4-7b4aeff5f978"
},
"user_id": "demouser"
}
Expand Down Expand Up @@ -535,8 +535,8 @@ response:
"api_info": {
"endpoint": "syncstrdslisterresource",
"method": "GET",
"path": "api/v1/locations/ECAD/mapsets/PERMANENT/strds",
"request_url": "http://actinia.mundialis.de/api/v1/locations/ECAD/mapsets/PERMANENT/strds"
"path": "api/v2/locations/ECAD/mapsets/PERMANENT/strds",
"request_url": "http://actinia.mundialis.de/api/v2/locations/ECAD/mapsets/PERMANENT/strds"
},
"datetime": "2018-05-30 09:18:17.351918",
"http_code": 200,
Expand Down Expand Up @@ -585,7 +585,7 @@ response:
"timestamp": 1527671897.3519022,
"urls": {
"resources": [],
"status": "http://actinia.mundialis.de/api/v1/resources/demouser/resource_id-827f9272-9aa1-467e-8eba-def7003522e3"
"status": "http://actinia.mundialis.de/api/v2/resources/demouser/resource_id-827f9272-9aa1-467e-8eba-def7003522e3"
},
"user_id": "demouser"
}
Expand All @@ -609,8 +609,8 @@ All relevant information about strds
"api_info": {
"endpoint": "strdsmanagementresource",
"method": "GET",
"path": "/api/v1/locations/ECAD/mapsets/PERMANENT/strds/temperature_mean_1950_2013_yearly_celsius",
"request_url": "http://actinia.mundialis.de/api/v1/locations/ECAD/mapsets/PERMANENT/strds/temperature_mean_1950_2013_yearly_celsius"
"path": "/api/v2/locations/ECAD/mapsets/PERMANENT/strds/temperature_mean_1950_2013_yearly_celsius",
"request_url": "http://actinia.mundialis.de/api/v2/locations/ECAD/mapsets/PERMANENT/strds/temperature_mean_1950_2013_yearly_celsius"
},
"datetime": "2018-05-30 09:19:25.519419",
"http_code": 200,
Expand Down Expand Up @@ -684,7 +684,7 @@ All relevant information about strds
"timestamp": 1527671965.519405,
"urls": {
"resources": [],
"status": "http://actinia.mundialis.de/api/v1/resources/demouser/resource_id-15acb503-5ef9-4a89-89df-3a1291811a5d"
"status": "http://actinia.mundialis.de/api/v2/resources/demouser/resource_id-15acb503-5ef9-4a89-89df-3a1291811a5d"
},
"user_id": "demouser"
}
Expand All @@ -708,8 +708,8 @@ section of the JSON response:
"api_info": {
"endpoint": "strdsrastermanagement",
"method": "GET",
"path": "/api/v1/locations/ECAD/mapsets/PERMANENT/strds/temperature_mean_1950_2013_yearly_celsius/raster_layers",
"request_url": "http://actinia.mundialis.de/api/v1/locations/ECAD/mapsets/PERMANENT/strds/temperature_mean_1950_2013_yearly_celsius/raster_layers"
"path": "/api/v2/locations/ECAD/mapsets/PERMANENT/strds/temperature_mean_1950_2013_yearly_celsius/raster_layers",
"request_url": "http://actinia.mundialis.de/api/v2/locations/ECAD/mapsets/PERMANENT/strds/temperature_mean_1950_2013_yearly_celsius/raster_layers"
},
"datetime": "2018-05-30 09:20:31.197637",
"http_code": 200,
Expand Down Expand Up @@ -791,7 +791,7 @@ section of the JSON response:
"timestamp": 1527672031.1976202,
"urls": {
"resources": [],
"status": "http://actinia.mundialis.de/api/v1/resources/demouser/resource_id-3661533a-cb2b-4875-ac7a-be97a99e90da"
"status": "http://actinia.mundialis.de/api/v2/resources/demouser/resource_id-3661533a-cb2b-4875-ac7a-be97a99e90da"
},
"user_id": "demouser"
}
Expand Down
22 changes: 11 additions & 11 deletions docs/docs/tutorial_landsat_ndvi.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ processing result.
"api_info": {
"endpoint": "asyncephemerallandsatprocessingresource",
"method": "POST",
"path": "/api/v1/landsat_process/LC80440342016259LGN00/TOAR/NDVI",
"request_url": "http://actinia.mundialis.de/api/v1/landsat_process/LC80440342016259LGN00/TOAR/NDVI"
"path": "/api/v2/landsat_process/LC80440342016259LGN00/TOAR/NDVI",
"request_url": "http://actinia.mundialis.de/api/v2/landsat_process/LC80440342016259LGN00/TOAR/NDVI"
},
"datetime": "2018-05-30 10:52:19.545774",
"http_code": 200,
Expand All @@ -53,7 +53,7 @@ processing result.
"timestamp": 1527677539.5457737,
"urls": {
"resources": [],
"status": "https://actinia.mundialis.de/api/v1/resources/demouser/resource_id-a12d80c1-539a-45b9-a78c-ee4014f50d03"
"status": "https://actinia.mundialis.de/api/v2/resources/demouser/resource_id-a12d80c1-539a-45b9-a78c-ee4014f50d03"
},
"user_id": "demouser"
}
Expand All @@ -64,7 +64,7 @@ URL. Be aware that you have to use your status url as the resource id will chang
calls.

```bash
curl -L ${AUTH} -X GET "https://actinia.mundialis.de/api/v1/resources/demouser/resource_id-a12d80c1-539a-45b9-a78c-ee4014f50d03"
curl -L ${AUTH} -X GET "https://actinia.mundialis.de/api/v2/resources/demouser/resource_id-a12d80c1-539a-45b9-a78c-ee4014f50d03"
```

The final result will contain a complete processing list as well as
Expand All @@ -78,8 +78,8 @@ as well as univariate statistics of the computed NDVI scene.
"api_info": {
"endpoint": "asyncephemerallandsatprocessingresource",
"method": "POST",
"path": "/api/v1/landsat_process/LC80440342016259LGN00/TOAR/NDVI",
"request_url": "http:///actinia.mundialis.de/api/v1/landsat_process/LC80440342016259LGN00/TOAR/NDVI"
"path": "/api/v2/landsat_process/LC80440342016259LGN00/TOAR/NDVI",
"request_url": "http:///actinia.mundialis.de/api/v2/landsat_process/LC80440342016259LGN00/TOAR/NDVI"
},
"datetime": "2018-05-30 11:22:58.315162",
"http_code": 200,
Expand Down Expand Up @@ -659,10 +659,10 @@ as well as univariate statistics of the computed NDVI scene.
"timestamp": 1527679378.31516,
"urls": {
"resources": [
"http://actinia.mundialis.de/api/v1/resource/demouser/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/tmp80apvh0h.png",
"http://actinia.mundialis.de/api/v1/resource/demouser/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/LC80440342016259LGN00_TOAR_NDVI.tiff"
"http://actinia.mundialis.de/api/v2/resource/demouser/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/tmp80apvh0h.png",
"http://actinia.mundialis.de/api/v2/resource/demouser/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/LC80440342016259LGN00_TOAR_NDVI.tiff"
],
"status": "http://actinia.mundialis.de/api/v1/resources/demouser/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc"
"status": "http://actinia.mundialis.de/api/v2/resources/demouser/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc"
},
"user_id": "demouser"
}
Expand Down Expand Up @@ -692,9 +692,9 @@ available in the *process\_results* section:
The following links can be found in the **urls** section of the JSON
response that point to the created resources:

<http://actinia.mundialis.de/api/v1/resource/demouser/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/tmp80apvh0h.png>
<http://actinia.mundialis.de/api/v2/resource/demouser/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/tmp80apvh0h.png>

<http://actinia.mundialis.de/api/v1/resource/demouser/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/LC80440342016259LGN00_TOAR_NDVI.tiff>
<http://actinia.mundialis.de/api/v2/resource/demouser/resource_id-6282c634-42e1-417c-a092-c9b21c3283cc/LC80440342016259LGN00_TOAR_NDVI.tiff>

The preview image should look like this:

Expand Down
18 changes: 9 additions & 9 deletions docs/docs/tutorial_process_chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ response:
"api_info": {
"endpoint": "asyncephemeralresource",
"method": "POST",
"path": "/api/v1/locations/nc_spm_08/processing_async",
"request_url": "http://localhost/api/v1/locations/nc_spm_08/processing_async"
"path": "/api/v2/locations/nc_spm_08/processing_async",
"request_url": "http://localhost/api/v2/locations/nc_spm_08/processing_async"
},
"datetime": "2018-06-28 14:11:03.878996",
"http_code": 200,
Expand Down Expand Up @@ -590,7 +590,7 @@ response:
"timestamp": 1530195063.878975,
"urls": {
"resources": [],
"status": "http://localhost/api/v1/resources/admin/resource_id-f084adb6-53eb-42eb-abd1-ae2799a53561"
"status": "http://localhost/api/v2/resources/admin/resource_id-f084adb6-53eb-42eb-abd1-ae2799a53561"
},
"user_id": "admin"
}
Expand Down Expand Up @@ -717,8 +717,8 @@ works asynchronously:
"api_info": {
"endpoint": "asyncephemeralexportresource",
"method": "POST",
"path": "/api/v1/locations/latlong_wgs84/processing_async_export",
"request_url": "http://actinia.mundialis.de/api/v1/locations/latlong_wgs84/processing_async_export"
"path": "/api/v2/locations/latlong_wgs84/processing_async_export",
"request_url": "http://actinia.mundialis.de/api/v2/locations/latlong_wgs84/processing_async_export"
},
"datetime": "2018-05-02 21:05:34.873754",
"http_code": 200,
Expand All @@ -731,7 +731,7 @@ works asynchronously:
"timestamp": 1525287934.873754,
"urls": {
"resources": [],
"status": "https://actinia.mundialis.de/api/v1/resources/demouser/resource_id-ff5a89da-82fe-4f13-9f35-8872c4d0ccf7"
"status": "https://actinia.mundialis.de/api/v2/resources/demouser/resource_id-ff5a89da-82fe-4f13-9f35-8872c4d0ccf7"
},
"user_id": "demouser"
}
Expand All @@ -754,7 +754,7 @@ The finished response should look like this:
"endpoint": "asyncephemeralexportresource",
"method": "POST",
"path": "/locations/latlong_wgs84/processing_async_export",
"request_url": "http://actinia.mundialis.de/api/v1/locations/latlong_wgs84/processing_async_export"
"request_url": "http://actinia.mundialis.de/api/v2/locations/latlong_wgs84/processing_async_export"
},
"datetime": "2018-05-02 21:09:39.823857",
"http_code": 200,
Expand Down Expand Up @@ -1346,9 +1346,9 @@ The finished response should look like this:
"timestamp": 1525288179.8238533,
"urls": {
"resources": [
"http://actinia.mundialis.de/api/v1/resource/demouser/resource_id-60f3f012-4220-46ec-9110-694df49006c4/NDVI.tiff"
"http://actinia.mundialis.de/api/v2/resource/demouser/resource_id-60f3f012-4220-46ec-9110-694df49006c4/NDVI.tiff"
],
"status": "http://actinia.mundialis.de/api/v1/resources/demouser/resource_id-60f3f012-4220-46ec-9110-694df49006c4"
"status": "http://actinia.mundialis.de/api/v2/resources/demouser/resource_id-60f3f012-4220-46ec-9110-694df49006c4"
},
"user_id": "demouser"
}
Expand Down
Loading

0 comments on commit 4826b26

Please sign in to comment.