vania-janet/multiturn-rag-retrieval-data huggingface dataset:
"token_type": "Bearer",
"expires_in": 3600,
"expiration": 1534763807,
"scope": "ibm openid"
}
Show more

Upon generating the access token by using the preceding curl command, operate the Rest APIs by passing the Bearer <value of access_token> in the Authorization header.

For example:

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer eyJraWQiOiIyMDE3MTAzMC0wMDowMDowMCIsImFsZyI6IlJTMjU2In0.eyJpYW1faWQiOiJpYW0tU2VydmljZUlkLTYxZDdhNzJkLWM3YzAtNGNlZS05Zjg0LWI2ZDc1NzgzMWM2NSIsImlkIjoiaWFtLVNlcnZpY2VJZC02MWQ3YTcyZC1jN2MwLTRjZWUtOWY4NC1iNmQ3NTc4MzFjNjUiLCJyZWFsbWlkIjoiaWFtIiwiaWRlbnRpZmllciI6IlNlcnZpY2VJZC02MWQ3YTcyZC1jN2MwLTRjZWUtOWY4NC1iNmQ3NTc4MzFjNjUiLCJzdWIiOiJTZXJ2aWNlSWQtNjFkN2E3MmQtYzdjMC00Y2VlLTlmODQtYjZkNzU3ODMxYzY1Iiwic3ViX3R5cGUiOiJTZXJ2aWNlSWQiLCJhY2NvdW50Ijp7ImJzcyI6Ijk3MDg5MjkzNTg0OTg1NzBhYjYxMjUwNDk3ZjBmMDI2In0sImlhdCI6MTUzNTM2NTQ5MywiZXhwIjoxNTM1MzY5MDkzLCJpc3MiOiJodHRwczovL2lhbS5ibHVlbWl4Lm5ldC9pZGVudGl0eSIsImdyYW50X3R5cGUiOiJ1cm46aWJtOnBhcmFtczpvYXV0aDpncmFudC10eXBlOmFwaWtleSIsInNjb3BlIjoiaWJtIG9wZW5pZCIsImNsaWVudF9pZCI6ImRlZmF1bHQiLCJhY3IiOjEsImFtciI6WyJwd2QiXX0.ASKxD9Wrz5--OYVkPIsufKK9RNKKhJKuvRldm5mnGNv6PSH7sPBB6NiRG-SSGzEC0ZIei1WqtRE-0TRHwzSnIjXPb3yffBcvNtXuG9wT8GT8zsvxQ7bJk0ovge_0Xrrcym4cCTq2jO6ROWzOZ275wkH0h4fIzukbPv7YpT2Z-DdxIwHY_uALxqcCY83xODtMIs21PO6YwQ3KX4YfNEpKUminJpo45T8po4k049PODQKEK65YrqHYK1_voCJUu9xt9uVoGd-r962fhnbuxeEAe6di9KGVfOGfEdZFHgexoG__wXHa0Rmv9dCl-nNI4WMZfCTj8jgfEOhuZstpW7pW2g' --header 'Accept-Language: en-US' -d '{ "message": { "alert": "Notification alert message" } }' 'https://us-east.imfpush.cloud.ibm.com/imfpush/v1/apps/4809d407-85ff-4d11-ae4b-0fcdf8a833f1/messages'
Show more
The following table lists and describes each of the variables that are used in the previous steps.



Table 3. Variables for provisioning the tool integration with the API

 Variable Description 

 {event_notifications_tool_integration_name} The name of the Event Notifications service instance. 
 {event_notifications_service_crn} The CRN of the Event Notifications service instance. 
 {toolchain_id} The toolchain in which to create the tool integration. 









 Delivering notifications to select destinations 

After you enable event notifications for a toolchain, create [topics](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-create-en-topic), [destinations](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-create-en-destination), and [subscriptions](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-create-en-subscription) in Event Notifications so that alerts can be forwarded and delivered to your selected destinations.

For a complete list of supported destinations, see the [Event Notifications documentation](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-destination).





 Notification payload details 

Events that are generated by toolchains and their associated tool integration instances contain various fields that help you to identify the source and details of an event.

Event notifications from toolchains and tool integration instances contain only metadata properties, such as names or identifiers of resources. Sensitive data, such as API keys or passwords, is not included in generated events.

The properties that are sent to Event Notifications vary depending on the event type. For example, if a com.ibm.cloud.toolchain.pipeline:pipeline_start:1 event takes place, the toolchain sends a notification payload to Event Notifications that is similar to the following example.

{
"subject": {
"name": "<user>",
"email": "<user_email>",
4. Review the average network request count by pod from the last 1 day or 1 week time window to determine the threshold.
5. In the Network Request Count by Pod tile, create an alert by clicking the Options menu and then Create alert. Set the alert parameters based on the threshold that you observed. For example, if the network utilization remains under the threshold for a certain amount of time, then the alert is triggered.
6. Open the Notification section of the alert menu and create or select an alert notification channel.
7. Save your alert.
8. Repeat these steps for all the apps that are deployed in your cluster.
9. Test the alert that you created by editing the threshold that you configured to manually trigger the alert. For example, if you set an alert for when the number of network requests by pod is less than 3/s for 5 minutes, edit your alert threshold to be less than the threshold that you observed for 5 minutes and select the at least once option.
10. Verify that the alert is triggered after 5 minutes. Once you have verified the alert, reset the values to the values you configured earlier.



6. Create a pod availability alert for an app that runs in your cluster.



1. From the IBM Cloud Monitoring console, click Overview > Workloads.
2. Select the Namespace where your app is deployed. Find your app, click the arrow icon on your app, and select Kubernetes Pod overview.
3. In the Pod Health section, review the Pod Availability tile.
4. Review the average pod availability from the last 1 day or 1 week time window to determine the threshold.
5. Review your app configuration file for the number of requested replicas. You can use this number as a threshold for sending alerts when the number of available pods is fewer than your requested number of replicas for your app. If you requested 3 replicas of your app, you can set an alert for when the number of available pods stays fewer than the requested replica count for a certain time duration, for example, a 30 minute duration. In this example, when the pod availability remains fewer than the 3 requested replicas, the alert is triggered.
6.
SI-4 (2) - Automated Tools for Real-time Analysis 



  Control requirements 

SI-4 (2) - 0
:   The organization employs automated tools to support near real-time analysis of events.





  NIST supplemental guidance 

Automated tools include, for example, host-based, network-based, transport-based, or storage-based event monitoring tools or Security Information and Event Management (SIEM) technologies that provide real time analysis of alerts and/or notifications generated by organizational information systems.
Event Notifications relationship model 

Event Notifications includes sources, filters, topics, destinations, and subscriptions. The relationship between these elements is shown in Figure 1.

Zoom

![Event Notifications flow](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en_relationshipmodelv3.png)

Figure 1. Event Notifications relationship model

Events originate outside Event Notifications, for example, from IBM Cloud services. An 'event source' within Event Notifications represents a connection between Event Notifications and one of these event-producing services.

Topics have associated filters that determine which source events are published. Topics can have multiple sources, each with their own filter. Topics isolate events of interest from various sources and aggregate them into one entity.

Subscriptions tie topics to destinations. While a single topic or destination can be associated with multiple subscriptions, a subscription is one-to-one, meaning it ties one topic to one destination. For service-to-human channels, one subscription can contain multiple recipients. For example, a subscription to an email destination is not restricted to just one email address but instead has a recipient list that might hold many addresses.



 Event notification flow 

When an event occurs in a registered source, the source sends an event notification to the Event Notifications service. Based on the filters or conditions that are defined on the source, this incoming notification is targeted to one or several topics. The notification is delivered to all destinations, which are subscribed to the targeted topics.





 Event notification format 

A notification sent to the Event Notifications service must conform to the [CNCF](https://www.cncf.io/)[CloudEvents](https://cloudevents.io/) format.





 More about filters 

A filter is a conditional statement, which connects a source to a topic. Filters are written to route notifications of interest to a particular topic. All notifications that pass through the filters into a topic are then routed to the topic subscribers.
Setting up disk alerts for disk utilization 



 Objectives 

Getting timely alerts about resource utilization is key to managing your database, avoiding problems, and mitigating downtime. If you know in advance that your database is running out of disk, take steps to scale those resources.

In this tutorial, you use the IBM Cloud API and the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-getting-started) to set up an alert that emails you whenever the disk utilization of your database exceeds 90%. This specific example creates an alert on a Databases for Elasticsearch deployment, but it is applicable to all the databases in the IBM Cloud Databases catalog.





 Getting productive 



 Set up monitoring instance and Platform Metrics 

To get started, you need access to [IBM Cloud® Monitoring](https://www.ibm.com/cloud/cloud-monitoring) in your database region, and you need to have a [monitoring instance](https://cloud.ibm.com/docs/monitoring?topic=monitoring-getting-started) available. This monitoring instance must be in the same region as the database target.

You also must have [Platform Metrics](https://cloud.ibm.com/docs/monitoring?topic=monitoring-platform_metrics_enabling) enabled.





 Install Command Line Interface tools 

Next, you need the [IBM Cloud Monitoring CLI](https://cloud.ibm.com/docs/%28https://cloud.ibm.com/docs/cli?topic=cli-monitor-cli%29) and [Cloud Databases CLI plug-in](https://cloud.ibm.com/docs/databases-cli-plugin?topic=databases-cli-plugin-cdb-referenceinstalling-cli-plugin).

Install the IBM Cloud Monitoring CLI by running the following command:

ibmcloud plugin install monitoring

Install the Cloud Databases CLI plug-in by running the following command:

ibmcloud plugin install cloud-databases

You are now ready to retrieve and monitor your service instance.







 Step 1: Retrieve your monitoring service instance
The properties that are sent to Event Notifications vary depending on the event type. For example, if an check.pipeline.succeeded event takes place, projects sends a notification payload to Event Notifications that is similar to the following example.

{
"_id": "a7110265-88e5-4fda-8686-ae4d5bb3f86a",
"event": "check.pipeline.succeeded",
"target": "639d4201-8cf9-4e29-b076-5129b6a3f839:1:true",
"source": "d1542c4b-533c-4276-9272-00ce5134a7a3",
"triggered_by": "IBMid-test-notification",
"action_url": "https://cloud.ibm.com/schematics/workspaces/us-south.workspace.projects-service.e7de98e8/jobs?region=us",
"severity": "INFO",
"timestamp": "2023-04-10T16:00:43.195Z"
}

Review following table for more information about event notification properties.



Table 2. Properties in an event notification payload

 Property Description 

 event_sub_type The subtype that corresponds with the [type of event](https://cloud.ibm.com/docs/secure-enterprise?topic=secure-enterprise-event-notifications-eventsevent-notifications-list) that triggered a notification. 
 event_type The [type of event](https://cloud.ibm.com/docs/secure-enterprise?topic=secure-enterprise-event-notifications-eventsevent-notifications-list) that triggered a notification. 
 source_instance_api_url The dedicated endpoint URL that is assigned to your projects service instance. 
 source_instance_crn The Cloud Resource Name (CRN) that uniquely identifies your projects service instance. 
 source_instance_dashboard_url The URL to your projects service dashboard in the console.
The properties that are sent to Event Notifications vary depending on the event type. For example, if a com.ibm.cloud.toolchain.pipeline:pipeline_start:1 event takes place, the toolchain sends a notification payload to Event Notifications that is similar to the following example.

{
"subject": {
"name": "<user>",
"email": "<user_email>",
"iam_id": "<iam_id>"
},
"toolchain.instance": {
"crn": "crn:v1:bluemix:public:toolchain:<region>:a/<account_id>:<toolchain_id>::",
"href": "https://api.<region>.devops.cloud.ibm.com/toolchain/v2/toolchains/<toolchain_id>",
"id": "357d4432-964a-46ae-83d4-df91eb539d1a",
"name": "EventNotifications-toolchain",
"resource_group_id": "<resource_group_id>",
"ui_href": "https://cloud.ibm.com/devops/toolchains/<toolchain_id>?env_id=ibm:yp:us-south"
},
"toolchain.tool-instance": {
"href": "https://api.<region>.devops.cloud.ibm.com/toolchain/v2/toolchains/<toolchain_id>/tools/<tool_id>",
"id": "<tool_id>",
"name": "ci-pipeline",
"tool_type_id": "pipeline",
"referent": {
: The type of notification. Required.

The minimum length is 1 character. The value must match regular expression /a-zA-Z 0-9-_/.

--time TIME] or --time TIME] (string)
: The Timestamp to be set for notification. Required.

The minimum length is 1 character. The value must match regular expression /a-zA-Z 0-9-_/.

--datacontenttype DATACONTENTTYPE] (string)
: The data content type for notification. Required.

The minimum length is 1 character. The value must match regular expression /a-zA-Z 0-9-_/. Default value is application/json.

--specversion SPECVERSION] or --ce-specversion CE-SPECVERSION] (string)
: The spec version value. Default value to be used is 1.0.

The minimum length is 1 character. The value must match regular expression /0-9]. Default value is 1.0.

--push-to PUSH-TO] or --ce-ibmenpushto CE-IBMENPUSHTO]DeviceDataConfiguration]]
: The Device data information to send data in case of Registered Devices / Users IDs / Platforms. For broadcast, choose {}.

