update-destination

Description

Updates an existing destination's configuration. All fields from the original destination will be replaced with values from the JSON payload. To preserve existing values, include them in your update payload.

Syntax

Windows:


CliTool.bat update-destination -id <destination-id> -f <path-to-json-file>

Linux :


./CliTool.sh update-destination -id <destination-id> -f <path-to-json-file>

Parameters

Parameter Required Type Description
-id Yes integer ID of the destination to update. Must be a positive integer.
-f Yes string Path to JSON file containing the updated destination configuration.

Example Execution

Windows:


CliTool.bat update-destination -id 42 -f "C:\destinations\update-destination.json"

Linux :


./CliTool.sh update-destination -id 42 -f /home/user/destinations/update-destination.json

Sample Output

Success:


Destination updated successfully with ID: 42

Error:


Error updating destination: Destination with ID 42 not found

JSON Payload Example

{
  "name": "Updated Journey Destination",
  "description": "Updated description with new Kafka topic and additional feed mappings",
  "templateId": 1,
  "messageConfig": {
    "payloadEntrySourceCode": "ES-003"
  },
  "feedAttributeMapping": [
    {
      "feedId": 1,
      "attributes": {
        "profile": {
          "customerId": "CUSTOMER_ID",
          "customerName": "CUSTOMER_NAME",
          "email": "EMAIL_ADDRESS",
          "phoneNumber": "PHONE_NUMBER"
        },
        "tuple": {
          "eventId": "EVENT_ID",
          "timestamp": "EVENT_TIMESTAMP",
          "eventType": "EVENT_TYPE",
          "eventValue": "EVENT_VALUE"
        }
      }
    },
    {
      "feedId": "EngagementFeed",
      "attributes": {
        "profile": {
          "customerId": "CUSTOMER_ID"
        },
        "tuple": {
          "engagementId": "ENGAGEMENT_ID",
          "channel": "CHANNEL"
        }
      }
    }
  ],
  "connectorConfig": {
    "kafka": {
      "connectorType": "KAFKA",
      "topic": "updated-journey-topic",
      "clusterName": "primary-kafka-cluster"
    },
    "mariaDb": {
      "connectorType": "MARIADB",
      "datasourceName": "detect_datasource",
      "databaseName": "detect_audit_db"
    }
  }
}

JSON Schema

The update payload has the same structure as the create-destination payload. See [Section 5.1 Complete JSON Schema](#complete-json-schema-table-all-fields) for full field descriptions.

Key Differences from Create:

  • id field: Not included in update payload (specified via -id parameter)
  • Full replacement: All fields must be provided; missing fields will be set to null/default
  • Template change: You can change templateId, but ensure messageConfig matches the new template
  • Audit fields: createdBy, createdDate are preserved; modifiedBy, modifiedDate are updated automatically

Important Notes

  1. Full Update: This is a complete replacement operation. To preserve existing values, retrieve the destination first:
    
       # Get current config
       ./CliTool.sh get-destination-by-id -id 42 > current-destination.json
       
       # Edit current-destination.json with your changes
       
       # Update
       ./CliTool.sh update-destination -id 42 -f current-destination.json
  2. Connector Changes: You can add, remove, or modify connectors
    • Add new connector: Include it in connectorConfig
    • Remove connector: Omit it from connectorConfig
    • At least one connector must remain
  3. Validation: Same validation rules as create-destination apply:
    • Kafka clusters must exist and be reachable
    • Databases must be accessible
    • Attribute mappings must reference valid attributes
  4. In-Use Check: If destination is referenced by active triggers/campaigns, update carefully to avoid runtime errors