Unica Detect CLI Configuration
The Unica Detect CLI is a command-line interface tool for interacting with the HCL Unica Detect REST API. It enables administrators and integrators to manage Detect resources directly from a terminal, without requiring access to the web UI.
The CLI reads its connection settings from a properties file on the classpath.
| File | Priority | Purpose |
|---|---|---|
detect-cli.properties |
Default | Shipped default configuration |
Configuration File Location
Production (customer installation):
%HCL_UNICA_DETECT_HOME%\tools\conf\detect-cli.properties(Windows)$HCL_UNICA_DETECT_HOME/tools/conf/detect-cli.properties(Linux)
Configuration JSON Files
Download and extract the resource file to the desired folder say <path-to-resource-folder>. The resoure file contains sample JSON files, required to create profiles, feeds and destinations.
Configuration Properties
# ============================================================================
# Unica Platform Connection Settings
# ============================================================================
# Platform base URL (include protocol, hostname, port, and context path)
platform.baseUrl=http://default.hcl.in:<port>/unica
# Platform user ID for authentication (must have appropriate permissions)
platform.userid=asm_admin
# OAuth2 Client Credentials (obtain from clientDetails utility)
platform.clientId=<clientID>
platform.clientSecret=<clientsecret>
# ============================================================================
# Unica Detect Connection Settings
# ============================================================================
# Detect backend base URL (include protocol, hostname, port, and context path)
detect.baseUrl=http://default.hcl.in:<port>/detect
# ============================================================================
# HTTP Client Settings
# ============================================================================
# Connection timeout in milliseconds (default: 30 seconds)
cli.connectionTimeoutMillis=30000
# Socket read timeout in milliseconds (default: 30 seconds)
cli.socketTimeoutMillis=30000
Environment-Specific Configuration
For different environments, create separate properties files:
Production Environment
File: detect-cli.properties
platform.baseUrl=https://platform.example.com/unica
detect.baseUrl=https://detect.example.com/detect
platform.clientId=333333
platform.clientSecret=prod-secret-key
cli.connectionTimeoutMillis=60000
cli.socketTimeoutMillis=60000
Verifying Configuration
Before running configuration commands, verify your settings:
- Test Platform
Connectivity:
curl http://default.hcl.in:5001/unica/healthExpected response: HTTP 200 with health status
- Test Detect
Connectivity:
curl http://default.hcl.in:8080/detect/public/api/health_checkExpected response: HTTP 200 with {{ "msg": "string", "tenantId": "string", "uiVersion": "string" }} - Test OAuth2
Credentials:
# Run any CLI command - authentication is validated on first API call ./CliTool.sh get-all-kafka-cluster-namesIf credentials are invalid, you'll see:
HTTP 401 Unauthorized