SearchAPI-v3 is a wrapper around the asf-search python module using a serverless deployment with the FastAPI web framework and AWS lambda.
| Endpoint | Description | Methods |
|---|---|---|
| `/` | server configuration info | `GET` |
| `/health` | same as root `/` | `GET` |
| `/services/search/param` | Search via any valid asf-search parameters | `GET` `POST` `HEAD` |
| `/services/search/baseline` | Create a baseline stack based off a given reference and optional dataset | `GET` `POST` `HEAD` |
| Instance | Branch | Description, Instructions, Notes |
|---|---|---|
| Features | feat-* | Always branch off dev, for new features |
| Issues | bugfix-* | Always branch off dev, for bugfixes |
| development | dev | Beginning integration testing happens here, deploys to test-staging deployment |
| testing | test | Only accepts merges from development, test deployment |
| production staging and integration testing | prod-staging | Only acepts merges from testing, deploys to prod-staging deployment |
| release | prod | only accepts merges from prod-staging, release branch, prod deployment |
To install locally run the following in a terminal (we highly recommend installing using a virtual environment)
pip install -r requirements.txt
pip install .To install test requirements, run
pip install -r tests/requirements.txtTo run the API locally run the following in a terminal
uvicorn src.SearchAPI.application:app --reload --port 8080The api should now be available via your localhost at http://127.0.0.1:8080 and can be opened and queried with your browser or network tool of choice.
After running the API (see Running Locally above), in order to run the test suite locally run the following:
pytest --api "http://127.0.0.1:8080" -n auto "tests/yml_tests/"Tests should be written to relevant subfolder & files in /tests
The test suite uses the pytest-automation pytest plugin which allows us to define and re-use input for test cases in the yaml format. Test cases are written to files in tests/yml_tests/, and reusable resources for those tests tests/yml_tests/Resources/.
tests:
- Test Nisar Product L1 RSLC: # this is a test case
product: NISAR_L1_PR_RSLC_087_039_D_114_2005_DHDH_A_20251102T222008_20251102T222017_T00407_N_P_J_001.yml # this file should be in `tests/yml_tests/Resources/`. See other yml files in the folder to see how you might structure the yml object
product_level: L1
- Test Nisar Product L2 GSLC: # this is another test case
product: NISAR_L2_PR_GSLC_087_039_D_112_2005_DHDH_A_20251102T221859_20251102T221935_T00407_N_F_J_001.yml
product_level: L2We can create the mapping from our yaml test cases in tests/yml_tests/pytest-config.yml, which will be used to call the desired python function in tests/yml_tests/pytest-managers.py
In tests/yml_tests/pytest-config.yml:
- For running ASFProduct tests:
required_keys: ['product', 'product_level'] # the keys the test case requires
method: test_NISARProduct # the python function in pytest-managers.py that will be called
required_in_title: Test Nisar Product # (OPTIONAL) will only run test cases defined with `Test Nisar Product` in the name, so the above two test cases would be run with our tests.In tests/yml_tests/pytest-managers.py:
def test_new_endpoint(**args) -> None: # Must match the name in pytest-config.yml like above for `method`
test_new_endpoint(client=client, **args)