Skip to content

Conversation

@tomaz-lc
Copy link
Contributor

Description

This PR implements SDK methods and CLI commands for managing search downloads (WIP functionality which hasn't been released yet and it's under development).

Changes

  • Add SDK methods to Manager.py for all search download operations (initiate, status, list, cancel, wait)
  • Create new SearchDownload.py CLI module with subcommands for managing download jobs
  • Wire up search-download action in main CLI entry point
  • Auto-generate long-lived JWT tokens (8 hours default) when starting download jobs

SDK Methods

Method Description
getJWT(expiry_seconds) Generate JWT with custom expiry timestamp
initiateSearchDownload() Start a new download job with query parameters
getSearchDownloadStatus() Get detailed status of a job by ID
listSearchDownloads() List all download jobs with pagination
cancelSearchDownload() Cancel a running job
waitForSearchDownload() Poll until completion with optional callback

CLI Usage

# Start a download job (auto-generates 8-hour token)
limacharlie search-download start -q "event_type:NEW_PROCESS" -s now-1h -e now

# Start and wait for completion
limacharlie search-download start -q "event_type:NEW_PROCESS" -s now-1h -e now --wait

# Custom token lifetime (10 hours)
limacharlie search-download start -q "*" -s now-6h -e now --token-hours 10

# Check job status
limacharlie search-download status <job-id>

# List all jobs
limacharlie search-download list --limit 10

# Wait for completion with progress
limacharlie search-download wait <job-id>

# Get download URL
limacharlie search-download url <job-id>

# Cancel a job
limacharlie search-download cancel <job-id>

# JSON output for scripting
limacharlie search-download start -q "*" -s now-1h -e now --json
limacharlie search-download status <job-id> --json

Related PRs

Implement full CLI and SDK support for search download operations:

SDK methods (Manager.py):
- getJWT: Generate JWT with custom expiry for long-running jobs
- initiateSearchDownload: Start a new download job
- getSearchDownloadStatus: Get detailed status of a job
- listSearchDownloads: List all download jobs for the organization
- cancelSearchDownload: Cancel a running download job
- waitForSearchDownload: Wait for job completion with progress callback

CLI commands (limacharlie search-download):
- start: Initiate a download job (auto-generates 8-hour token)
- status: Check job status
- list: List all jobs
- cancel: Cancel a job
- wait: Wait for completion with progress display
- url: Get download URL for completed jobs

The start command includes --wait flag to wait for completion inline,
and --token-hours to control JWT lifetime (default 8h for 6h max jobs).
@tomaz-lc tomaz-lc force-pushed the feat/search-download branch from d48a9ab to 3e46f63 Compare January 13, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants