In this repo, FastAPI is used as a wrapper around EarthAccess library. There are 4 endpoints defined which can be validated in Postman for tracking,
- start_download - Downloads files from search result locally and uploads them to S3. Returns a unique job id of 8 characters.
- status - Returns latest status of the job.
- get_file_path - Returns S3 path of the uploaded granules.
- get_metadata - Displays the metadata of granules.
Accounts in AWS and EarthData are necessary for using this wrapper application. The credentials for these accounts should be entered in .env file. Postman and Docker needs to be installed.
Run the following commands:
docker build -t <image-name> .
docker run -p 8080:8080 <image-name>
Once the Docker container is up and running, the following endpoints can be used to send GET/POST/PUT requests from http://0.0.0.0:8080/:
Request type | Endpoint | Parameters |
---|---|---|
GET | / | N/A |
PUT | /start_download | short_name, date_range, bounding_box(coordinates can be entered manually or passed as a text in Request Body), concept_id(optional) |
POST | /status | job_id |
POST | /get_file_path | job_id |
POST | /get_metadata | job_id |