Provisioning API
This page describes how to use the provisioning API
The Lenses Provisioning System allows you to manage Lenses connections declaratively through YAML manifests. It provides a GitOps-friendly approach to managing your Lenses infrastructure, enabling version control, automated deployments, and consistent configuration across environments.
Key features
Declarative Configuration: Define your entire Lenses infrastructure in YAML
File Management: Upload and manage SSL certificates, keystores, and other binary files
Validation: Comprehensive validation with detailed error messages
Selective Updates: Update only specific connections without affecting others
File Preservation: Existing files are preserved when not explicitly replaced
Connectivity Testing: Optional connectivity validation for all connections
API endpoints
File upload
Files are uploaded as part of the multipart form data:
curl -X POST "https://lenses-server/api/v1/state/connections/upload" \
-H "Authorization: Bearer your-token" \
-F "provisioning=@provisioning.yaml" \
-F "keystore.jks=@keystore.jks" \
-F "truststore.jks=@truststore.jks"File preservation
When updating connections, existing files are preserved if not explicitly provided in the new request. This allows for selective updates without losing existing SSL certificates or other files.
Upload provisioning manifest
Endpoint: POST /api/v1/state/connections/upload
Description: Uploads a complete provisioning manifest with files. This replaces the entire connection state.
Request: multipart/form-data
provisioning: YAML manifest fileAdditional files: SSL certificates, keystores, etc.
Response: ProvisioningValidationResponse
Validate provisioning manifest
Endpoint: POST /api/v1/state/connections/validate/upload
Description: Validates a provisioning manifest without applying changes (dry-run).
Request: Same as upload endpoint Response: ProvisioningValidationResponse
If a connection fails its connectivity test, its error gives the type of failure or the HTTP status the service returned, and points to the Agent logs. For a caller with the administration:GetLensesLogs permission, the error includes the detail from the Agent log instead. That detail can include what the tested service returned, so grant GetLensesLogs only to operators and administrators.
Get current provisioning state
Endpoint: GET /api/v1/state/connections
Description: Retrieves the current provisioning.yaml file contents.
Response: Raw YAML content
Last updated
Was this helpful?

