hotfix: support all subscriptions api results endpoint query parameters#1209
hotfix: support all subscriptions api results endpoint query parameters#1209asonnenschein wants to merge 3 commits intomainfrom
Conversation
tbarsballe
left a comment
There was a problem hiding this comment.
One issue noted inline, aside from that it appears to work well.
I did get some unhelpful error messages when I messed up the time interval syntax, but that's more an issue with the Subscriptions API itself, so out-of-scope here.
% planet subscriptions results 3ad50be0-05ea-4a1c-82cc-1e288211e627 --created 2026-03-07/..
Error: {"error":{"reason":"Unexpected error","details":[]}}
| * `--created`: Filter results by creation time or an interval of creation times. | ||
| * `--updated`: Filter results by update time or an interval of update times. | ||
| * `--completed`: Filter results by completion time or an interval of completion times. | ||
| * `--user-id`: Filter by user ID. Only available to organization admins. Accepts "all" or a specific user ID. |
There was a problem hiding this comment.
The most useful of the supported properties, item_datetime, appears to be missing.
Seems like this wasn't included in the TODO, but it is in the API reference
I'll also note user_id is not included as a supported option in the API reference for getResults, so I don't think it is correct to include here. I believe (at least according to the documentation) it is only supported at the "subscriptions list" level (which the SDK does already support)
| @click.option( | ||
| '--completed', | ||
| help="""Filter results by completion time or interval. See documentation | ||
| for examples.""") |
There was a problem hiding this comment.
Is it worth including RFC 3339 in the help message? That way people who are familiar don't have to fall back to the documentation. Or do you think that would just add more confusion for those who aren't.
Whatever you feel is best ... I'm thinking probably just leave this as-is, but figured it's at least worth considering.
Summary
Adds missing query parameters (
created,updated,completed,user_id) to Subscriptions API results endpoints, aligning with the OpenAPI specification.Changes
planet/clients/subscriptions.py): Added 4 query parameters toget_results()andget_results_csv()with comprehensive docstringsplanet/sync/subscriptions.py): Updated to accept and forward new parametersplanet/cli/subscriptions.py): Added--created,--updated,--completed,--user-idoptions toresultscommanddocs/cli/cli-subscriptions.md): Added "Filtering Results" section with examplesAll datetime parameters support RFC 3339 format with date-times, closed intervals, and open intervals.
Example Usage
Python: