Skip to content

Commit 75bb333

Browse files
committed
Update README.md
1 parent 822f640 commit 75bb333

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Asynchronous jobs are created using a HTTP `POST` request to the root api entpoi
3838
POST /
3939
{
4040
"path": "path/to/file.nc",
41+
"task": "mask_bbox",
4142
"bbox": [south, north, west, east]
4243
}
4344
```
@@ -48,6 +49,7 @@ where `south`, `north`, `west`, `east` are floats and `path` is the path to the
4849
POST /
4950
{
5051
"path": "path/to/file.nc",
52+
"task": "mask_country",
5153
"country": "deu"
5254
}
5355
```
@@ -58,38 +60,39 @@ for, e. g. Germany. To mask out all sea and antarctica data use:
5860
POST /
5961
{
6062
"path": "path/to/file.nc",
61-
"landonly": true
63+
"task": "mask_landonly"
6264
}
6365
```
6466

6567
The response is a JSON like this:
6668

6769
```
6870
{
71+
"file_name": "isimip-download-1eff769a7edd0a8076f11dc85609f0090562a671.zip",
72+
"file_url": "https://files.isimip.org/api/v1/output/isimip-download-1eff769a7edd0a8076f11dc85609f0090562a671.zip",
6973
"id": "5741ca0e7f824d37ef23e107f5e5261a31e974a6",
7074
"job_url": "http://127.0.0.1:5000/5741ca0e7f824d37ef23e107f5e5261a31e974a6",
71-
"meta": {
72-
"output_path": "path/to/file.nc"
73-
},
74-
"status": "queued"
75+
"meta": {},
76+
"status": "queued",
77+
"ttl": 604800
7578
}
7679
```
7780

7881
Performing the initial request again, or performing a `GET` on the url given in `job_url`, will give an update on the job status, e.g.
7982

8083
```
8184
{
82-
"file_url": "http://127.0.0.1/api/output/path/to/file.nc",
85+
"file_name": "isimip-download-1eff769a7edd0a8076f11dc85609f0090562a671.zip",
86+
"file_url": "https://files.isimip.org/api/v1/output/isimip-download-1eff769a7edd0a8076f11dc85609f0090562a671.zip",
8387
"id": "5741ca0e7f824d37ef23e107f5e5261a31e974a6",
8488
"job_url": "http://127.0.0.1:5000/5741ca0e7f824d37ef23e107f5e5261a31e974a6",
85-
"meta": {
86-
"output_path": "path/to/file.nc"
87-
},
88-
"status": "finished"
89+
"meta": {"created_files": 1, "total_files": 1},
90+
"status": "finished",
91+
"ttl": 604800
8992
}
9093
```
9194

92-
When the job is finished, the resulting file is located at `path/to/file.nc` relative to the path given in `OUTPUT_PATH` in `.env`. When `OUTPUT_PATH` is made public via a web server (e.g. NGINX, see below for deployment), the file can be downloaded under the URL given by `file_url`.
95+
When the job is finished, the resulting file is located at `file_name` relative to the path given in `OUTPUT_PATH` in `.env`. When `OUTPUT_PATH` is made public via a web server (e.g. NGINX, see below for deployment), the file can be downloaded under the URL given by `file_url`.
9396

9497
The following exaples can be used from the command line with [httpie](https://httpie.org/) or [curl](https://curl.haxx.se/):
9598

@@ -98,9 +101,9 @@ http :5000 path=path/to/file.nc bbox=:"[0, 10, 0, 10]"
98101
http :5000 path=path/to/file.nc country=deu
99102
http :5000 path=path/to/file.nc landonly:=true
100103
101-
curl 127.0.0.1:5000 -H "Content-Type: application/json" -d '{"path": "path/to/file.nc", "bbox": [south, north, west, east]}'
102-
curl 127.0.0.1:5000 -H "Content-Type: application/json" -d '{"path": "path/to/file.nc", "country": "deu"}'
103-
curl 127.0.0.1:5000 -H "Content-Type: application/json" -d '{"path": "path/to/file.nc", "landonly": true}'
104+
curl 127.0.0.1:5000 -H "Content-Type: application/json" -d '{"path": "path/to/file.nc", "task": "mask_bbox","bbox": [south, north, west, east]}'
105+
curl 127.0.0.1:5000 -H "Content-Type: application/json" -d '{"path": "path/to/file.nc", "task": "mask_country", "country": "deu"}'
106+
curl 127.0.0.1:5000 -H "Content-Type: application/json" -d '{"path": "path/to/file.nc", "task": "mask_landonly"}'
104107
```
105108

106109
Deployment

0 commit comments

Comments
 (0)