vania-janet/multiturn-rag-retrieval-data huggingface dataset:
* In the Create a project window, enter a project name, and accept the terms and enable or disable Google analytics (optional) by selecting the toggle switch and click Continue.
* If Google analytics is enabled, then in the Configure Google Analytics window, choose the Analytics location, and accept the terms.
* Click Create Project.
* Click Continue when the new project is ready.
* In the navigation panel, select the settings icon next to the Project Overview and select Settings > Project settings.
* Click the Cloud Messaging tab to view your project credentials: Server Key.



Zoom

![FCM credentials](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-fcm-credentials.png)

Figure 2. FCM credentials





 Step 3: Add a generic API source 

Take the following steps:



* Go to the Sources section of the Event Notifications dashboard.
* Click Add and select an API Source.
* Type a name and an optional description and click Add.







 Step 4: Create an Event Notifications destination 

Click Destinations in the Event Notifications console and add the following destination details:



* Name: add a name for the Destination.
* Description: add an optional description for the destination.
* Type: select Chrome Push Notifications type from the dropdown list.
* Select a destination plan: Pre-production destination or Production destination.



* Pre-production destination - select this destination as low-cost push destination, for your development and test environments.
* Production destination - use the full capability of this destination. Unlimited devices and outbound messages allowed.



* Add your website URL to get it allow listed.
* Add the Server Key, which you got from Get FCM credentials section.
* Click Add.
* When Chrome destination is created, edit the created destination to get public vapId key required for web sdk.



Zoom

!
* In Certificate Information, enter the email address that is associated with your App Developer account and a common name. Give a meaningful name that helps you identify whether it is a certificate for development (sandbox) or distribution (production); for example, sandbox-apns-certificate or production-apns-certificate.
* Select Saved to disk to download the .certSigningRequest file to your Mac, then click Continue.

Zoom

![Certificate details](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-apns-p12-certificate-details.png)

Figure 15. Certificate details
* In the Save As menu option, name the .certSigningRequest file, select the location where the file must be saved, and click Save.

Zoom

![Save CSR file](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-apns-p12-save-csr.png)

Figure 16. Save CSR file
* Click Done. You now have a CSR.

Zoom

![CSR created](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-apns-p12-csr-created.png)

Figure 17. CSR created
* Go back to the Apple developer portal, for the Upload CSR file option, click Choose File, and select file CertificateSigningRequest.certSigningRequest. Click Continue.

Zoom

!
Use the output of the ibmcloud ce app get command to find the public URL of your app. Be sure to wrap the value to curl in quotation marks to ensure that it is treated as a single string.

curl "<public_URL_of_Kafka_sender_app>?topic=<your_topic_name>&num=<number_of_messages_to_produce>"

For example,

curl "https://kafka-sender-app.abcdabcdabc.us-south.codeengine.appdomain.cloud?topic=kafka-topic1&num=1"
3. View events in logs. When your Kafka event subscription is created with a broker, topics and an access secret that are valid, and you have a Kafka application that produces messages on that topic (such as kafka-sender-app), then you can see events in logs for your destination Code Engine application that receives Kafka messages, such as kafka-receiver-app. When you use the Kafka receiver app (icr.io/codeengine/kafka-receiver), search for Event data in the logs for the receiver application to see the messages that are received.

ibmcloud ce app logs -n kafka-receiver-app2

Example output

Getting logs for all instances of application 'kafka-receiver-app2'...
OK

kafka-receiver-app2-00001-deployment-66976f7988-9xttm/user-container:
2022/03/31 22:19:45 Listening on port 8080
2022/03/31 22:19:46 ----------
2022/03/31 22:19:46 Path: /
2022/03/31 22:19:46 Header: Accept-Encoding=[gzip]
2022/03/31 22:19:46 Header: Ce-Id=[partition:0/offset:167]
You can use the following cURL command to validate a target by checking the credentials to write to the bucket.

curl -X POST <ENDPOINT>/api/v1/targets/<target_ID>/validate -H "Authorization: $ACCESS_TOKEN" -H "content-type: application/json"

Where



