vania-janet/multiturn-rag-retrieval-data huggingface dataset:
[Istio](https://istio.io) is an open source service mesh that layers transparently onto existing distributed applications that can integrate with Kubernetes. To reduce the complexity of deployments, Istio provides behavioral insights and operational control over the service mesh as a whole. When App ID is combined with Istio, it becomes a scalable, integrated identity solution for multicloud architectures that does not require any custom application code changes. For more information, check out [What is Istio](https://www.ibm.com/topics/istio).

Istio uses an Envoy proxy sidecar to mediate all inbound and outbound traffic for all services in the service mesh. By using the proxy, Istio extracts information about traffic, also known as telemetry, that is sent to the Istio component called Mixer to enforce policy decisions. The App Identity and Access Adapter extends the Mixer functionality by analyzing the telemetry (attributes) against custom policies to control identity and access management into and across the service mesh. The access management policies are linked to particular Kubernetes services and can be finely tuned to specific service endpoints. For more information about policies and telemetry, see the [Istio documentation](https://istio.io/latest/docs/concepts/observability/).

Due to an Istio limitation, the App Identity and Access Adapter currently stores user session information internally and does not persist the information across replicas or over failover configurations. When you use the Adapter, limit your workloads to a single replica until the limitation is addressed.



 Protecting front-end apps 

If you're using a browser-based application, you can use the [Open ID Connect (OIDC)](https://openid.net/specs/openid-connect-core-1_0.html) / OAuth 2.0 authorization_grant flow to authenticate your users. When an unauthenticated user is detected, they are automatically redirected to the authentication page. When the authentication completes, the browser is redirected to an implicit /oidc/callback endpoint where the Adapter intercepts the request.
Select Webhooks -> Add webhook. Note that your GitHub repository might use Hooks instead of Webhooks.
3. Enter your application URL as your Payload URL.
4. Select the Content type that your application requires. If you are using the sample github app, then select application/json as your content type.
5. Optional. Add a secret to your webhook. For more information, see [Securing your webhooks](https://docs.github.com/en/webhooks-and-events/webhooks/securing-your-webhooks).
6. Select to Enable SSL Verification.
7. Select Just the push event to trigger your webhook.
8. Ensure Active is selected. You can disable your webhook without deleting it by removing the checkmark.
9. Click Add webhook.



After you finish, verify that your application is subscribed by checking the log files for the application. For more information about logs, see [Viewing logs with the CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-view-logsview-logs-cli).

ibmcloud ce app logs --name my-github-app

In the example output, look for the port that your app is listening on as well as the type of event.

my-github-app-00001-deployment-abcdabcdabc-1234/user-container:
2022/12/02 17:07:27 Listening on port 8080
2022/12/02 17:10:08 Event Type: ping
2022/12/02 17:10:08 Not a 'push' event so exit

Note that if your applications scales to zero, you might receive a message about no instances of your app running. This app has a minimum scale of 1 so it always has a running instance.





 Step 3: Test your GitHub event 

Test your webhook by triggering the event that your application expects.
(https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webhow_actions_web_work)
* [Packaging code for web actions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webpackaging_actions_web)
* [Available features of web actions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webactions_web_extra)



* [Content extensions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webextra_features)
* [Query and body parameters as input](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webquery_test)
* [Form data](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webform_data)
* [Activations that use multiple HTTP verbs](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webactions_web_options)
* [Non-JSON body and raw HTTP entity handling](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webactions_web_raw_handle)



* [Creating a web action](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webactions_web_example)



* [Web action JSON properties](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webweb_action_properties)
* [Performing an HTTP redirect by using a web action](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webhttp_redirect)
so.on('data', function(data) {
console.log('Client data:', data.toString())
});

so.on('error', function(err) {
console.log('Client error',err);
});

so.on('close', function() {
console.log('Client connection closing');
});
Show more





 Creating the TLS Server 

I have my local TLS server which is a simple Node.js application that will listen for connections, write a message on a successful connection, and then close that connection.

let fs = require('fs');
let tls = require('tls');

let server_opts = {
cert : fs.readFileSync('localServerCert.pem'),
key : fs.readFileSync('localServerKey.pem'),
// pfx : fs.readFileSync(''),
// passphrase : '',
ca : [fs.readFileSync('Nn5TJ34LyVQ_i2NOT_destCert.pem')],
rejectUnauthorized : true,
requestCert : true
}

// Create the local TLS Server with the settings defined above
let server = tls.createServer(server_opts, function(socket) {
socket.write('Successful connection message from the server');
socket.end();
});

// Set up the various event listeners for the server and log their output
server.on('error', function(err) {
console.log('Server error', err);
});

server.on('close', function() {
console.log('Server closing');
});

server.on('tlsClientError', function(err) {
For example, you might not be authenticating the request properly (401), or you might be trying to pass a parameter with a name that is already in use by the external application. Test the webhook to discover and fix these types of errors before you deploy the webhook.





 Removing a webhook 

If you decide you do not want to make a webhook call from a dialog node, open the node's Customize page, and then switch Webhooks Off.

The Parameters section and the Return variable field are removed from the dialog node editor. However, any conditional responses that were added for you or that you added yourself remain.

The Multiple conditioned responses section is editable again. You can choose to switch the feature off. If you do so, then only the first conditional response is saved as the node's only text response.

To change the external service that you call from dialog nodes, edit the webhook details defined on the Webhooks page of the Options page. If the new service expects different parameters to be passed to it, be sure to update any dialog nodes that call it.



 Calling a web action 

Typically, web actions can be run without requiring the caller to authenticate first. However, you can secure a web action that requires any callers to pass an ID with the request. For more information about how to secure a web action, see [Securing web actions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webactions_web_secure).

The following tips will help you call a Cloud Functions web action from your dialog.



1. Open the Options page for the skill, and then click Webhooks.
2. In the URL field, add the URL for the external application to which you want to send HTTP POST request callouts.

For example, to call a Cloud Functions web action, specify the URL for the public web action. For example:

https://us-south.functions.cloud.ibm.com/api/v1/web/my_org_dev/default/Hello%20World.json
Event Streams 

IBM Cloud® Functions provides a pre-installed package for publishing and consuming messages with Event Streams.



 Package entities 



Table 2. Pre-installed actions for publishing and consuming messages with Event Streams

 Package Type Description 

 /whisk.system/messaging Pre-installed package Publishing and consume messages with the native Kafka API. 
 /messaging/messageHubProduce Action Deprecated 
 /messaging/messageHubFeed Feed Reacts when messages are posted to an Event Streams instance 



The /messaging/messageHubProduce action is deprecated. To maintain optimal performance, migrate your usage of the /messaging/messageHubProduce action to use a persistent connection when data is produced to Event Streams/Kafka. The /messaging/messageHubProduce action is not available in Tokyo or Sydney regions.

To learn more about producing messages, check out the [Event Streams documentation](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-producing_messagesproducing_messages).





 Binding the /whisk.system/messaging package to your Event Streams instance 

If you're using IBM Cloud® Functions from the IBM Cloud, you can use the IBM Cloud® Functions CLI plug-in to bind a service to an action or package. If you do not bind your service, you must pass your credentials each time you use the action or package.

Before you begin

You must have an instance of Event Streams. To create an instance, see [Event Streams documentation](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-getting-started).



1. Create a /whisk.system/messaging package binding that is configured for your Event Streams account. In this example, the package name is MyEventStreamBind.

ibmcloud fn package bind /whisk.system/messaging MyEventStreamBind
2. Verify that the package binding exists.

ibmcloud fn package list

Example output

packages
/<namespace_ID>/MyEventStreamBind
3.
First, you need to create a Scripted REST API on the ServiceNow website. After the Scripted REST API is configured, you also need to create a Scripted REST API Resource. The request method needs to be set to HTTP POST. Then, you need to provide a code for the resource to run.

When you are ready with the process and have the URL for your Scripted REST API, you can start to use it on the IBM Cloud Notification distribution list page and create webhooks.

To get to know the complete ServiceNow webhook integration process, follow the instructions on the [How to Integrate Webhooks Into ServiceNow](https://community.servicenow.com/community?id=community_blog&sys_id=886d2a29dbd0dbc01dcaf3231f9619b0) blog post. This blog walks you through the steps in detail.
If you want to load the API by using a web browser, open http://localhost:4001 in your browser. For the default LoopBack (empty or hello-world) project, you see something like this:

{"started":"2016-03-07T22:24:55.322Z","uptime":35.839}





 Publishing a LoopBack application to IBM Cloud from the CLI 

To publish a LoopBack application to IBM Cloud from the command line, complete the following steps:



1. Enter the following command to ensure that you are in the Loopback project directory.



cd <loopback-project-dir>



2. Enter the following command to log in to API Connect and IBM Cloud.



apic login --server <region>.apiconnect.ibmcloud.com -u <username> -p <password>

where:



* <username> is your API Connect org ID.
* <password> is your API Connect password.





3. Press the space bar to automatically open the One time passcode browser page.
4. Click Regenerate and copy the one time passcode.
5. Back in the CLI, paste the passcode to complete your login. The following message is displayed:



Logged into <region>.apiconnect.ibmcloud.com successfully



6. Enter the following command:



apic organizations -s <region>.apiconnect.ibmcloud.com

where:



* <region> is the IBM Cloud region. For example:
* eu if you are using IBM Cloud London.
* us if you are using IBM Cloud Dallas.
* au if you are using IBM Cloud Sydney.



If you are unsure, you can locate your region by clicking !
In this tutorial, you saw how an existing REST service can be invoked through an API passthrough proxy. You started by checking the availability of the sample service through the web browser. Then you created an API proxy in API Connect, and linked the proxy to the sample service to be invoked. Finally, you tested this service with the API Connect internal testing tools.

--------------------





 Next step 

Secure your API using [rate limiting](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_rate_limit), [client ID and secret](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_secure_landing), or [securing using OAuth 2.0](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_secure_oauth_2).

Create > Manage > Secure > Socialize > Analyze
Use the following URL to view and use the interactive API docs for your Watson IoT Platform organization:

https://{orgId}.internetofthings.ibmcloud.com/docs/index.html

Tip: You can also access the interactive API docs directly from the Watson IoT Platform dashboard by selecting the menu bar help icon in the upper right corner of the window and then clicking API.

From this landing page, you can access the documentation for the available Watson IoT Platform APIs. For each call, you can use the Try it out button to run the API calls directly from the documentation.

To run the API calls directly from the documentation, you must first provide the relevant authorization credentials by completing the following steps:



1. From the API docs navigation page, click View APIs for the REST API that you want to work with.
2. On the API docs landing page, click Authorize.
3. In the Available authorizations box, set the username to the API key and the password to the authentication token. Click Authorize.
4. Close the Available authorizations box.
Important: Do not select Logout.
Exposing a SOAP service as a REST API 

Duration: 20 mins
Skill level: Beginner



 Objective 

In the API Connect V5 API Manager, create a REST API that accesses an existing SOAP Service and expose it as a REST API.





 Prerequisites 



1. Before you begin, [set up your IBM® API Connect for IBM Cloud® instance](https://cloud.ibm.com/docs/apiconnect?topic=apiconnect-tut_prereq_set_up_apic_instance).
2. Before you begin, copy the [weatherprovider.wsdl test](https://raw.githubusercontent.com/IBM-Bluemix-Docs/apiconnect/master/tutorials/weatherprovider.wsdl) file to your local file system. Click Raw and then save the page on your local system as a .wsdl file.







 Setting up a REST API definition 



1. Log in to IBM Cloud®: [https://cloud.ibm.com](https://cloud.ibm.com).
2. In the IBM Cloud Dashboard, click Cloud Foundry Services. Launch the API Connect service.
3. In API Connect, make sure the navigation panel is open. If not, click >> to open it.

![cloud-apic-dashboard.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/cloud-apic-dashboard.png)
4. Select Drafts in the navigation panel.
5. Select Add + > New API.
Integrating with a custom application 

Build your own client application as the interface between the assistant and your customers.

To use the API, you need to construct the URL to use in your requests.



1.  From the IBM Cloud Pak for Data web client, go to the details page for the provisioned instance.
2.  Copy the URL from the "Access information" section of the page. You will specify this value as the {url}.

You might want to copy the bearer token also. You will need to pass the token when you make an API call.
3.  From the launched application instance, go to the Assistants page. Click the More options menu for the assistant you want to use, and click Settings.
4.  Click API details, and then copy the assistant ID. You will specify this value as the {assistant_id}.
5.  Build a URL by using the IDs you copied. For example, the following request creates a session:

curl -H "Authorization: Bearer eyJhb<snip>yA9g" -X POST "{url}/v2/assistants/{assistant_id}/sessions?version=2020-04-01 -k"





*  For API reference documentation, see [API reference](https://cloud.ibm.com/apidocs/assistant/assistant-data-v2).
Connecting to your network by using low-level Fabric SDK APIs 

If you are interested in preserving your existing application code, or by using Fabric SDKs for languages other than Node.js, you can still connect to your network by using lower-level Fabric SDK APIs. Use the console to [download your connection profile](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appibp-console-app-profile). You can then import the endpoints of the peers and ordering nodes of your channel directly from the connection profile, or use the node endpoint information to manually add peer and orderer objects. You will also need to use your CA to [create an application identity](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appibp-console-app-identities), and then use the CA endpoint information enroll on the client side, or generate certificates using your console.

The [Fabric Node SDK](https://hyperledger.github.io/fabric-sdk-node/release-2.2/index.html) documentation provides a tutorial on how to [connect to your network using a connection profile](https://hyperledger.github.io/fabric-sdk-node/release-2.2/tutorial-commonconnectionprofile.html). The tutorial uses the CA endpoint information in your connection profile to generate keys using the SDK. You can also use your console to generate a signing certificate and private key and convert the keys into PEM format. You can then set a user context by passing your keys directly to the SDKs' [Fabric Client class](https://hyperledger.github.io/fabric-sdk-node/release-2.2/Client.html) using the following code:

fabric_client.createUser({
username: 'admin',
mspid: 'org1',
cryptoContent: {
integrationID: 'YOUR_INTEGRATION_ID',
region: 'YOUR_REGION',
serviceInstanceID: 'YOUR_SERVICE_INSTANCE',
identityToken: 'YOUR_JWT',
onLoad: function(instance) {
instance.render();
}
};
setTimeout(function(){
const t=document.createElement('script');
t.src="https://web-chat.global.assistant.watson.appdomain.cloud/loadWatsonAssistantChat.js";
document.head.appendChild(t);
});
</script>
Show more

The JSON Web Token is automatically included on each subsequent request that is sent from the web chat until it expires.
4. You can add an event that is triggered when your token expires. The event has a callback you can use to update the token and process any messages that were added to a queue to wait to be processed while the token was expired.

For example:

<script>
window.watsonAssistantChatOptions = {
integrationID: 'YOUR_INTEGRATION_ID',
region: 'YOUR_REGION',
serviceInstanceID: 'YOUR_SERVICE_INSTANCE',
identityToken: 'YOUR_JWT',
onLoad: function(instance) {
instance.on({ type: 'identityTokenExpired', handler: function(event) {
// Perform whatever actions you need to take on your system to get a new token.
return new Promise(function(resolve, reject) {
// And then pass the new JWT into the callback and the service will resume processing messages.
event.identityToken = 'YOUR NEW JWT';
resolve();
});
}});
instance.render();
}
};
setTimeout(function(){
const t=document.createElement('script');
-d '{"name":"Example Webhook","url":"https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd"}'





 Deleting a webhook using the API 

To delete a webhook by using the API, follow these steps:



1. Set up your API environment with the correct variables.
2. Store your the following variable to be used in the API command:



* crn: the full url-encoded CRN of the service instance.
* webhook_id: alert webhook identifier.



3. When all variables are initiated, delete the webhook:



curl -X DELETE https://api.cis.cloud.ibm.com/v1/:crn/alerting/destinations/webhooks/:webhook_id
-H 'content-type: application/json'
-H 'accept: application/json'
-H 'x-auth-user-token: Bearer xxxxxx'
integrationID: 'YOUR_INTEGRATION_ID',
region: 'YOUR_REGION',
serviceInstanceID: 'YOUR_SERVICE_INSTANCE',
identityToken: 'YOUR_JWT',
onLoad: function(instance) {
instance.render();
}
};
setTimeout(function(){
const t=document.createElement('script');
t.src="https://web-chat.global.assistant.watson.appdomain.cloud/loadWatsonAssistantChat.js";
document.head.appendChild(t);
});
</script>
Show more

The JSON Web Token is automatically included on each subsequent request that is sent from the web chat until it expires.
4. You can add an event that is triggered when your token expires, or (starting with web chat version 3.2.0) when no token is specified initially. The event has a callback you can use to update the token and to process any messages that were queued for processing during the time the token was expired.

For example:

<script>
window.watsonAssistantChatOptions = {
integrationID: 'YOUR_INTEGRATION_ID',
region: 'YOUR_REGION',
serviceInstanceID: 'YOUR_SERVICE_INSTANCE',
identityToken: 'YOUR_JWT',
onLoad: function(instance) {
instance.on({ type: 'identityTokenExpired', handler: function(event) {
// Perform whatever actions you need to take on your system to get a new token.
return new Promise(function(resolve, reject) {
// And then pass the new JWT into the callback and the service will resume processing messages.
event.identityToken = 'YOUR NEW JWT';
resolve();
});
}});
instance.render();
}
};
setTimeout(function(){
const t=document.createElement('script');
[External link icon](https://cloud.ibm.com/docs-content/v1/content/f02b9c9adcbb7328d95a45e105cec371d50f15eb/icons/launch-glyph.svg)](https://novnc.com/noVNC/vnc.html) in a browser.
4. Click Setting, then expand Advanced > WebSocket.
5. Check Encrypt, paste the URL API endpoint portion that you saved in Step 2 to Host:. Don't include "wss://", set Port to "443". Paste the URL's path portion that you saved in Step 2 to Path.



* Example API endpoint: us-south.iaas.cloud.ibm.com
* Example path: v1/bare_metal_servers/<bare_metal_server_id>/console?access_token=<access_token>&version=2021-05-26&generation=2



6. Click Connect.







 Connecting to a VNC console by using the API 



1. Run the following API call to connect the VNC console:

curl -X POST "$vpc_api_endpoint/v1/bare_metal_servers/$bare_metal_server_id/console_access_token?version=2020-05-26&generation=2" -H "Authorization: $token" -d '{"console_type":"vnc"}'
2. Follow Steps 2 - 6 in [Connecting to a VNC console by using the CLI](https://cloud.ibm.com/docs/vpc?topic=vpc-connect-to-ESXi-bare-metal-serversconnect-to-vnc-console-cli) to connect to the VNC console.









 Logging in to ESXi DCUI 



1. Open the ESXi DCUI in a VNC console.
2. Press F2 from the DCUI main page to access the System Customization menu.
3.
![test_api_keys_3.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/test_api_keys_3.png)







 Call your API using the Client ID and Client Secret 

The security settings can also be tested using the Explore tool. The Explore tool explicitly calls the proxy endpoint, and passes the Client ID and Client Secret keys as header values.



1. Click Explore, then click Sandbox. ![explore_1.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/explore_1.png)
2. Click the GET /current operation from the list.
3. Click Call operation to run the test. ![explore_3.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/explore_3.png)



--------------------





 Conclusion 

In this tutorial, you learned how to set the identification mechanism of your API, test changes made to your API, and call your API using the Client ID and Client Secret.

--------------------





 Next step 

Start to socialize your API by [setting up and configuring a developer portal](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_config_dev_portal).

Create > Manage > Secure > Socialize > Analyze