get-all-destinations

Description

Retrieves a paginated list of all destinations configured in Detect. Supports pagination to handle large numbers of destinations efficiently.

Syntax

Windows:

CliTool.bat get-all-destinations [-page <page-number>] [-size <page-size>]

Linux :

./CliTool.sh get-all-destinations [-page <page-number>] [-size <page-size>]

Parameters

Parameter Required Type Default Description
-page No integer 0 Page number (zero-based). First page is 0.
-size No integer 20 Number of destinations per page. Max recommended: 100.

Example Execution

Retrieve first page (default):

./CliTool.sh get-all-destinations

Retrieve specific page:

./CliTool.sh get-all-destinations -page 2 -size 50

Retrieve all with large page size:

./CliTool.sh get-all-destinations -page 0 -size 100

Sample Output

Success:

Destinations: PageResponse(content=[DestinationDto(id=1, name=Journey Events, ...), DestinationDto(id=2, name=Interact Offers, ...)], page=0, size=20, totalElements=45, totalPages=3)

Empty Result:

Destinations: PageResponse(content=[], page=0, size=20, totalElements=0, totalPages=0)

Error:

Error retrieving destinations: Connection timeout - Detect backend not reachable

Output Format

The output is a PageResponse object containing:

  • content: Array of DestinationDto objects
  • page: Current page number (zero-based)
  • size: Page size (number of items per page)
  • totalElements: Total number of destinations across all pages
  • totalPages: Total number of pages available

Use Cases

  1. List All Destinations
    # Get first page
       ./CliTool.sh get-all-destinations
  2. Export All Destinations
    # Loop through all pages (bash example)
       TOTAL_PAGES=5  # Determine from first call
       for page in $(seq 0 $((TOTAL_PAGES-1))); do
           ./CliTool.sh get-all-destinations -page $page -size 20 >> all-destinations.txt
       done
  3. Check Destination Count
    # Check totalElements from output
       ./CliTool.sh get-all-destinations | grep -oP 'totalElements=\K[0-9]+'

Exit Codes

  • 0 " Success (destinations retrieved, may be empty)
  • 1 " Error (connection failure, invalid parameters)