vania-janet/multiturn-rag-retrieval-data huggingface dataset:
[Create and send push notifications to iOS mobile using Event Notifications](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-push-apns)Create and send push notifications to iOS mobile using Event Notifications

Create an Event Notifications service, add a push destination for Apple Push Notification service (APNs), and send messages to iOS devices.

Event Notifications



* 10 minutes
* 2022-10-26



[Create and send push notifications to Chrome web by using Event Notifications](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-push-chrome)Create and send push notifications to Chrome web by using Event Notifications

Create an Event Notifications service, add a push destination for Chrome Push Notifications, and send messages to Chrome web devices.

Event Notifications



* 10 minutes
* 2022-10-26



[Create and send push notifications to Android mobile using Event Notifications](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-push-fcm)Create and send push notifications to Android mobile using Event Notifications

Create an Event Notifications service, add a push destination for Firebase Cloud Messaging (FCM), and send messages to Android devices.

Event Notifications



* 10 minutes
* 2023-02-28



[Create and send push notifications to Firefox web by using Event Notifications](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-push-firefox)Create and send push notifications to Firefox web by using Event Notifications

Create an Event Notifications service, add a push destination for Firefox, and send messages to Firefox web devices.

Event Notifications



* 10 minutes
* 2022-10-26
* [Functions to read and write data](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-read-write-data)
* [Topological functions](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-topological-functions)
* [Geohashing functions](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-geohashing-functions)
* [Geospatial indexing functions](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-spatial-indexing-functions)
* [Ellipsoidal functions](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-ellipsoidal-metrics)
* [Routing functions](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-routing-functions)







 Learn more 

Check out the following Python notebooks to learn how to use the spacio-temporal library functions in Python notebooks. To access these notebooks, you need an IBM Watson® Studio instance. See [Provisioning an IBM Watson® Studio instance](https://cloud.ibm.com/catalog/services/watson-studio).



* [Use the spatio-temporal library for location analytics](https://dataplatform.cloud.ibm.com/exchange/public/entry/view/92c6ab6ea922d1da6a2cc9496a277005)
* [Use spatial indexing to query spatial data](https://dataplatform.cloud.ibm.com/exchange/public/entry/view/a7432f0c29c5bda2fb42749f3628d981)
* [Spatial Queries in PySpark](https://dataplatform.cloud.ibm.com/exchange/public/entry/view/27ecffa80bd3a386fffca1d8d1256ba7)
* Java
* Node
* Python
* Go



curl -H "Authorization: Bearer $JWT" -X POST "$SERVICE_URL/_api/v2/user/activity_tracker/events" --data '{"types": ["management", "data"]}'

import java.util.Arrays;

import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.Ok;
import com.ibm.cloud.cloudant.v1.model.PostActivityTrackerEventsOptions;

Cloudant service = Cloudant.newInstance();

PostActivityTrackerEventsOptions options =
new PostActivityTrackerEventsOptions.Builder()
.types(Arrays.asList("management", "data"))
.build();

Ok response =
service.postActivityTrackerEvents(options).execute().getResult();

System.out.println(response);

const { CloudantV1 } = require('@ibm-cloud/cloudant');

const service = CloudantV1.newInstance({});

service.postActivityTrackerEvents({
types: ['management', 'data'],
}).then(response => {
console.log(response.result);
});

from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()

response = service.post_activity_tracker_events(
types=['management', 'data']
).get_result()

print(response)

postActivityTrackerEventsOptions := service.NewPostActivityTrackerEventsOptions(
[]string{"management", "data"},
)

activityTrackerEvents, response, err := service.PostActivityTrackerEvents(postActivityTrackerEventsOptions)
Continuous integration pipeline hosts

 Host Description 

 https://hooks.slack.com/services When the Slack integration is configured, notifications are sent when pipelines start and finish. 
 https://otc-github-consolidated-broker.<region>.devops.cloud.ibm.com/github/token?git_id=integrated The OTC broker URL to fetch a Git token if one was not provided. 
 https://<region>.git.cloud.ibm.com Clones repos, sets and checks the pull request status, and stores evidence. 
 Cloud Object Storage endpoint in cos-endpoint The endpoint that stores the evidence in Cloud Object Storage. For more information, see [Endpoint Types](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpointsadvanced-endpoint-types). 
 https://detect-secrets-client-version.s3.us-south Detects secrets checks for newer versions. 
 https://otcbroker.devopsinsights.cloud.ibm.com Checks the toolchain for Code Risk Analyzer support. 
 https://iam.cloud.ibm.com/identity/token Gets the IAM token. 
 https://gitsecure.us-south.devopsinsights.cloud.ibm.com The Code Risk Analyzer API. 
 https://vcurator.us-south.devopsinsights.cloud.ibm.com Code Risk Analyzer. 
 https://api.<region>.devops.cloud.ibm.com/v1/tekton-pipelines Gets the pipeline run data. 







 Promotion pipelines 

The following table lists and describes each of the hosts that are accessed from promotion pipelines.



Table 3. Promotion pipeline hosts

 Host Description 

 https://hooks.slack.com/services When the Slack integration is configured, notifications are sent when pipelines start and finish.
Serverless web app and eventing for data retrieval and analytics 

This tutorial may incur costs. Use the [Cost Estimator](https://cloud.ibm.com/estimator/review) to generate a cost estimate based on your projected usage.

In this tutorial, you create an application to automatically collect GitHub traffic statistics for repositories and provide the foundation for traffic analytics. GitHub only provides access to the traffic data for the last 14 days. If you want to analyze statistics over a longer period of time, you need to download and store that data yourself. In this tutorial, you deploy a serverless app in a IBM Cloud Code Engine project. The app manages the metadata for GitHub repositories and provides access to the statistics for data analytics. The traffic data is collected from GitHub either on-demand in the app or when triggered by Code Engine events, e.g., daily. The app discussed in this tutorial implements a multi-tenant-ready solution with the initial set of features supporting a single-tenant mode.

Zoom

![Architecture Diagram](https://cloud.ibm.com/docs-content/v1/content/f84e2238288b7f0355715a4c355609ce7ac48fb0/solution-tutorials/images/solution24-github-traffic-analytics/Architecture.png)

Figure 1. Architecture diagram of the tutorial



 Objectives 



* Deploy a containerized Python database app with multi-tenant support and secured access
* Integrate App ID as OpenID Connect-based authentication provider
* Set up automated, serverless collection of GitHub traffic statistics







 Before you begin 

This tutorial requires:



* IBM Cloud CLI,



* IBM Cloud Code Engine plugin,
* IBM Cloud® Container Registry plugin,



* a GitHub account.



You can run the sections requiring a shell in the [IBM® Cloud Shell](https://cloud.ibm.com/docs/cloud-shell?topic=cloud-shell-getting-started).
Event Source Manager Source integration with Event Notifications by using service to service authorization <br><br> * Perform service to service registration, of source<br> * View, edit, and delete sources and events<br> * Send notifications<br><br><br> 
 Event Notifications Publisher Create notification and view notifications count Send notifications and view notifications count 
 Device Manager Custom role to handle push device registration with the Event Notifications service <br><br> * View, create, edit, and delete Push Devices by using Event Notifications client SDKs. <br> *View, create, and delete Tags for Push Devices by using [Event Notifications API](https://cloud.ibm.com/apidocs/event-notifications/).<br> * View, Create, and Delete Channel Groups for Push Devices by using [Event Notifications API](https://cloud.ibm.com/apidocs/event-notifications/).<br> * View, create and delete Channels for Push Devices by using [Event Notifications APIs](https://cloud.ibm.com/apidocs/event-notifications/).<br><br><br> 



For more information about assigning user roles in the UI, see [Managing IAM access](https://cloud.ibm.com/docs/account?topic=account-assign-access-resources).





 Event Notifications access policies 

Every user who accesses the Event Notifications service in your account must be assigned an access policy with an IAM user role defined. That policy determines what actions the user can perform within the context of the service or instance you select.

The actions are customized and defined by the IBM Cloud service as operations that are permitted in the service. The actions are then mapped to IAM user roles. Some of the actions taken you can track with the Activity Tracker service. In the following table, the actions and required permissions for Event Notifications are mapped.



Table 3. Actions mapped to different roles

 Service action Display name Role Description
br> * [ibm_en_subscription_chrome](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/en_subscription_chrome)<br> * [ibm_en_subscription_email](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/en_subscription_email)<br> * [ibm_en_subscription_firefox](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/en_subscription_firefox)<br> * [ibm_en_subscription_ios](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/en_subscription_ios)<br> * [ibm_en_subscription_safari](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/en_subscription_safari)<br> * [ibm_en_subscription_slack](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/en_subscription_slack)<br> * [ibm_en_subscription_sms](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/en_subscription_sms)<br> * [ibm_en_subscription_webhook](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/en_subscription_webhook)<br> * [ibm_en_topic](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/en_topic)<br><br><br> <br><br> * [ibm_en_destination](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/en_destination)<br> * [ibm
"message_apns_headers": "{"apns-collapse-id": "13"}", "ibmenapnsheaders": "{"apns-collapse-id": "13"}","ibmenchromebody": "{"title":"Hello Chrome", "en_data":{"alert":"Hello Chrome Notification","title":"Chrome New Title","iconUrl":"https://","timeToLive":100,"payload":{"key":"value"}}}","ibmenfirefoxbody": "{"title":"Hello Firefox", "en_data":{"alert":"Hello Firefox Notification","title":"Firefox New Title","iconUrl":"https://","timeToLive":100,"payload":{"key":"value"}}}","ibmenfirefoxheaders": "{"TTL":100}","ibmenchromeheaders":"{"TTL":100}" ,"ibmenpushto": "{"platforms":"push_ios"]!!}","datacontenttype" : "application/json", "data": {"author": {"account_id": "dgduyeiueiinchdidkuedfrr","email": "testuser@gmail.com","id": "IBMid-76893","kind": "user" },"create_time": "2022-02-28T13:28:14.043755123Z","create_timestamp": 1646054894,"issuer": "IBM Cloud Security and Compliance Center","issuer_url": "https://cloud.ibm.com/security-compliance","long_description": "Success Your Event Notifications instance is configured with IBM Cloud Security and Compliance Center."
Go etcd/client [Link](https://github.com/etcd-io/etcd/tree/master/client) 
 Python python-etcd [Link](https://python-etcd.readthedocs.io/en/latest/) 







 Connecting without a Driver 

For languages that do not have gRPC support etcd v3 provides a JSON gRPC gateway that converts HTTP/JSON requests into gRPC messages. For example, you can check the cluster health by using cURL.

curl https://35dae549-2275-4d3e-beed-d86f36022336.974550db55eb4ec0983f023940bf637f.databases.appdomain.cloud:32460/{version}/cluster/member/list --cacert c5f02736-d94c-11e8-a2e9-62ec2ed68f84 -X POST -d '{"name": "ibm_cloud_59699685_b95e_4afe_9d39_7464c228563c", "password": "$PASSWORD"}'

The version path parameter depends on the minor version of etcd running on your deployment. You can find the minor version on your [deployment's Overview page](https://cloud.ibm.com/docs/databases-for-etcd?topic=databases-for-etcd-dashboard-overview). If you are running etcd 3.2, use v3alpha in the endpoint. If you are running etcd 3.3, use v3beta in the endpoint. Version information and example commands are in the [etcd documentation](https://etcd.io/docs/v3.4.0/dev-guide/api_grpc_gateway/).
hostname=os.environ["ENG_HOST"]
portnumber=os.environ["ENG_PORT"]
cert_location='./ibm-lh-client/localstorage/volumes/infra/tls/aliases/' + hostname + ':' +
portnumber + '.crt'
with prestodb.dbapi.connect(
host=hostname,
port=portnumber,
user=username,
catalog='tpch',
schema='tiny',
http_scheme='https',
auth=prestodb.auth.BasicAuthentication(username,password)
) as conn:
conn._http_session.verify = cert_location
cur = conn.cursor()
cur.execute('select * from tpch.tiny.customer limit 10')
rows = cur.fetchall()
print(rows)
Show more

The command queries the system.runtime.nodes system tables that show the nodes in the Presto cluster. The DBAPI implementation in prestodb.dbapi provides methods to retrieve few rows. For example, Cursorfetchone() or Cursor.fetchmany(). By default Cursor.fetchmany() fetches one row. Set prestodb.dbapi.Cursor.arraysize accordingly.
3. Compile and run the command.
7141069422592.0,
1435935780
],

null,
1435935795
],

null,
1435935810
],
...

null,
1435936065
]
]
}
]
}
Show more





 kv_emits 

See an example of a kv_emits monitoring request:

curl "https://$ACCOUNT.cloudant.com/_api/v2/monitoring/kv_emits?cluster=myclustername&format=json"

See example results (abbreviated) from a kv_emits monitoring request:

{
"start": 1436194248,
"end": 1436194548,
"target_responses": [
{
"target": "myclustername Key:value pairs emitted per second from map functions",
"datapoints":

0.0,
1436194230
],

0.0,
1436194245
],

0.8000000000001819,
1436194260
],
...

null,
1436194515
]
]
}
]
}
Show more





 map_doc 

See an example of a map_doc monitoring request:

curl "https://$ACCOUNT.cloudant.com/_api/v2/monitoring/map_doc?cluster=myclustername&format=json"

See example results (abbreviated) from a map_doc monitoring request:

{
"start": 1436194475,
"end": 1436194775,
"target_responses": [
{
"target": "myclustername Documents per second through map functions",
"datapoints":

0.0,
1436194480
],

0.5,
1436194495
],
Working with the time series library 

To get started working with the time series library, import the library to your Python notebook or application:

 Import the package
import sparktspy as tspy



 Creating a time series 

To create a time series and use the library functions, you must decide on the data source. Supported data sources include:



* In-memory lists
* pandas DataFrames
* In-memory collections of observations (using the ObservationCollection construct)
* User-defined readers (using the TimeSeriesReader construct)



The following example shows ingesting data from an in-memory list:

ts = tspy.time_series([5.0, 2.0, 4.0, 6.0, 6.0, 7.0])
ts

The output is as follows:

TimeStamp: 0 Value: 5.0
TimeStamp: 1 Value: 2.0
TimeStamp: 2 Value: 4.0
TimeStamp: 3 Value: 6.0
TimeStamp: 4 Value: 6.0
TimeStamp: 5 Value: 7.0

You can also operate on many time-series at the same time by using the MultiTimeSeries construct. A MultiTimeSeries is essentially a dictionary of time series, where each time series has its own unique key. The time series are not aligned in time.

The MultiTimeSeries construct provides similar methods for transforming and ingesting as the single time series construct:

mts = tspy.multi_time_series({
"ts1": tspy.time_series([1.0, 2.0, 3.0]),
"ts2": tspy.time_series([5.0, 2.0, 4.0, 5.0])
})

The output is the following:

ts2 time series
------------------------------
TimeStamp: 0 Value: 5.0
TimeStamp: 1 Value: 2.0
TimeStamp: 2 Value: 4.0
* [Firefox Push Notifications](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-push-firefox)
* [Safari Push Notifications](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-push-safari)
* [Huawei Push Notifications](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-push-huawei)



* [IBM Cloud SMS](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-destinations-sms)
* [Slack](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-destinations-slack)
* [Microsoft® Teams](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-destinations-msteams)
* [ServiceNow](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-destinations-servicenow)







 Service destinations 

Service destinations are cloud services or applications where notifications are consumed programmatically. The following service destinations are supported:



* [Webhook](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-destinations-webhook)
* [IBM Cloud Functions](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-destinations-cloud-functions)
* [IBM Cloud Object Storage](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-destinations-cloud-object-storage)
Navigate to the [Observability](https://cloud.ibm.com/observe) page and click Logging, look for the existing log analysis service in the region with Platform logs enabled.
2. Click Open dashboard.
3. In a few minutes you should see the logs associated with the program



Search for host:ibmanalyticsengine. There will be a lot of output. Look for:

Michael,: 1
29: 1
Andy,: 1
30: 1
Justin,: 1
19: 1

On your laptop create the following file with the name hello.py:

hello.py:

def main():
print("hello world")

if __name__ == '__main__':
main()

Then upload hello.py to your bucket ABC-log-analysis



1. Access the Object Storage service instance from the [Resource List](https://cloud.ibm.com/resources) Under Storage.
2. Under Buckets, select your bucket.
3. Drag and drop hello.py into the bucket.



To run the hello.py application just uploaded to the bucket locate the HMAC credentials associated with the Object Storage instance created earlier. Click on the Service credentials tab and open the cos-for-log-analysis credentials. Create corresponding shell variables for the cos_hmac_keys and your bucket name. Learn more about the service variable in the [stocator](https://github.com/CODAIT/stocatorstocator-and-ibm-cloud-object-storage-ibm-cos) project.

Click Buckets on the left, and select your bucket. Open the Configuration tag and scroll down to the Endpoints section and notice the Direct endpoint. Fill in these shell variables. Something like the following:

 GUID= set earlier
service=hello
access_key_id="0012345678901234567899550cfa9a60"
ce-ibmenapnsbody: {"en_data":{"alert":"alert","url":"https","badge":9,"sound":"bingbong.aiff","payload":{"myaarray":["cc75e4a6-edd8-3bec-a7c3-dfca6572a03b"]},"type":"DEFAULT","subtitle":"dummy","title":"dummy1","body":"body","ios_action_key":"key","interactive_category":"interactiveCategory","title_loc_key":"titleLocKey","loc_key":"GAME_PLAY_REQUEST_FORMAT","launch_image":"image.png","title_loc_args":["Shelly","Rick"],"loc_args":["Shelly","Rick"],"attachment_url":"some url","apns_collapse_id":"12","apns_thread_id":"1","apns_group_summary_arg":"apnsGroupSummaryArg","apns_group_summary_arg_count":1}}

To customize your APNs push notifications, you can provide APNs headers. Some of them are mandatory to deliver a notification if key is present. The required body as follows:

"ibmenapnsheaders": "{"apns-priority":10, "apns-collapse-id": "collapse"}"

To get more details on APNs headers, you can check out [here](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns/).





 ibmenchromebody(string/json) 

This attribute is needed if you want to send push notification to a chrome device.
[Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) 
 channel_transfer ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) !
: Displays a video that is specified by a URL.





 Channel integration support for response types 

The following table indicates which channel integrations support each type. For additional information about any channel-specific limitations, see [Response types reference](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-response-types-reference).



Channel integration support

 Response type Web chat Phone SMS Slack Facebook WhatsApp 

 audio ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) !
An embeddable URL is one that can be specified as the value of the src attribute of the iframe element.

For example, to embed an interactive map using Google Maps, you can use the Google Maps Embed API. (For more information, see [The Maps Embed API overview](https://developers.google.com/maps/documentation/embed/get-started).) Other sites have different processes for creating embeddable content.

For technical details about using Content-Security-Policy: frame-src to allow embedding of your website content, see [CSP: frame-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-src).





 Example 

This example embeds an iframe with a title and description.

{
"generic":[
{
"response_type": "iframe",
"source": "https://example.com/embeddable/example",
"title": "Example iframe",
"description": "An example of embeddable content returned as an iframe response."
}
]
}







 image 

Displays an image specified by a URL.



 Integration channel support 



 Web chat SMS Slack Facebook WhatsApp 

 ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) !