Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
adding subset lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
vggonzal authored and vggonzal committed Aug 16, 2023
1 parent e1d005d commit 0663bb6
Show file tree
Hide file tree
Showing 5 changed files with 598 additions and 24 deletions.
40 changes: 37 additions & 3 deletions hydrocronapi/controllers/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,43 @@ def format_subset_csv(results: Generator, polygon, fields):
return csv



def lambda_handler(event, context):
"""
This function queries the HUC database for relevant results
This function queries the database for relevant results
"""
print("test subset")
return "200"
print("test timeseries 3")
print("body")
print(event['body'])
print("feature")
print(event['body']['feature'])

feature = event['body']['feature']
subsetpolygon = event['body']['subsetpolygon']
start_time = event['body']['start_time']
end_time = event['body']['end_time']
output = event['body']['output']
fields = event['body']['fields']

results = getsubset_get(feature, subsetpolygon, start_time, end_time, output, fields)

data = {}

status = "200 OK"

data['status'] = status
data['time'] = str(10) + " ms."
data['hits'] = 10

data['search on'] = dict(
parameter="identifier",
exact="exact",
page_number=0,
page_size=20
)

data['results'] = results

return data


2 changes: 1 addition & 1 deletion hydrocronapi/controllers/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def lambda_handler(event, context):
"""
This function queries the database for relevant results
"""
print("test timeseries 2")
print("test timeseries 3")
print("body")
print(event['body'])
print("feature")
Expand Down
Loading

0 comments on commit 0663bb6

Please sign in to comment.