IBM Cloud Docs
Activity Tracker Event Routing CLI

Activity Tracker Event Routing CLI

The IBM Cloud® command-line interface (CLI) provides extra capabilities for service offerings. This information describes how you can use the CLI to define and manage settings for your IBM Cloud® Activity Tracker Event Routing instance using the CLI.

This information applies only if you use an IBM Cloud® Activity Tracker Event Routing offering. See the command line references for IBM Cloud® Activity Tracker hosted event search for the CLI for that offering.

Prerequisites

  • Install the IBM Cloud CLI.

  • Install the CLI by running the following command:

    ibmcloud plugin install atracker
    

You're notified on the command line when updates to the IBM Cloud CLI and plug-ins are available. Be sure to keep your CLI up to date so that you can use the latest commands. You can view the current version of all installed plug-ins by running ibmcloud plugin list.

ibmcloud atracker route create

Use this command to create a new route for an Activity Tracker Event Routing target.

ibmcloud atracker route create --name ROUTE_NAME  ( --target-ids TARGETS  [--locations REGIONS] | --rules RULES | --file RULES_DEFINITION_JSON_FILE ) [--output FORMAT]

Command options

--name ROUTE_NAME

The name to be given to the route.

Do not include any personal identifying information (PII) in any resource names.

--file RULES_DEFINITION_JSON_FILE

A JSON file containing the definition of the rules for route. The file needs to be formatted as follows:

[
  {
    "locations": ["LOCATION1","LOCATION2"],
    "target_ids": ["TARGET_ID1","TARGET_ID2"]
  }
]
--rules RULES

A JSON formatted rule definition enclosed in single quotes. For example:

--rules '[{"locations":["global"],"target_ids":["11111111-1111-1111-1111-111111111111"]},{"locations":["us-south","us-east"],"target_ids":["22222222-2222-2222-2222-222222222222","33333333-3333-3333-3333-333333333333"]}]'
--locations LOCATIONS

List of locations associated with the route. Specify global to include global events. To include all locations specify *. If you have multiple rules, along with a rule with a * location, then the other rules will route events to the specified targets with any events not matching any other rule routing the remaining events to the target specified by the rule with the * location.

--target-ids TARGET_ID

A comma-separated list of target IDs.

--output FORMAT

If JSON is specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.

help | --help | -h

List options available for the command.

ibmcloud atracker route update

Use this command to update a route for an Activity Tracker Event Routing target. Any specified value that is different from when the route was originally created will be updated to the value specified in the command.

ibmcloud atracker route update --route ROUTE [--name ROUTE_NAME] [--force] ( [--target-ids TARGETS]  [--locations REGIONS] | [--rules RULES] | [--file RULES_DEFINITION_JSON_FILE] ) [--output FORMAT] [--output FORMAT]

Command options

--route ROUTE

The existing name or ID of the route.

--name ROUTE_NAME

The updated name to be given to the route (optional).

Do not include any personal identifying information (PII) in any resource names.

--file RULES_DEFINITION_JSON_FILE

A JSON file containing the definition of the rules for route. The file needs to be formatted as follows:

[
  {
    "location": ["LOCATIONS"],
    "target_ids": ["TARGET_ID"]
  }
]
--rules RULES

A JSON formatted rule definition enclosed in single quotes. For example:

--rules '[{"locations":["global"],"target_ids":["11111111-1111-1111-1111-111111111111"]},{"locations":["us-south","us-east"],"target_ids":["22222222-2222-2222-2222-222222222222","33333333-3333-3333-3333-333333333333"]}]'
--locations LOCATIONS

List of locations associated with the route. Specify global to include global events. To include all locations specify *. If you have multiple rules, along with a rule with a * location, then the other rules will route events to the specified targets with any events not matching any other rule routing the remaining events to the target specified by the rule with the * location.

--target-ids TARGET_ID

A comma-separated list of target IDs.

--output FORMAT

If JSON is specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.

--force

Will delete the route without providing the user with any additional prompt.

help | --help | -h

List options available for the command.

ibmcloud atracker route rm

Use this command to delete an Activity Tracker Event Routing route.

ibmcloud atracker route rm --route ROUTE [--force]

Command options

--route ROUTE
The name or ID of the route to be deleted.
--force
Will delete the route without providing the user with any additional prompt.
help | --help | -h
List options available for the command.

ibmcloud atracker route get

Use this command to get information about an Activity Tracker Event Routing route.

