-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added endpoint to the API for universal spin table #199
Added endpoint to the API for universal spin table #199
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the tests also need to be updated, but overall looks like a nice abstraction to me!
lambda_code_directory = Path(__file__).parent.parent / "lambda_code" / "SDSCode" | ||
lambda_code_directory_str = str(lambda_code_directory.resolve()) | ||
|
||
spin_table_code = lambda_code_directory / "spin_table_api.py" | ||
# Create Lambda for universal spin table API | ||
spin_spin_api_handler = api_gateway_stack.APILambda( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spin_spin_api_handler = api_gateway_stack.APILambda( | |
spin_api_stack = api_gateway_stack.APILambda( |
All the other routes live in the sds_data_manager stack. Should this be moved up there too? It kind of sticks out as the only Lambda at this level right now. But maybe we can reorganize again in a follow-up PR...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think future PR because I would like to group API lambda out. But I wanted to wait until other PR is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I just have a few non-blocking comments/suggestions
|
||
|
||
def lambda_handler(event, context): | ||
print(event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reckon that you have this here for debugging purposes? Could it be removed?
@@ -0,0 +1,8 @@ | |||
import json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been bugging everyone to add module docstrings so I will do the same here 😅
def lambda_template(): | ||
app = cdk.App() | ||
lambda_code_directory = ( | ||
Path(__file__).parent.parent.parent / "sds_data_manager/lambda_code/SDSCode" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could define the top-level directory in the __init__.py
file and import/use it from there, like we do in the imap_processing
repo: https://github.com/IMAP-Science-Operations-Center/imap_processing/blob/59b42d30453b769455e943ca9913a2cd1317f27a/imap_processing/__init__.py#L10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a great idea. Do you mind if I do this and function doc string in the upcoming PR?
Change Summary
Create endpoint for spin table query. Updated how we add route to the API and updated places that uses it.
New Dependencies
New Files
Updated Files
closes IMAP-Science-Operations-Center/imap_processing#243