hysds / pele

REST API for HySDS Datasets
Apache License 2.0
0 stars 0 forks source link

NSDS-754 update pele API to support queries for on-demand use cases #12

Closed DustinKLo closed 3 years ago

DustinKLo commented 3 years ago

related ticket: https://jira.jpl.nasa.gov/browse/NSDS-754

added support for time range filtering (starttime, endtime) added support for polygon filtering cleaned up some code (imports, proper logging for errors, etc.)

@pymonger @hookhua

DustinKLo commented 3 years ago

example request with start_time and polygon in a POST request:

curl -X POST "https://###.###.##.###/pele/api/v0.1/pele/dataset/track_frame-state-config/dataset_ids" -H "accept: application/json" -H "Content-Type: application/json" -d '{ 
    "start_time": "2021-01-01T00:00:00", 
    "polygon": [
        [
            [148.8708205955424,-34.60693233006173],
            [148.8708205955424,-24.8851907122672],
            [154.14082542755582,-24.8851907122672],
            [154.14082542755582,-34.60693233006173],
            [148.8708205955424,-34.60693233006173]
        ]
    ]
}'

response:

{
  "success": true,
  "message": null,
  "dataset_ids": [
    "track_frame_011_016_105_state-config",
    "track_frame_011_016_102_state-config",
    "track_frame_011_016_103_state-config"
  ],
  "total": 3,
  "count": 3,
  "page_size": 10,
  "offset": 0
}
pymonger commented 3 years ago

@DustinKLo: this looks great so far. Before we approve, there is a meeting later today with the calval team (I'll forward you the invite) who'll be using this feature and we would like to show this example in a notebook on the ADE. Could you work with @jimmie to update the datasets notebook on nisar-on-demand-use-cases with a similar example you showed above? Also from this meeting let's capture any additional pele API requirements that the calval team may need and include those in this PR.