ibmcloud atracker route get --route ROUTE [--output FORMAT]

Command options

--route <ROUTE_ID>
The name or ID of the route.
--output FORMAT
If JSON is specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.
help | --help | -h
List options available for the command.

ibmcloud atracker route ls

Use this command to list all the configured routes for Activity Tracker Event Routing .

ibmcloud atracker route ls [--output FORMAT]

Command options

--output FORMAT
If JSON is specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.
help | --help | -h
List options available for the command.

ibmcloud atracker target create (COS)

Use this command to create a IBM Cloud Object Storage target to be used to configure a destination for activity events.

 ibmcloud atracker target create --name TARGET_NAME --type TARGET_TYPE ( [--file COS_ENDPOINT_DEFINITION_JSON_FILE] |  ( [--endpoint COS_ENDPOINT] [--bucket COS_BUCKET] [--target-crn COS_TARGET_CRN] ( [--api-key ( COS_API_KEY | @COS_API_KEY_FILE )] |  [--service-to-service-enabled ( TRUE | FALSE )] ) ) ) [--region REGION] [--output FORMAT]

Command options

--region REGION | -r REGION

Name of the region that determines the IBM Cloud Activity Tracker Event Routing API endpoint for the request, for example, us-south or eu-gb. If not specified, the region logged into, or targeted, will be used.

--name TARGET_NAME

The name to be given to the target.

Do not include any personal identifying information (PII) in any resource names.

--type TARGET_TYPE

Set the TARGET_TYPE to cloud_object_storage for a COS target.

--file @COS_ENDPOINT_DEFINITION_JSON_FILE

A file containing an endpoint definition in the following format:

{
  "endpoint": "aaaaa",
  "target_crn": "yyyyy",
  "bucket": "zzzzzz",
  "api_key": "xxxxxx"
}
--endpoint COS_ENDPOINT

The IBM Cloud Object Storage endpoint to be associated with the IBM Cloud Object Storage bucket.

--bucket BUCKET

The name of the IBM Cloud Object Storage bucket to be associated with the target.

--target-crn COS_TARGET_CRN

The CRN of the IBM Cloud Object Storage instance.

--api-key COS_API_KEY | @COS_API_KEY_FILE

Your API key value or a reference to the API Key file used to gain access. For example, ibmcloud login --apikey $KEYFILE

--service-to-service-enabled

Indicates if service-to-service authorization has been enabled for the bucket. Specify TRUE if service-to-service authorization is enabled and FALSE if service-to-service authorization is not enable. By default, service_to_service_enabled is FALSE.

--output FORMAT

Currently supported format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.

help | --help | -h

List options available for the command.

ibmcloud atracker target create (IBM Cloud Activity Tracker hosted event search)

Use this command to create an IBM Cloud Activity Tracker hosted event search offering target to be used to configure a destination for activity events.

ibmcloud atracker target create --name TARGET_NAME --type TARGET_TYPE ( [--file LOGDNA_ENDPOINT_DEFINITION_JSON_FILE] | ( [--target-crn LOGDNA_TARGET_CRN] [--ingestion-key LOGDNA_INGESTION_KEY] ) ) [--region REGION] [--output FORMAT]

Command options

--region REGION | -r REGION

Name of the region that determines the IBM Cloud Activity Tracker Event Routing API endpoint for the request, for example, us-south or eu-gb. If not specified, the region logged into, or targeted, will be used.

--name TARGET_NAME

The name to be given to the target.

Do not include any personal identifying information (PII) in any resource names.

--type TARGET_TYPE

Set the TARGET_TYPE to logdna for an IBM Cloud Activity Tracker hosted event search offering target.

--file @LOGDNA_ENDPOINT_DEFINITION_JSON_FILE

A file containing an endpoint definition in the following format:

{
  "target_crn": "yyyyy",
  "ingestion_key": "xxxxxx"
}
--target-crn LOGDNA_TARGET_CRN

The CRN of the IBM Cloud Activity Tracker hosted event search offering instance.

--ingestion-key LOGDNA_INGESTION_KEY

LOGDNA_INGESTION_KEY is the ingestion key that will be used to gain access to the IBM Cloud Activity Tracker instance.

--output FORMAT

Currently support format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.

help | --help | -h

List options available for the command.

ibmcloud atracker target create (Event Streams)