* ENDPOINT is the API endpoint in the region where you plan to configure or manage a target. For more information, see [Endpoints](https://cloud.ibm.com/docs/atracker?topic=atracker-endpointsendpoints_api).
* <target_ID> is the ID of the target.



For example, you can use the following cURL request to validate a target in US-South:

curl -X POST https://private.us-south.atracker.cloud.ibm.com/api/v1/targets/<TARGETID>/validate -H "Authorization: $ACCESS_TOKEN" -H "content-type: application/json"

In the response, you get information in the section cos_write_status, for example:

"cos_write_status": {
"status": "success"
},





 Viewing a target using the API 

You can use the following cURL command to view the configuration details of 1 target:

curl -X GET <ENDPOINT>/api/v1/targets/<target_ID> -H "Authorization: $ACCESS_TOKEN" -H "content-type: application/json"

Where



* ENDPOINT is the API endpoint in the region where you plan to configure or manage a target. For more information, see [Endpoints](https://cloud.ibm.com/docs/atracker?topic=atracker-endpointsendpoints_api).
* <target_ID> is the ID of the target.



For example, you can run the following cURL request to get informatiomn about a target with ID 7faa6ea6-e564-4fef-93b0-4317a0d27c34:
Start logging for the receiver application to [view application logs from the console](https://cloud.ibm.com/docs/codeengine?topic=codeengine-view-logsview-applogs-ui) to see events.
2. (optional) Start logging for the sender application to [view application logs from the console](https://cloud.ibm.com/docs/codeengine?topic=codeengine-view-logsview-applogs-ui) to see information about events that are sent.
3. After logging is started, call the kafka-sender-app application with curl and specify the public URL of the kafka-sender-app, the name of your topic, and the number of messages to send. You can obtain the public URL of this application from the Domain mapping tab for your application. For example,

curl "<public_URL_of_Kafka_sender_app>?topic=<your_topic_name>&num=<number_of_messages_to_produce>"



Be sure to wrap the value to curl in quotation marks to ensure that it is treated as a single string.







 Subscribing to Kafka events for an app with the CLI 

You can use the CLI to set up a Kafka event subscription so that events are sent to a Code Engine application.

Events are sent to applications as HTTP POST requests. For more information about the information that is included with Kafka events, see [HTTP headers and body information for events](https://cloud.ibm.com/docs/codeengine?topic=codeengine-working-kafkaevent-producersubkafka-headerbody-app). If your event is sent to a Code Engine job, the job receives events as environment variables. For more information about the environment variables for Kafka subscriptions, see [Environment variables for events](https://cloud.ibm.com/docs/codeengine?topic=codeengine-working-kafkaevent-producersubkafka-envvar-job).



 Creating a Code Engine app to receive Kafka events with the CLI
Using cURL 

You can use cURL, a command line tool, from a terminal to manage the IBM Cloud Monitoring service by using URL syntax.



 cURL syntax 

Use the following syntax from a terminal to run a cURL command:

curl -X <METHOD> <MONITORING_ENDPOINT>/<API_URL> <-H HEADERS,> [-d DATA]

Where



* <METHOD> indicates the type of REST API call that you want to make.
* <MONITORING-ENDPOINT> indicates the endpoint where the monitoring instance is available. For more inforamtion, see [Monitoring endpoints](https://cloud.ibm.com/docs/monitoring?topic=monitoring-endpointsendpoints_sysdig). For example, the endpoint for an instance that is available in us-south is the following: https://us-south.monitoring.cloud.ibm.com
* <API_URL> For more information about API URLs, see [Monitoring REST APIs](https://cloud.ibm.com/docs/monitoring?topic=monitoring-rest_apis).
* HEADERS add additional information such as information to authenticate with the IBM Cloud Monitoring service.
* DATA allows you to pass additional information that might be required.







 Running a cURL API query 

To run a cURL API query and authrnticat by using the IAM token, complete the following steps:



1. Set the IAM token.

AUTH_TOKEN=$(ibmcloud iam oauth-tokens | awk '{print $4}')
2. Set the IBM Cloud Monitoring instance GUID.

GUID=$(ibmcloud resource service-instance <NAME> --output json | jq -r '.[].guid')
3. Run the cURL API query.

curl -X <METHOD> <MONITORING_ENDPOINT>/<API_URL> -H "Authorization: $AUTH_TOKEN" -H "IBMInstanceID: $GUID" -H "content-type: application/json"
[Image showing "applicationApiKey.json download](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_app_ams_app_apikey.png)





 Send and Receive Message before configuring AMS 

As a first step of the AMS configuration, we can check if alice and bob are able to send and receive messages. This would help us to make sure that the client and the queue manager are able to communicate and exchange messages. In further sections of this tutorial, AMS setup and configuration is explained. At this point, we send and receive a message in plain-text on the target queue using alice as sender and bob as receiver.



1. Open two command shells. One for the user alice and another for the user bob:



1. We shall use one command shell for alice and carry out all the steps for alice on it. From now on, this command shell will be called as alice's command shell.
2. We shall use another command shell for bob and carry out all the steps for bob on it. From now on, this command shell will be called as bob's command shell.
3. alice and bob command shells will be required throughout this tutorial. Hence, please do not close them until you complete all the steps in this tutorial.



2. Create the following environment variables in alice's command shell.



* On Linux/Mac:

export MQSAMP_USER_ID=alice
export MQSERVER="CLOUD.ADMIN.SVRCONN/TCP/<HOSTNAME>(<PORT>)"
* On Windows:

set MQSAMP_USER_ID=alice
set MQSERVER=CLOUD.ADMIN.SVRCONN/TCP/<HOSTNAME>(<PORT>)
* <HOSTNAME> - this is 'hostname' in the file connection_info.txt(refer to Appendix#1)
export ACCESS_TOKEN=ibmcloud iam oauth-tokens | grep IAM | cut -d : -f 2 | sed 's/^ //'

The access token is only valid for 1 hour.
2. [Create a target](https://cloud.ibm.com/docs/atracker?topic=atracker-targettarget-create). Run the following cURL command:

curl -X POST <ENDPOINT>/api/v1/targets -H "Authorization: $ACCESS_TOKEN" -H "content-type: application/json" -d '{
"name": "TARGET_NAME",
"target_type": "TARGET_TYPE",
"logdna_endpoint": {
"target_crn": "INSTANCE_CRN",
"ingestion_key": "API_KEY"
}
}'

Where



* TARGET_NAME is the name of the target. The maximum length of the name is 256 characters.
* TARGET_TYPE is the type of the target. Set this field to logdna.







Table 2. Target endpoint fields

 Field Description 

 target_crn Indicates the [CRN](https://cloud.ibm.com/docs/account?topic=account-crn) of the Activity Tracker Event Routing instance. 
 ingestion_key Contains the API key that has permissions to send events to an Activity Tracker Event Routing instance. 



For example, to create a target in the US-South region, you can run the following cURL command:

curl -X POST https://private.us-south.atracker.cloud.ibm.com/api/v1/targets -H "Authorization: $ACCESS_TOKEN" -H "content-type: application/json" -d '{
"name": "My target",
"target_type": "logdna",
"logdna_endpoint": {
As part of this demonstration, we run the sender program (amqsputc) using alice's userid to send a message to the protected queue. We then run the receiver program (amqsgetc) using bob's userid to receive the message.



1. Create the following environment variables in alice's command shell.

On Mac:
export MQSAMP_USER_ID=alice
export MQSERVER="CLOUD.ADMIN.SVRCONN/TCP/<HOSTNAME>(<PORT>)"
export MQS_KEYSTORE_CONF="/alice/.mqs/keystore.conf"

On Linux:
export MQSAMP_USER_ID=alice
export MQSERVER="CLOUD.ADMIN.SVRCONN/TCP/<HOSTNAME>(<PORT>)"
export MQS_KEYSTORE_CONF="/home/alice/.mqs/keystore.conf"

On Windows:
set MQSAMP_USER_ID=alice
set MQSERVER=CLOUD.ADMIN.SVRCONN/TCP/<HOSTNAME>(<PORT>)
set MQS_KEYSTORE_CONF=C:Usersalice.mqskeystore.conf



* <HOSTNAME> - this is 'hostname' in the file connection_info.txt
* <PORT> - this is 'listenerPort' in the file connection_info.txt



2. Create the following environment variables in bob's command shell.

On Mac:
export MQSAMP_USER_ID=bob
export MQSERVER="CLOUD.ADMIN.SVRCONN/TCP/<HOSTNAME>(<PORT>)"
export MQS_KEYSTORE_CONF="/bob/.mqs/keystore.conf"

On Linux:
export MQSAMP_USER_ID=bob
export MQSERVER="CLOUD.ADMIN.SVRCONN/TCP/<HOSTNAME>(<PORT>)"
[Install IBM Cloud Activity Tracker Event Routing CLI V2](https://cloud.ibm.com/docs/atracker?topic=atracker-atracker-cli-configatracker-cli-config-install).
2. Check the version of the plugin is set to a V2 version such as 0.2.x.

ibmcloud plugin show --repo atracker
3. Run the following command to set the CLI to use the API V1:

ibmcloud atracker init version

The plugin is set to V1.







 Scenario 2: After you migrate the Activity Tracker Event Routing configuration 

When you migrate your account's Activity Tracker Event Routing configuration from V1 to V2, complete the following steps to set the CLI version to V2:



1. Check the version of the plugin is set to a V2 version such as 0.2.x.

ibmcloud plugin show --repo atracker
2. Run the following command to set the CLI to use the API V2:

ibmcloud atracker init version

The plugin is set to V2.
(Optional) Check and confirm whether the client CA certificate is uploaded to the server with the following command:

ibmcloud hpcs-cert-mgr cert list --crn HPCS_CRN [--private]

This command lists all the available client CA certificates that are managed by you on the server. If the list contains the certificate that is previously uploaded, it means that the action is successfully completed.







 Step 3: Establish mutual TLS connections for EP11 applications 

After you set up the administrator signature key and the client CA certificate, EP11 users can establish mutual TLS connections for applications that use the GREP11 or PKCS #11 API. Before EP11 users can do this, they need to configure the GREP11 or PKCS #11 applications with the client certificate.

To use the GREP11 or PKCS #11 API, make sure that EP11 users are assigned the proper IAM roles to perform EP11 operations. For more information, see the HSM APIs tab in [IAM service access roles](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-manage-accessservice-access-roles).



* Configure GREP11 applications

Depending on the programming language that you use for the GREP11 application, the configuration method varies based on the corresponding gRPC package. The following provides examples for Golang and JavaScript.



* Golang example code snippet

cert, _ := tls.LoadX509KeyPair("client.pem", "client-key.pem")
var callOpts = []grpc.DialOption{
grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{Certificates: []tls.Certificate{cert}}))
}

The tls.Config{} needs to be properly defined based on the [Config type struct](https://pkg.go.dev/crypto/tlsConfig). You need to set at least the Certificates field. Make sure to use your client key and client certificate.
[Configure a notification channel of type IBM Cloud Event Notifications](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-create-en-source).

When you configure the channel, a source, with the same name as your Monitoring instance instance name, is automatically added to your IBM Cloud Event Notifications instance. You can view it in the IBM Cloud Event Notifications UI, in the Sources section.
2. Create an [IBM Cloud Event Notifications topic](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-create-en-topic).
3. Create an [IBM Cloud Event Notifications destination](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-create-en-destination).
4. Create an [IBM Cloud Event Notifications subscription](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-create-en-subscription).

For Destination specify, IBM Cloud SMS service.







 Next steps 

Next, verify the setup. [Configure a Monitoring alert to send to the configured notification channel](https://cloud.ibm.com/docs/monitoring?topic=monitoring-alerts).
[Set up environments, feature flags, and properties](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-ff-prop-env)
4. [Integrate App Configuration service SDKs](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-integrate-sdks)
5. [Create segments](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-segmentsac-create-segment)
6. [Target feature flags to segments](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-feature-flagstargeting-segment-with-feature-flag) or [Target properties to segments](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-propertiestargeting-segment-with-properties)
7. [Target collections to feature flags](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-feature-flagscollection-target-feature-flags) or [Target collections to properties](https://cloud.ibm.com/docs//app-configuration?topic=app-configuration-ac-propertiescollection-target-properties)
8. [Enable feature flag](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-feature-flagsenabling-feature-flag) (ON/OFF).
See [Installing the Activity Tracker Event Routing CLI](https://cloud.ibm.com/docs/atracker?topic=atracker-atracker-cli-mng&interface=cliatracker-cli-mng-install).
2. Log in to the IBM Cloud. Run the following command: [ibmcloud login](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cliibmcloud_login)
3. Make sure that your account is configured to use the V1 APIs.

Initialize the Activity Tracker Event Routing CLI plugin to use the API version that was used to create the configuration resources in your account. Run the following command:

ibmcloud atracker init version

If the command indicates your system is running version 2, no migration is required.







 Step 2. Check the resources that must be migrated using the API 

Check the resources that must be migrated. Run the following command:

curl -X GET
https://<ENDPOINT>/api/v2/migration
-H "Authorization: Bearer <IAM_TOKEN>"
-H 'accept: application/json'

Where <ENDPOINT> is the API endpoint in the region where you want to run the migration. For more information, see [Endpoints](https://cloud.ibm.com/docs/atracker?topic=atracker-endpointsendpoints_api).

You will get a list of all the resources per region that must be migrated.





 Step 3. Configure the V2 account settings using the API 

Complete the following steps:



1. Check the account settings. Run the following command:

curl -X GET <ENDPOINT>/api/v2/settings -H "Authorization: $ACCESS_TOKEN"

Where:

<ENDPOINT>
: Is the API endpoint in the region where you plan to configure or manage a target.
repo_url = "https://github.com/my-org/my-repo.git"
type = "link"
auth_type = "pat"
api_token = "<TOKEN>"
}
parameters {
has_issues = true
}
}

Where <TOKEN> represents a Personal Access Token (PAT) that belongs to the GitHub account that grants access to the target repo.
3. Initialize the Terraform CLI.

terraform init
4. Create a Terraform execution plan. This plan summarizes all of the actions that must run to add the DevOps Insights tool integration to the toolchain.

terraform plan
5. Apply the Terraform execution plan. Terraform takes all of the required actions to add the DevOps Insights tool integration to the toolchain.

terraform apply



For more information about each of the Git tool integration resources, including additional parameters that you can configure, see the argument reference details in the Terraform Registry documentation:



* Bitbucket: [ibm_cd_toolchain_tool_bitbucketgit](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cd_toolchain_tool_bitbucketgit)
* GitHub: [ibm_cd_toolchain_tool_githubconsolidated](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cd_toolchain_tool_githubconsolidated)
* Git Repos and Issue Tracking: [ibm_cd_toolchain_tool_hostedgit](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cd_toolchain_tool_hostedgit)
* GitLab: [ibm_cd_toolchain_tool_gitlab](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cd_toolchain_tool_gitlab)
You can programmatically publish your product to the IBM Cloud catalog by calling the [Partner Center Sell API](https://cloud.ibm.com/apidocs/partner-center-sellpublish-product) as shown in the following sample request:

curl --request POST --url https://product-
lifecycle.api.cloud.ibm.com/openapi/v1/products/9fab83da-98cb-4f18-
a7ba-b6f0435c9673/publish --header 'Authorization: Bearer TOKEN'





 Publishing to specific accounts or enterprises by using the API 

You can publish your product to specific accounts or enterprises only through the UI. To view the steps, go to publishing to specific accounts or enterprises by using the console.
[Step 4: Migrate the Activity Tracker resources](https://cloud.ibm.com/docs-content/v1/content/bcd8b79ca2ed73bfcaefb20051f12cb6400286ab/atracker//images/mig_s4.svg)](https://cloud.ibm.com/docs/atracker?topic=atracker-migration&interface=apimigration-step4-api) 
 [![Step 5: Initialize the CLI in your local system to use the Activity Tracker Event](https://cloud.ibm.com/docs-content/v1/content/bcd8b79ca2ed73bfcaefb20051f12cb6400286ab/atracker//images/mig_s5.svg)](https://cloud.ibm.com/docs/atracker?topic=atracker-migration&interface=climigration-step5) [![Step 5: Initialize the CLI in your local system to use the Activity Tracker Event](https://cloud.ibm.com/docs-content/v1/content/bcd8b79ca2ed73bfcaefb20051f12cb6400286ab/atracker//images/mig_s5.svg)](https://cloud.ibm.com/docs/atracker?topic=atracker-migration&interface=apimigration-step5-api) 







 Step 1. Configure the CLI V2 in your local system 

Complete the following prerequisites to configure and initialize the Activity Tracker Event Routing CLI in your local system:



1. Install the latest Activity Tracker Event Routing CLI V2 plugin in your local system. See [Installing the Activity Tracker Event Routing CLI](https://cloud.ibm.com/docs/atracker?topic=atracker-atracker-cli-mng&interface=cliatracker-cli-mng-install).
2. Log in to the IBM Cloud.
"type": "timeslice",
"field": "date",
"results":
{
"key": 1577836800000,
"key_as_string": "2020-01-01T00:00:00.000Z",
"matching_results": 4,
"trend_indicator": 0.0,
"total_matching_documents": 7,
"estimated_matching_results": 0.0
},
{
"key": 1588291200000,
"key_as_string": "2020-05-01T00:00:00.000Z",
"matching_results": 10,
"trend_indicator": 2.016106745,
"total_matching_documents": 12,
"estimated_matching_results": 5.340760209
},
{
"key": 1590969600000,
"key_as_string": "2020-06-01T00:00:00.000Z",
"matching_results": 5,
"trend_indicator": -0.763212711,
"total_matching_documents": 11,
"estimated_matching_results": 7.022515985
}
]
}
]
},
{
"key": "chocolate",
"matching_results": 10,
"aggregations": ...]
},
{
"key": "mint",
"matching_results": 25,
"aggregations": ...] ! ! ! ! ! ! ! ! ! !
...
}
Show more