Skip to content

I-ALiRT - added api feature#1150

Open
laspsandoval wants to merge 1 commit intoIMAP-Science-Operations-Center:devfrom
laspsandoval:add_packets_query_api
Open

I-ALiRT - added api feature#1150
laspsandoval wants to merge 1 commit intoIMAP-Science-Operations-Center:devfrom
laspsandoval:add_packets_query_api

Conversation

@laspsandoval
Copy link
Contributor

This pull request refactors the ialirt_packets_query_api Lambda handler to support two mutually exclusive query modes for packet file retrieval: a UTC range mode using strict ISO 8601 timestamps, and an individual parameters mode using year, day-of-year, and optional time components. It also introduces comprehensive error handling for invalid or mixed query modes, and adds/updates tests to cover these scenarios.

Query API enhancements

  • Added support for two mutually exclusive query modes: UTC range mode (time_utc_start, time_utc_end) and individual params mode (year, doy, hh, mm, ss). Each mode builds the S3 prefix differently and applies appropriate time filtering.
  • Implemented error handling for mixed usage of query modes, missing required parameters, invalid date formats, and cases where the end time is before the start time. [1] [2]

Lambda handler improvements

  • Refactored the Lambda handler to use .get() for query parameters, handle missing keys gracefully, and apply post-filtering of files by exact time range when using UTC mode. [1] [2]
  • Updated filename parsing and filtering logic to support the new modes and ensure only the correct files are returned for each query type.

Testing updates

  • Added new tests to cover UTC range queries, individual param queries, error cases (invalid formats, missing params, mixed modes), and updated existing tests to match the new filename format.

@laspsandoval laspsandoval added this to the March 2026 milestone Mar 2, 2026
@laspsandoval laspsandoval self-assigned this Mar 2, 2026
@laspsandoval laspsandoval linked an issue Mar 2, 2026 that may be closed by this pull request
@laspsandoval laspsandoval requested a review from lacoak21 March 2, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

I-ALiRT API Feedback

1 participant