--message-fcm-body MESSAGE-FCM-BODY] or --ce-ibmenfcmbody CE-IBMENFCMBODY]FCMMessageBodyDataPayload]DeviceDataConfiguration]
: FCM message body to send notification to FCM devices.

--message-apns-headers MESSAGE-APNS-HEADERS] or --ce-ibmenapnsheaders CE-IBMENAPNSHEADERS] [APNSHeaders#en-cli-send-notification-example-schema)
: The Custom APNS headers information can be set by using this option.
"event_notifications_instance_crn" : "crn:v1:bluemix:public:event-notifications:us-south:a/22018f3c34ff4ff193698d15ca316946:578ad1a4-2fd8-4e66-95d5-79a842ba91f8::"
}







 ibmcloud secrets-manager notifications-registration-delete 

Delete the registration between your Secrets Manager instance and Event Notifications.

A successful request removes your Secrets Manager instance as a source in Event Notifications.

ibmcloud secrets-manager notifications-registration-delete



 Example 

ibmcloud secrets-manager notifications-registration-delete







 ibmcloud secrets-manager notifications-registration-test 

Send a test event from a Secrets Manager instance to a configured [Event Notifications](https://cloud.ibm.com/apidocs/event-notifications) instance.

A successful request sends a test event to the Event Notifications instance. For more information about enabling notifications for Secrets Manager, check out the [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-event-notifications).

ibmcloud secrets-manager notifications-registration-test



 Example 

ibmcloud secrets-manager notifications-registration-test









 Schema examples 

The following schema examples represent the data that you need to specify for a command option. These examples model the data structure and include placeholder values for the expected value type. When you run a command, replace these values with the values that apply to your environment as appropriate.



 ConfigurationActionPrototype 

The following example shows the format of the ConfigurationActionPrototype object.

{
"action_type" : "private_cert_configuration_action_rotate_crl"
}





 ConfigurationPrototype 

The following example shows the format of the ConfigurationPrototype object.

{
"config_type" : "private_cert_configuration_root_ca",
"name" : "example-root-CA",
* The following example shows the format of body to send notification to slack destination.

{"specversion" : "1.0","source": "github.io/pr","ibmensourceid": "4e22c0fe-5db3-49ce-9b86-47d3fd57f7a8:api","id":"1234-1234-sdfs-234", "time" : "2018-04-05T17:31:00Z","type":"com.ibm.cloud.compliance.certificate_manager:certificate_expired", "subject":"12345678", "ibmenseverity":"HIGH","ibmensmstext":"Test message for EN - 5syat56","ibmensubject":"Findings on IBM Cloud Security Advisor's","ibmenhtmlbody":" "Hi ,<br/>Certificate expiring in 90 days.<br/><br/>Please login to <a href="https: //cloud.ibm.com/security-compliance/dashboard">Security and Complaince dashboard</a> to find more information<br/>" ","ibmendefaultshort":"Security findings in your IBM Cloud Account","ibmendefaultlong":"Certificate expiring in 90 days. Please login to cloud console to find more information","ibmenfcmbody": "{"notification":{"title":"Hello, Tag","time_to_live":100}}",
VMware Aria Operations for Logs supports alerts that trigger notifications about its health and generates notifications when an important system event occurs, for example, when the disk space is almost exhausted and VMware Aria Operations for Logs must start deleting or archiving old log files.







 System requirements 

The design uses the following quantity and size of appliances:



Table 1. Operation tooling summary system requirements

 VMware Aria Operations VMware Aria Operations for Logs VMware Aria Operations for Networks Proxy 

 VM Qty 4 4 1+1 1 
 vCPU 8 8 4 + 8 4 
 RAM (GB) 32 16 12 + 32 0.5 
 Disk (GB) 254 1,042 158 + 1000 80 







 Software versions 



Table 2. Operational tooling software versions

 Product name Version 

 VMware Aria Operations Manager Advanced or higher 7.0 
 VMware Aria Operations Management Pack for NSX for vSphere 3.5.2 
 VMware Aria Operations Management Pack for Storage Devices 7.0.0 
 VMware Aria Operations Management Pack for Site Recovery Manager 8.1.1 
 VMware Aria Operations for Logs 4.7 
 VMware Aria Operations for Logs Content Pack for NSX for vSphere 3.8
Event Notifications payload 

This document outlines the Event Notifications specification.



 Introduction 

This document describes the payload details for sending events by using the API sources in Event Notifications. API sources can be used to send events from your backend applications. You can use this to send Push notifications from business backends.

Events from API sources cannot be routed to IBM Email and IBM SMS destinations.

METHOD: POST
URL: /event-notifications/v1/apps/{instanceID}/notifications
Header: Authorization: Bearer <IAM token>

The Events adhere to Cloud Event standard. You can find more information about Cloud Events here.





 Modes of transport 

Event Notifications supports the following two modes to make HTTP calls. This is adhering to the Cloud Events specification.



 Binary Mode 

In the binary content mode, the value of the event data is placed into the HTTP request, or response, body as-is, with the datacontenttype attribute value declaring its media type in the HTTP Content-Type header; all other event attributes are mapped to HTTP headers.

All the attribute names are prefixed with ce- and added to the header (except for the data and datacontenttype).

Binary Mode is recommended way to send notifications.





 Structured Mode 

In the structured content mode, event metadata attributes and event data are placed into the HTTP request body. For structured mode set the Content-Type header to application/cloudevents+json.







 Attributes 



 CE Mandatory Attributes 

The following attributes are mandatory for the event request to be accepted.



 ID (String) 

A unique identifier that identifies each event. source+id must be unique. The backend should be able to uniquely track this ID in logs and other records. Send unique ID for each send notification. Same ID can be sent in case of failure of send notification.

source+id is logged in IBM Cloud Logging service. Using these combination IBM customers are able to trace the event movement from one system to another and will aid in debugging and tracing.



 Example 

id: qwer-1234-1qsd-po94







 source (URI-reference)
As a Notifications Manager, Code Engine can view, modify, and delete notifications for an Object Storage bucket.

Only account administrators can assign the Notifications Manager role.



1. Identify the Code Engine project that you want to use. You can use the [ibmcloud ce project list](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-project-list) command to display a list of projects. Use the [ibmcloud ce project select](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-project-select) command to select your project as the current context. For example, to select a project named myproject

ibmcloud ce project select -n myproject
2. Assign the Notification Manager role by using the [ibmcloud iam authorization-policy-create](https://cloud.ibm.com/docs/account?topic=cli-ibmcloud_commands_iamibmcloud_iam_authorization_policy_create) command.

For example, to assign the Notifications Manager role to a project named myproject for an Object Storage instance named mycosinstance,

ibmcloud iam authorization-policy-create codeengine cloud-object-storage "Notifications Manager" --source-service-instance-name PROJECT --target-service-instance-name COS-INSTANCE

After you assign the Notifications Manager role to your project, you can then create Object Storage subscriptions for any regional buckets in your Object Storage instance that are in the same region as your project.

The following table summarizes the options that are used with the iam authorization-policy-create command in this example. For more information about the command and its options, see the [ibmcloud iam authorization-policy-create](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_commands_iamibmcloud_iam_authorization_policy_create) command.



iam authorization-policy-create command components

 Command option Description 

 codeengine The source service that can be authorized to access.
Slack 

Slack is a messaging platform that helps teams to connect and collaborate. When you select slack as a service destination, any subscribed notification about an event can be sent as a message to slack channels.

When a message of length greater than 3000 characters is sent to slack, the message text gets truncated with leaders [...].



 Generate slack incoming webhook URL 

To post a slack notification, that you need to generate an incoming webhook URL. To generate the URL, follow these steps: [Incoming webhooks for Slack](https://api.slack.com/messaging/webhooks).





 Configuring a slack destination 

You can configure a slack destination in the Destinations tab. As part of the configuration, enter the Slack Incoming Webhook URL. Create a subscription to associate the slack destination to a topic.





 Configuring a slack subscription 

You can add attachment color to individual slack subscription based on hex code, for example, "#0000FF" for blue.





 How a slack notification from Event Notifications looks 

Event notification generates slack notifications from incoming payload. The template event notification use to send to slack looks like following -

{
"text": "{{event.ibmendefaultshort}}",
"attachments": [{
"color": "{{config.subscription.attachment_color}}",
"blocks": {
"type": "section",
"text": {
"type": "mrkdwn",
"text": "{{event.ibmendefaultlong}}"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "{{event.data}} "
}
}
]
}]
}
Show more

Here -

ibmendefaultshort is the default short payload that is provided in the incoming payload.