synth_ai.sdk.harbor.uploader
HarborDeploymentUploader - Upload deployments to Harbor API.
This module handles the API interactions for creating and managing
Harbor deployments. It provides both sync and async interfaces.
Example:
Functions
upload_harbor_deployment
spec: HarborBuildSpec defining the deploymentapi_key: Synth API key (default: from SYNTH_API_KEY env)backend_url: Synth backend URL (default: from SYNTH_BACKEND_URL env)auto_build: Whether to trigger build immediately (default: True)wait_for_ready: Whether to wait for build completion (default: False)build_timeout_s: Maximum time to wait for build (default: 600s)
- HarborDeploymentResult with deployment details
HarborAPIError: If API request failsFileNotFoundError: If Dockerfile or context_dir doesn’t existValueError: If package exceeds size limitTimeoutError: If wait_for_ready=True and build times out
upload_harbor_deployment_async
Classes
HarborAPIError
Error from Harbor API.
HarborDeploymentUploader
Upload and manage Harbor deployments via API.
Handles authentication, request formatting, and error handling
for Harbor deployment operations.
Attributes:
backend_url: Synth backend URLapi_key: Synth API key for authenticationtimeout: Request timeout in seconds
create_deployment_async
spec: HarborBuildSpec defining the deploymentauto_build: Whether to trigger build immediately (default: True)
- HarborDeploymentResult with deployment details
HarborAPIError: If API request failsFileNotFoundError: If Dockerfile or context_dir doesn’t existValueError: If package exceeds size limit
create_deployment
spec: HarborBuildSpec defining the deploymentauto_build: Whether to trigger build immediately (default: True)
- HarborDeploymentResult with deployment details
HarborAPIError: If API request fails
get_deployment_status_async
deployment_id: UUID of the deployment
- Status dictionary with deployment details and build history
get_deployment_status
wait_for_build_async
deployment_id: UUID of the deploymenttimeout_s: Maximum time to wait in secondspoll_interval_s: Interval between status checks
- Final status dictionary
TimeoutError: If build doesn’t complete within timeoutHarborAPIError: If build fails
wait_for_build
trigger_build_async
deployment_id: UUID of the deployment
- Build information with build_id
trigger_build
list_deployments_async
status: Filter by status (pending, building, ready, failed)limit: Maximum number of resultsoffset: Pagination offset
- List of deployment dictionaries