Command examples

The examples below assume you are running from tools/detect-cli so the relative JSON paths work as written.

Create feed application

Command:

java -jar detect-cli.jar create-feed-application -f "<path-to-resource-folder>/create_feed_application_kafka.json"

Sample payload from create_feed_application_kafka.json:

{
  "name": "feedAP1",
  "batchSize": 10,
  "connectorProperties": {
    "connectorType": "KAFKA",
    "topic": "TEST_1",
    "groupId": "detect",
    "clusterName": "k8s-cluster"
  },
  "enabled": true
}

Expected console pattern:

Feed application created successfully with ID: <generatedId>

Update feed application

Command:

java -jar detect-cli.jar update-feed-application -id 101 -f "<path-to-resource-folder>/update_feed_application_kafka.json"

Sample payload from update_feed_application_kafka.json:

{
  "name": "feedAP1",
  "batchSize": 10,
  "connectorProperties": {
    "connectorType": "KAFKA",
    "topic": "TEST_1",
    "groupId": "detect",
    "clusterName": "k8s-cluster"
  },
  "enabled": true
}

Expected console pattern:

Feed application updated successfully with ID: 101

Get feed application by id

Command:

java -jar detect-cli.jar get-feed-application -id 101

Expected console pattern:

Feed Application: <FeedApplicationDto>

Get all feed applications

Basic example:

java -jar detect-cli.jar get-all-feed-applications -page 0 -size 10

Filter by search text:

java -jar detect-cli.jar get-all-feed-applications -search "feedAP" -page 0 -size 10

Filter by Kafka connector type and enabled status:

java -jar detect-cli.jar get-all-feed-applications -byInputConnectorType KAFKA -isEnabled true -page 0 -size 10

Expected console pattern:

Feed Applications: <PageResponse<FeedApplicationDto>>

Delete feed application

Command:

java -jar detect-cli.jar delete-feed-application -id 101

Expected console pattern:

Delete result: <ResponseBooleanWithMessageDto>

Get feed application names

Command:

java -jar detect-cli.jar get-feed-application-names

Expected console pattern:

Feed Application Names: <ListOfNamesDto>