get-all-datasource-names-for-logged-in-user

Description

Retrieves a list of all database datasource names that are accessible to the currently authenticated user. Datasources are configured in Unica Platform's datasource registry and represent database connection configurations used throughout Detect for:

  • Profile Storage: Storing customer profile data and attributes
  • Audience Segments: Persisting static and dynamic audience segment definitions
  • Destination Publishing: Publishing events to database destinations
  • Data Integration: Connecting to external data sources for enrichment

The datasources returned are filtered based on the permissions granted to the user specified in platform.userid configuration.

Syntax

Windows:

CliTool.bat get-all-datasource-names-for-logged-in-user

Linux :

./CliTool.sh get-all-datasource-names-for-logged-in-user

Parameters

This command does not require any parameters or options. It uses the authentication credentials from detect-cli.properties to determine which datasources the user can access.

Sample Execution

Windows:

C:\> cd %HCL_UNICA_DETECT_HOME%\tools\bin
C:\> CliTool.bat get-all-datasource-names-for-logged-in-user
Found 5 datasources:
[UnicaDetectDS, MARKETING_ANALYTICS_DS, CRM_DATA_DS, ORDERS_DB_DS, CUSTOMER_360_DS]

Linux:

$ cd $HCL_UNICA_DETECT_HOME/tools/bin
$ ./CliTool.sh get-all-datasource-names-for-logged-in-user
Found 5 datasources:
[UnicaDetectDS, MARKETING_ANALYTICS_DS, CRM_DATA_DS, ORDERS_DB_DS, CUSTOMER_360_DS]

Output Format

The command produces two lines of output:

  1. Count Line: Found <count> datasources: where <count> is the total number of datasources
  2. Name List: A Java List representation with datasource names: [NAME1, NAME2, NAME3, ...]

    Example Outputs:

    Multiple Datasources:
    Found 3 datasources:
    [UnicaDetectDS, MARKETING_DB, CRM_DATASOURCE]
    No Datasources:
    Found 0 datasources:
    []
    Single Datasource:
    Found 1 datasources:
    [UnicaDetectDS]

Understanding Datasources

A datasource in Unica Platform represents a database connection configuration containing:

  • Database server hostname and port
  • Database name
  • JDBC driver class
  • Connection credentials (username/password)
  • Connection pool settings
  • Additional JDBC properties

Each datasource has a unique name (e.g., UnicaDetectDS) that is used as a reference throughout Detect when configuring:

  • Profile tables (where customer data is stored)
  • Destination database connectors (for event publishing)
  • Query-based audience segments
  • Data enrichment sources

Use Cases

  1. Before Creating a Profile
    # Verify datasource exists before creating profile
       ./CliTool.sh get-all-datasource-names-for-logged-in-user
       # If "CUSTOMER_DB" appears in output, proceed with profile creation
       ./CliTool.sh create-profile -f "profile-with-customer-db.json"
  2. Before Creating a Database Destination
    # Check datasource availability
       ./CliTool.sh get-all-datasource-names-for-logged-in-user
       # Use datasource name in destination connector config
       ./CliTool.sh create-destination -f "destination-with-datasource.json"
  3. Troubleshooting Permission Issues
    # If profile creation fails with datasource error, verify access
       ./CliTool.sh get-all-datasource-names-for-logged-in-user
       # Check if the datasource appears in the list

Permission Model

Datasource visibility is determined by:

  • Platform User Permissions: The platform.userid configured in detect-cli.properties
  • Datasource ACLs: Access Control Lists configured in Platform Security Manager
  • Role Assignments: User roles (Admin, Developer, etc.) in Platform

If a datasource doesn't appear in the output:

  1. Verify the datasource exists in Platform (Settings ' Configuration ' Data Sources)
  2. Check user permissions (Platform Security Manager ' Users ' Select User ' Permissions)
  3. Ensure the user has "Read" permission on the datasource
  4. Try with a Platform admin user to rule out permission issues

Related API Endpoint

  • REST API: GET /api/unicadetect/v1/configuration/datasources
  • Service Interface: ConfigurationService.getDatasourceNamesForLoggedInUser()
  • Return Type: ListOfNamesDto containing List<String> names
  • Authentication: OAuth2 bearer token (automatically handled by CLI)

Exit Codes

  • 0 " Success (datasources retrieved; list may be empty if user has no access)
  • 1 " Error occurred (connection failure, authentication failure, etc.)
Note:
  • Empty list ([]) is a valid response if the user has no datasource permissions
  • Datasource names are case-sensitive when used in other commands
  • Names are returned as configured in Platform (no sorting or filtering applied)
  • This command is read-only and safe to run in production