Skip to content

I-ALiRT - Archive query api#1143

Merged
laspsandoval merged 5 commits intoIMAP-Science-Operations-Center:devfrom
laspsandoval:archive_query_api
Feb 27, 2026
Merged

I-ALiRT - Archive query api#1143
laspsandoval merged 5 commits intoIMAP-Science-Operations-Center:devfrom
laspsandoval:archive_query_api

Conversation

@laspsandoval
Copy link
Copy Markdown
Contributor

This pull request introduces a new Lambda-based Archive Query API for the I-ALiRT system, enabling users to query available archive files in S3 by date and version. The API is fully integrated into the infrastructure and is accompanied by comprehensive unit tests to ensure correct filtering and error handling.

Key changes:

Archive Query API Implementation:

  • Added a new Lambda function (ialirt_archive_query_api.py) that handles GET requests to query available I-ALiRT archive files in S3, supporting optional filtering by year, month, day, and version. The Lambda validates input parameters, constructs the appropriate S3 prefix, and returns matching filenames as JSON.

Infrastructure Integration:

  • Registered the new Archive Query API Lambda in the CDK construct (ialirt_api_manager_construct.py), including role permissions and an API route (/ialirt-archive-query) for GET requests.

Testing:

  • Added a suite of unit tests (test_ialirt_archive_query_api.py) covering various query scenarios, including filtering by date and version, as well as error cases for invalid or incomplete parameters.# Change Summary

config=botocore.client.Config(signature_version="s3v4"),
)

response = s3_client.list_objects_v2(Bucket=bucket, Prefix=prefix)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list objects call only returns up to 1000. Not sure if that will cause an issue here but may be worth double checking in case someone wants to query without any parameters specified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice point. I might make the year required then.

Copy link
Copy Markdown
Contributor

@lacoak21 lacoak21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I just had one question

@laspsandoval laspsandoval merged commit 5328a3a into IMAP-Science-Operations-Center:dev Feb 27, 2026
2 checks passed
@laspsandoval laspsandoval deleted the archive_query_api branch February 27, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants