vania-janet/multiturn-rag-retrieval-data huggingface dataset:
By default, events are routed to the root URL of the destination application. You can send events to a different destination within the app by specifying a path. For example, if your subscription path specifies /events, the events are sent to https://<base application URL>/events. Click Next to proceed.
5. For Summary, review the settings for your Object Storage event subscription and make changes if needed. When ready, click Create to create the Object Storage subscription.



5. Now that your Object Storage subscription is created, go to the Event subscriptions page to [view a listing of defined subscriptions](https://cloud.ibm.com/docs/codeengine?topic=codeengine-eventing-cosevent-producerview-eventing-cos-app-ui).
6. To update a subscription, navigate to your Object Storage subscription page. From the Event subscriptions page, click the name of the subscription that you want to update.
7. From your Object Storage subscription page, let's change the type of object change to only delete object changes. From the Bucket event details tab, select only the delete type of object change. Click Save to save your changes.
8. Because the myapp application references the sample cos-listen application, which prints information to log files, you can view the logs. After an object is deleted from the bucket, you can see an event for the delete in the app logs. See [Viewing application logs from the console](https://cloud.ibm.com/docs/codeengine?topic=codeengine-view-logsview-applogs-ui).



After you define an IBM Cloud Object Storage event subscription that references a specific bucket, you cannot update this subscription to use a different bucket. You must create a new subscription to reference the bucket that you want.





 Subscribing to IBM Cloud Object Storage events for an application with the CLI 

Before you begin



* [Set up your Code Engine CLI environment](https://cloud.ibm.com/docs/codeengine?topic=codeengine-install-cli).
Zoom

![Figure showing KVM console VPN notification window](https://cloud.ibm.com/docs-content/v1/content/009f5721283adef7a1874103d11c5b438182c4d7/virtual-servers/images/kvm_vpn_note.png)

Figure 1. VPN notification window
4. In the KVM console window, enter your credentials to log in to the virtual server.







 Actions that are available in the KVM console window 

In the KVM console window, you can restart, power on, and power off the virtual server. To perform these actions, click the overflow icon on the upper right of the console's window, then click the appropriate action.

You can also use the "Ctrl + Alt + Del" key combination from the actions.

If the console is disconnected, you can reconnect to it by clicking Reconnect.





 Disconnecting from the KVM console 

When you're finished with the console, you can disconnect from it by closing the browser window.





 Notes on the KVM console 

The KVM Console disconnected notification appears anytime the console either can’t connect or gets disconnected in the middle of a session. The code in the text is displayed only if the disconnection was unexpected. It helps debug find why the connection is failing. On a regular disconnection, no code is displayed.

Zoom

![Figure showing KVM console disconnection window](https://cloud.ibm.com/docs-content/v1/content/009f5721283adef7a1874103d11c5b438182c4d7/virtual-servers/images/kvm_disconnected_note.png)

Figure 1. KVM console disconnection window

The KVM Console opens in a new browser tab or window. If the KVM Console doesn't open, check the browser for any blocked new windows.
Check out the [Samples for IBM Cloud Code Engine GitHub repo](https://github.com/IBM/CodeEngine).







 Subscribing to IBM Cloud Object Storage events for a job 

You can work with IBM Cloud Object Storage subscriptions from the console or with the CLI so events are sent to a Code Engine job.

When you create an event subscription for a job, a job run is created for each event that is triggered, and this job run has the environment variables that are related to the job. For more information about the environment variables that are sent by IBM Cloud Object Storage, see [Environment variables for events](https://cloud.ibm.com/docs/codeengine?topic=codeengine-eventing-cosevent-producersub-envir-variables-cos).



 Subscribing to IBM Cloud Object Storage events for a job from the console 

You can create and update IBM Cloud Object Storage event subscriptions for a job from the console.

Before you begin



* [Create a project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project).
* [Create a job](https://cloud.ibm.com/docs/codeengine?topic=codeengine-create-jobcreate-job-ui). For example, create a job that is called myjob that uses the icr.io/codeengine/codeengine image. This image is built from codeengine.go, available from the [Samples for IBM Cloud Code Engine GitHub repo](https://github.com/IBM/CodeEngine).



Complete the following steps to create and update an IBM Cloud Object Storage event subscription for a job from the console.



1. From the [Code Engine Projects page](https://cloud.ibm.com/codeengine/projects), go to your project.
2. From the Overview page, click Event subscriptions.
3. From the Event subscriptions page, click Create to create your subscription.
4. From the Create an event subscription page, complete the following steps.



1.
For Summary, review the settings for your Object Storage event subscription and make changes if needed. When ready, click Create to create the Object Storage subscription.



5. Now that your Object Storage subscription is created, go to the Event subscriptions page to [view a listing of defined subscriptions](https://cloud.ibm.com/docs/codeengine?topic=codeengine-eventing-cosevent-producerview-eventing-cos-job-ui).
6. To update a subscription, navigate to your Object Storage subscription page. From the Event subscriptions page, click the name of the subscription that you want to update.
7. From your Object Storage subscription page, let's change the type of object change to only delete object changes. From the Bucket event details tab, only select the delete type of object change. Click Save to save your changes.
8. Because the myjob job references the sample icr.io/codeengine/codeengine job, which prints information to log files, you can view the logs. After an object is deleted from the bucket, you can see an event for the delete in the logs for the job run. See [Viewing job logs from the console](https://cloud.ibm.com/docs/codeengine?topic=codeengine-view-logsview-joblogs-ui).



Job runs that are created by subscriptions are deleted after 10 minutes.

After you define an IBM Cloud Object Storage event subscription that references a specific bucket, you cannot update this subscription to use a different bucket. You must create a new subscription to reference the bucket that you want.





 Subscribing to IBM Cloud Object Storage events for a job with the CLI 

Before you begin



* [Set up your Code Engine CLI environment](https://cloud.ibm.com/docs/codeengine?topic=codeengine-install-cli).
* [Create and work with a project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project).
* Create a job.
Working with the Kafka event producer 

A Code Engine Kafka subscription watches for new messages to appear in a Kafka instance. When you create a subscription for a set of topics, your app or job receives a separate event for each new message that appears in one of the topics. You can create at most 100 Kafka subscriptions per project.

While you can use any Kafka instance, the examples in this topic use the IBM® Event Streams for IBM Cloud® service. Event Streams is an IBM event streaming service for Kafka events. For more information about this service, see [Event Streams documentation](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-about).



 Setting up the Kafka event producer 

You can set up your Kafka message producer to send messages to Code Engine Kafka event subscriptions. Use your Code Engine Kafka event subscription to trigger applications or jobs when a Kafka message is received.

To get started, [create an Event Streams service instance](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-getting-startedgetting_started_prereqs) for your event streaming service. While you can use the console or the CLI, the following steps describe how to set up the Event Streams event producer with the CLI.



 Setting up the Event Streams CLI environment 



1. Download and install the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-getting-started). Log in to the IBM Cloud CLI.

ibmcloud login
2. Download and install the [Code Engine CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-install-cli).

ibmcloud plugin install code-engine -f
3. To use the Event Streams service for creating your Kafka instance, download and install the [Event Streams CLI](https://cloud.ibm.com/docs/cli?topic=EventStreams-cli).
When you run a job, you can override many of the variables that you set in the job configuration. To check the variables, run ibmcloud code-engine jobrun submit --help.
2. To check the status of the jobrun, run the following command

ibmcloud code-engine jobrun get --name backend-jobrun
3. The logs can be displayed:

ibmcloud code-engine jobrun logs --follow --name backend
4. In the frontend UI, click on the refresh button (next to Upload text file) to see the Keywords and JSON for each of the uploaded text files. The tag on each file should now change to Analyzed.
5. Upload new files or delete individual file by clicking the delete icon, resubmit the jobrun with the below command and hit the refresh button to see the results.

ibmcloud code-engine jobrun resubmit --jobrun backend-jobrun







 Automate the job run 

Instead of running the job manually, you can automate the job run by creating an IBM Cloud Object Storage subscription that listens for changes to an Object Storage bucket. When you create a subscription to a bucket, your job receives a separate event for each successful change to that bucket.



1. Before you can create an Object Storage subscription, you must assign the Notifications Manager role to Code Engine. As a Notifications Manager, Code Engine can view, modify, and delete notifications for an Object Storage bucket. [Follow the instructions here](https://cloud.ibm.com/docs/codeengine?topic=codeengine-eventing-cosevent-producernotify-mgr-cos) to assign the Notifications Manager role to your Code Engine project.
2. Run the below command to connect your backend-job to the IBM Cloud Object Storage event producer. Check and update the bucket name before running the command

ibmcloud code-engine subscription cos create --name backend-job-cos-event --destination-type job --destination backend-job --bucket $COS_BUCKETNAME --prefix files --event-type write
[35-Connectivity.svg](https://cloud.ibm.com/media/docs/images/homepage/35-Connectivity.svg)](https://community.ibm.com/community/user/cloud/home)

 Latest updates 

[View more](https://cloud.ibm.com/docs/overview?topic=overview-whatsnew)17 July 2023 | Carbon calculator

IBM Cloud's carbon calculator displays the carbon emissions for an account by monitoring your electricity consumption for services, resources, and the location and efficiency of your data centers.

09 January 2023 | Save and share cost estimates

When you create an estimate, you can save each estimate's unique link to share or revisit directly through your browser.

01 March 2022 | Use feature and subscription codes to create new accounts

When you register for a new IBM Cloud account, you can use a feature code that you received from participating in a special event or a subscription code that you received by email. Instead of verifying your identity by entering your credit card information, click the option to Register with a code to complete the set up of your new account.
Using SLES within the Power Systems Virtual Server 

You can deploy a Linux® virtual machine (VM) using one of the IBM stock OS images, or you can bring your own Linux image (in OVA format).

You can choose from the following options:



* Register for a full Linux subscription.
* Use your own Linux subscription from a Linux vendor.



If you choose to register for full Linux subscription, an additional charge will apply to your provisioned VM for Linux support through IBM. Full Linux subscription requires use of one of the stock operating system images provided by IBM. In the image menu, select IBM provided subscription to choose one of the IBM stock images. For more information on how to provision and register using a full Linux subscription, see [Full Linux subscription for Power Systems Virtual Server](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-set-full-Linux).

If you choose to provision a Linux VM with your own subscription, select Linux – Client supplied subscription. In the image menu, select your custom image. For more information, see [how to deploy a custom image with Power Systems Virtual Server](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-deploy-custom-image).

The Power Systems Virtual Server provides Linux (RHEL and SLES) stock images for SAP and non-SAP applications. The following versions of SLES are supported:



* SLES 15 SP2 for SAP HANA (SLES15-SP2-SAP)
* SLES 15 SP2 for SAP NetWeaver (SLES15-SP2-SAP-NETWEAVER)
* SLES 15 SP3 for SAP HANA (SLES15-SP3-SAP)
* SLES 15 SP3 for SAP NetWeaver (SLES15-SP3-SAP-NETWEAVER)
* SLES 15 SP3 general purpose (SLES15-SP3)
* SLES 15 SP4 general purpose (SLES15-SP4)
* SLES 15 SP4 for SAP HANA (SLES15-SP4-SAP)
This image is built from receiver.go, which is available from the [Samples for IBM Cloud Code Engine GitHub repo](https://github.com/IBM/CodeEngine/tree/main/kafka). This sample does not require any environment variables.
2. After you deploy this app, confirm that it is in ready status.



When you use the console, it is not necessary that the app or job that you use to receive Kafka events exist before you create the Kafka event subscription. However, if the app or job does not exist when you create the event subscription, the status of the subscription reflects that the consumer does not exist. You must create the app or job before the subscription is in a ready state and can receive events through this subscription.





 Creating a Code Engine Kafka event subscription for an app from the console 

The Kafka event subscription defines the relationship between the Kafka producer (sender) and consumer (receiver) of events.

Before you begin



* Determine the Code Engine project that you want to use and make sure that this project is selected. See [Create and work with a project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project).



Complete the following steps to create a Kafka event subscription for an application from the console.



1. From the [Code Engine Projects page](https://cloud.ibm.com/codeengine/projects), go to your project.
2. From the Overview page, click Event subscriptions.
3. From the Event subscriptions page, click Create to create your subscription.
4. From the Create an event subscription page, select the Event Streams / Kafka tile to specify the event type.
5. For General, provide a name for the Event Streams / Kafka subscription. Click Next to proceed.
6. For Message broker details,



1. Specify the Kafka message broker hosts for the message queues from which messages are received as events through this subscription.
* [Create and work with a project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project).





1. [Create an Code Engine job](https://cloud.ibm.com/docs/codeengine?topic=codeengine-create-jobcreate-job-ui) to act as an event consumer of Kafka messages and receive the Kafka events. For example, create a job that is called kafka-receiver-job that uses the icr.io/codeengine/codeengine image. This image is built from codeengine.go, available from the [Samples for IBM Cloud Code Engine GitHub repo](https://github.com/IBM/CodeEngine).

ibmcloud ce job create -n kafka-receiver-job --image icr.io/codeengine/codeengine
2. (optional) After you create this job, run the job get command to view information about this job.

ibmcloud ce job get -n kafka-receiver-job







 Creating a Code Engine Kafka event subscription for a job with the CLI 

You can create a Kafka event subscription, which defines the relationship between the Kafka producer (sender) and consumer (receiver) of events, with the CLI.



1. Create a Code Engine Kafka event subscription for your Kafka events by using the [ibmcloud ce sub kafka create](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-subscription-kafka-create) command. Use the kafka-subscription-secret secret that you previously created to access the message broker. Specify the broker information based on the service credentials information for your Kafka resource. For this example, you can obtain the broker information from the output of the ibmcloud resource service-key myeventstream-key command. Notice that you must specify a --broker option for each broker for your topic. The --destination option specifies the Code Engine resource that receives the events.
: Suffix of the IBM Cloud Object Storage object. Consider the file type (extension) of your file when specifying the suffix. This value is optional.





 Example 

The following example updates a COS subscription called mycosevent to listen for only write events.

ibmcloud ce subscription cos update --name mycosevent --event-type write





 Example output 

Updating COS source 'mycosevent'...
Run 'ibmcloud ce subscription cos get -n mycosevent' to check the COS source status.
OK









 Subscription cron commands 

Oftentimes in distributed environments you want your applications or jobs to react to messages (events) that are generated from other components, which are usually called event producers. With Code Engine, your applications or jobs can receive events of interest by subscribing to event producers. Event information is received as POST HTTP requests for applications and as environment variables for jobs.

The cron event producer is based on cron and generates an event at regular intervals. Use a cron event producer when an action needs to be taken at well-defined intervals or at specific times.

You must be within the context of a [project](https://cloud.ibm.com/docs/cli?topic=cli-clicli-project) before you use subscription cron commands.

For more information about working with the IBM Cloud Object Storage subscriptions, see [Working with the Periodic timer (cron) event producer](https://cloud.ibm.com/docs/codeengine?topic=codeengine-subscribe-cron). See [Getting started with subscriptions](https://cloud.ibm.com/docs/codeengine?topic=codeengine-subscribing-events) for more information about working with subscriptions in Code Engine.

You can use either subscription or sub in your subscription cron commands. To see CLI help for the subscription cron command, run ibmcloud ce sub cron -h.



 ibmcloud ce subscription cron create 

Create a cron event subscription.
: Suffix of the IBM Cloud Object Storage object. Consider the file type (extension) of your file when specifying the suffix. This value is optional.





 Example 

The following example updates a COS subscription called mycosevent to listen for only write events.

ibmcloud ce subscription cos update --name mycosevent --event-type write





 Example output 

Updating COS source 'mycosevent'...
Run 'ibmcloud ce subscription cos get -n mycosevent' to check the COS source status.
OK









 Subscription cron commands 

Oftentimes in distributed environments you want your applications or jobs to react to messages (events) that are generated from other components, which are usually called event producers. With Code Engine, your applications or jobs can receive events of interest by subscribing to event producers. Event information is received as POST HTTP requests for applications and as environment variables for jobs.

The cron event producer is based on cron and generates an event at regular intervals. Use a cron event producer when an action needs to be taken at well-defined intervals or at specific times.

You must be within the context of a [project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-project) before you use subscription cron commands.

For more information about working with the IBM Cloud Object Storage subscriptions, see [Working with the Periodic timer (cron) event producer](https://cloud.ibm.com/docs/codeengine?topic=codeengine-subscribe-cron). See [Getting started with subscriptions](https://cloud.ibm.com/docs/codeengine?topic=codeengine-subscribing-events) for more information about working with subscriptions in Code Engine.

You can use either subscription or sub in your subscription cron commands. To see CLI help for the subscription cron command, run ibmcloud ce sub cron -h.



 ibmcloud ce subscription cron create 

Create a cron event subscription.
From the [Code Engine Projects page](https://cloud.ibm.com/codeengine/projects), go to your project.
2. From the Overview page, click Event subscriptions to view a listing of defined subscriptions.
3. From the list of subscriptions, delete the subscription that you want to remove from your application or job.



If you delete an app or a job, the subscription is not deleted.





 Deleting a subscription with the CLI 

You can delete a subscription by running the [ibmcloud ce sub cron delete](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-subscription-cron-delete) or the [ibmcloud ce sub cos delete](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-subscription-cos-delete) command.

For example, delete a cron subscription that is called mycronevent2,

ibmcloud ce subscription cron delete --name mycronevent2

If you delete an app or a job, the subscription is not deleted. Instead, in the CLI, the subscription moves to ready state of false because the subscription depends on the availability of the application or job. If you re-create the app or job (or another app or job with the same name), your subscription reconnects and the Ready state is true.
For Code Engine to work with Kafka events, use the console or CLI to set up a Code Engine Kafka eventing subscription to connect to Kafka event brokers and listen for Kafka events. Also, set up a Code Engine app (or job) to act as the receiver of the Kafka events. The Kafka event subscription defines the relationship between the Kafka producer (sender) and consumer (receiver) of events.

The Code Engine Kafka event subscription connects to your Kafka message broker and sends HTTP Post requests for each incoming Kafka message to the receiver application. For more information, see [HTTP headers and body information for events](https://cloud.ibm.com/docs/codeengine?topic=codeengine-working-kafkaevent-producersubkafka-headerbody-app).



 Subscribing to Kafka events for an app from the console 

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



 Creating a Code Engine app to receive Kafka events from the console 



1. [Create an Code Engine application](https://cloud.ibm.com/docs/codeengine?topic=codeengine-deploy-appdeploy-app-console) to act as an event consumer of Kafka messages and receive the Kafka events. For example, create an application that is called kafka-receiver-app that uses the icr.io/codeengine/kafka-receiver image. This image is built from receiver.go, which is available from the [Samples for IBM Cloud Code Engine GitHub repo](https://github.com/IBM/CodeEngine/tree/main/kafka). This sample does not require any environment variables.
2. After you deploy this app, confirm that it is in ready status.



When you use the console, it is not necessary that the app or job that you use to receive Kafka events exist before you create the Kafka event subscription.