Use this command to create a IBM® Event Streams for IBM Cloud® target to be used to configure a destination for activity events.

 ibmcloud atracker target create --name TARGET_NAME --type TARGET_TYPE ( [--file EVENTSTREAMS_ENDPOINT_DEFINITION_JSON_FILE] | ( [--target-crn EVENTSTREAMS_TARGET_CRN] [--brokers BROKER_LIST] [--topic TOPIC] [--api-key ( EVENTSTREAMS_API_KEY | @EVENTSTREAMS_API_KEY_FILE )] ) ) [--region REGION] [--output FORMAT]

Command options

--region REGION | -r REGION

Name of the region that determines the IBM Cloud Activity Tracker Event Routing API endpoint for the request, for example, us-south or eu-gb. If not specified, the region logged into, or targeted, will be used.

--name TARGET_NAME

The name to be given to the target.

Do not include any personal identifying information (PII) in any resource names.

--type TARGET_TYPE

Set the TARGET_TYPE to event_streams for an Event Streams target.

--file @EVENTSTREAMS_ENDPOINT_DEFINITION_JSON_FILE

A file containing an endpoint definition in the following format:

{
  "target_crn": "yyyyy",
  "brokers": ["broker-1:9093","broker-2:9093"],
  "topic": "my-topic",
  "api_key": "xxxxxxxxxxxxxx"
}
--target-crn EVENTSTREAMS_TARGET_CRN[

The CRN of the IBM® Event Streams for IBM Cloud® instance. You can get the source crn from the service credentials.

--brokers BROKER_LIST

The list of Event Streams brokers (endpoints). This is the value of the kafka_brokers_sasl in the service credentials.

--topic TOPIC

Event Streams topic name to where the events are sent. This is the name of the topic created for an Event Streams instance.

--api-key EVENTSTREAMS_API_KEY | @EVENTSTREAMS_API_KEY_FILE

The password value found in the Event Streams service credential. This is the IAM API key.

--output FORMAT

Currently supported format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.

help | --help | -h

List options available for the command.## ibmcloud atracker target create (COS).

Use this command to create a IBM® Event Streams for IBM Cloud® target to be used to configure a destination for activity events.

 ibmcloud atracker target create --name new-target-name --type event-streams --target-crn "crn:v1:bluemix:public:messagehub:eu-de:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::" --brokers "broker-1:9093,broker-2:9093" --topic "topic-name" --api-key xxxxx

ibmcloud atracker target create (IBM Cloud Logs)

Use this command to create a IBM® Event Streams for IBM Cloud® target to be used to configure a destination for activity events.

 ibmcloud atracker target create --name TARGET_NAME --type TARGET_TYPE ( [--file CLOUD_LOGS_ENDPOINT_DEFINITION_JSON_FILE] | ( [--target-crn CLOUD_LOGS_TARGET_CRN] ) ) [--region REGION] [--output FORMAT]

Command options

--region REGION | -r REGION

Name of the region that determines the IBM Cloud Activity Tracker Event Routing API endpoint for the request, for example, us-south or eu-gb. If not specified, the region logged into, or targeted, will be used.

--name TARGET_NAME

The name to be given to the target.

Do not include any personal identifying information (PII) in any resource names.

--type TARGET_TYPE

Set the TARGET_TYPE to cloud_logs for an IBM Cloud Logs target.

--file @CLOUD_LOGS_ENDPOINT_DEFINITION_JSON_FILE

A file containing an endpoint definition in the following format:

{
  "target_crn": "yyyyy"
}
--target-crn CLOUD_LOGS_TARGET_CRN

The CRN of the IBM Cloud Logs instance.

--output FORMAT

Currently supported format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.

help | --help | -h

List options available for the command.## ibmcloud atracker target create.

Use this command to create a IBM Cloud Logs target to be used to configure a destination for activity events.

 ibmcloud atracker target create --name new-target-name --type cloud-logs --target-crn "crn:v1:bluemix:public:logs:eu-de:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"

ibmcloud atracker target update (COS)

Use this command to update a COS target for an IBM Cloud Activity Tracker Event Routing region. Any specified value that is different from when the target was originally created will be updated to the value specified in the command.

ibmcloud atracker target update --target TARGET [--name TARGET_NAME] [ [--file COS_ENDPOINT_DEFINITION_JSON_FILE] |  ( [--endpoint COS_ENDPOINT] [--bucket COS_BUCKET] [--target-crn COS_TARGET_CRN] ( [--api-key ( COS_API_KEY | @COS_API_KEY_FILE )] | [--service-to-service-enabled ( TRUE | FALSE )]))] [--output FORMAT]

Command options

--target TARGET

The ID or current target name.

--name TARGET_NAME

The name to be given to the target.

Do not include any personal identifying information (PII) in any resource names.

--file @COS_ENDPOINT_DEFINITION_JSON_FILE

A file containing an endpoint definition in the following format:

{
  "endpoint": "aaaaa",
  "target_crn": "yyyyy",
  "bucket": "zzzzzz",
  "api_key": "xxxxxx"
}

or for a scenario where service-to-service authentication is enabled:

{
  "endpoint": "aaaaa",
  "target_crn": "yyyyy",
  "bucket": "zzzzzz",
  "service_to_service_enabled": true
}
--endpoint COS_ENDPOINT

The IBM Cloud Object Storage endpoint to be associated with the IBM Cloud Object Storage bucket.

--bucket COS_BUCKET

The name of the IBM Cloud Object Storage bucket to be associated with the target.

--target-crn COS_TARGET_CRN

The CRN of the IBM Cloud Object Storage instance.

--api-key COS_API_KEY | @COS_API_KEY_FILE

Your API key value or a reference to the API Key file used to gain access. For example, ibmcloud login --apikey $KEYFILE

--service-to-service-enabled (TRUE | FALSE)

Indicates if service-to-service authorization has been enabled for the bucket. Specify TRUE if service-to-service authorization is enabled and FALSE if service-to-service authorization is not enable. By default, service-to-service authorization is FALSE.

--output FORMAT

Currently supported format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.

help | --help | -h

List options available for the command.

ibmcloud atracker target update (IBM Cloud Activity Tracker hosted event search)

Use this command to update an IBM Cloud Activity Tracker hosted event search offering target to be used to configure a destination for activity events.

ibmcloud atracker target update --target TARGET [--name TARGET_NAME] ( --file @LOGDNA_ENDPOINT_DEFINITION_JSON_FILE ) | (--target-crn LOGDNA_TARGET_CRN --ingestion-key LOGDNA_INGESTION_KEY )  [--output FORMAT]

Command options

--target TARGET

The ID or current target name.

--name TARGET_NAME

The name to be given to the target.

Do not include any personal identifying information (PII) in any resource names.

--file @LOGDNA_ENDPOINT_DEFINITION_JSON_FILE

A file containing an endpoint definition in the following format:

{
  "target_crn": "yyyyy",
  "ingestion_key": "xxxxxx"
}
--target-crn LOGDNA_TARGET_CRN

The CRN of the IBM Cloud Activity Tracker hosted event search offering instance.

--ingestion-key LOGDNA_INGESTION_KEY

LOGDNA_INGESTION_KEY is the ingestion key for the IBM Cloud Activity Tracker instance.

--output FORMAT

Currently support format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.

help | --help | -h

List options available for the command.

ibmcloud atracker target update (Event Streams)

Use this command to update an Event Streams target for an IBM Cloud Activity Tracker Event Routing region. Any specified value that is different from when the target was originally created will be updated to the value specified in the command.

ibmcloud atracker target update --target TARGET [--name TARGET_NAME] [ [--file EVENTSTREAMS_ENDPOINT_DEFINITION_JSON_FILE] | ( [--brokers BROKER_LIST] [--target-crn EVENTSTREAMS_TARGET_CRN] [--topic TOPIC]( [--api-key ( EVENTSTREAMS_API_KEY | @EVENTSTREAMS_API_KEY_FILE )]))] [--output FORMAT]

Command options

--name TARGET_NAME

The name to be given to the target.

Do not include any personal identifying information (PII) in any resource names.

--type TARGET_TYPE

Set the TARGET_TYPE to cloud_object_storage for a COS target.

--file @EVENTSTREAMS_ENDPOINT_DEFINITION_JSON_FILE

A file containing an endpoint definition in the following format:

{
  "target_crn": "yyyyy",
  "brokers": ["broker-1:9093","broker-2:9093"],
  "topic": "my-topic",
  "api_key": "xxxxxxxxxxxxxx"
}
--target-crn EVENTSTREAMS_TARGET_CRN[

The CRN of the IBM® Event Streams for IBM Cloud® instance. You can get the source crn from the service credentials.

--brokers BROKER_LIST

The list of Event Streams brokers (endpoints). This is the value of the kafka_brokers_sasl in the service credentials.

--topic TOPIC

Event Streams topic name to where the events are sent. This is the name of the topic created for an Event Streams instance.

--api-key EVENTSTREAMS_API_KEY | @EVENTSTREAMS_API_KEY_FILE

The password value found in the Event Streams service credential. This is the IAM API key.

--output FORMAT

Currently supported format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.

help | --help | -h

List options available for the command.

ibmcloud atracker target update (IBM Cloud Logs)

Use this command to update an IBM Cloud Logs target to be used to configure a destination for activity events.

ibmcloud atracker target update --target TARGET [--name TARGET_NAME] ( --file @CLOUD_LOGS_ENDPOINT_DEFINITION_JSON_FILE ) | (--target-crn CLOUD_LOGS_TARGET_CRN) [--output FORMAT]

Command options

--target TARGET

The ID or current target name.

--name TARGET_NAME

The name to be given to the target.

Do not include any personal identifying information (PII) in any resource names.

--file @CLOUD_LOGS_ENDPOINT_DEFINITION_JSON_FILE

A file containing an endpoint definition in the following format:

{
  "target_crn": "yyyyy",
}
--target-crn CLOUD_LOGS_TARGET_CRN

The CRN of the IBM Cloud Logs instance.

--output FORMAT

Currently support format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.

help | --help | -h

List options available for the command.

ibmcloud atracker target rm

Use this command to delete a target.

ibmcloud atracker target rm --target TARGET [--force]

Command options

--target TARGET
The ID or name of the target.
--force | -f
Will delete the target without providing the user with any additional prompt.
help | --help | -h
List options available for the command.

ibmcloud atracker target validate

Use this command to validate that a target is correctly configured for an IBM Cloud Activity Tracker Event Routing region.

ibmcloud atracker target validate --target TARGET [--region REGION] [--output FORMAT]

Command options

--target TARGET
The ID or name of the target.
--region REGION | -r REGION
Name of the region that determines the IBM Cloud Activity Tracker Event Routing API endpoint for the request, for example, us-south or eu-gb. If not specified, the region logged into, or targeted, will be used.
--output FORMAT
Currently supported format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.
help | --help | -h
List options available for the command.

ibmcloud atracker target get

Use this command to get information about a target for an IBM Cloud Activity Tracker Event Routing region.

ibmcloud atracker target get --target TARGET [--output FORMAT]

Command options

--target TARGET
The ID or name of the target.
--output FORMAT
Currently supported format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.
help | --help | -h
List options available for the command.

ibmcloud atracker target ls

Use this command to list the configured targets for an IBM Cloud Activity Tracker Event Routing region.

ibmcloud atracker target ls [--output FORMAT]

Command options

--output FORMAT
Currently supported format is JSON. If specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.
help | --help | -h
List options available for the command.

ibmcloud atracker setting get

Use this command to get the settings for the IBM Cloud Activity Tracker Event Routing account configurations.

ibmcloud atracker setting get [--output FORMAT]

Command options

--output FORMAT
If JSON is specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.
help | --help | -h
List options available for the command.

ibmcloud atracker setting update

Use this command to modify current settings such as the default targets, permitted target regions, primary and secondary metadata regions in IBM Cloud Activity Tracker Event Routing. Any value that is different from when the target was originally created will be updated to the value specified in the command.

Before disabling a public endpoint (--private-api-endpoint-only TRUE), make sure your account has access to the private endpoint. You can do this by running the command bx account show. If VRF Enabled is true and Service Endpoint Enabled is true then you have access to the private endpoint. If you do not have access to the private endpoint, you will be unable to re-enable the public endpoint since private endpoint access is required to re-enable the public endpoint.

ibmcloud atracker setting update [--metadata-region-primary REGION] [--metadata-region-backup REGION] [--default-targets TARGET] [--permitted-target-regions REGIONS] [--private-api-endpoint-only ( TRUE | FALSE )] [--output FORMAT] [--force]

Command options

default-targets
Is a list of target IDs. If no routing rules cause events to be sent to other targets, these targets will received the events. TARGETS is a comma-separated list of target IDs.
permitted-target-regions
Is the list of regions that can be used to define a target. REGIONS is a comma-separated list of regions. A maximum of two permitted target regions can be specified.
metadata-region-primary
Specify the REGION where the metadata associated with route and target definitions is stored.
metadata_region_backup
Is the region where the metadata associated with route and target definitions is stored as a backup location.
private-api-endpoint-only
Specifies whether nor not a private endpoint can be used. If true only a private endpoint can be used.
--output FORMAT
If JSON specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.
help | --help | -h
List options available for the command.