vania-janet/multiturn-rag-retrieval-data huggingface dataset:
{ "Key": "deletetest/testfile2.txt" },
{ "Key": "deletetest/testfile3.txt" },
{ "Key": "deletetest/testfile4.txt" },
{ "Key": "deletetest/testfile5.txt" }
]
}

response = cos.delete_objects(
Bucket=bucket_name,
Delete=delete_request
)

print("Deleted items for {0}n".format(bucket_name))
print(json.dumps(response.get("Deleted"), indent=4))
except ClientError as be:
print("CLIENT ERROR: {0}n".format(be))
except Exception as e:
print("Unable to copy item: {0}".format(e))
Show more

SDK References



* Classes



* [S3.Client](https://ibm.github.io/ibm-cos-sdk-python/reference/services/s3.htmlclient)



* Methods



* [delete_objects](https://ibm.github.io/ibm-cos-sdk-python/reference/services/s3.htmlS3.Client.delete_objects)









 Delete a bucket 

def delete_bucket(bucket_name):
print("Deleting bucket: {0}".format(bucket_name))
try:
cos.Bucket(bucket_name).delete()
print("Bucket: {0} deleted!".format(bucket_name))
except ClientError as be:
print("CLIENT ERROR: {0}n".format(be))
except Exception as e:
print("Unable to delete bucket: {0}".format(e))

SDK References



* Classes
If you configured a tool integration when you created a toolchain, you can update the configuration settings with the API.



1. [Obtain an IAM bearer token](https://cloud.ibm.com/apidocs/toolchainauthentication). Alternatively, if you are using an SDK, [obtain an IAM API key](https://cloud.ibm.com/iam/apikeys) and set the client options by using environment variables.

export CD_TOOLCHAIN_AUTH_TYPE=iam && export CD_TOOLCHAIN_APIKEY={iam_api_key} && export CD_TOOLCHAIN_URL={base_url}
2. [Look up the ID of the toolchain](https://cloud.ibm.com/apidocs/toolchainlist-toolchains) where the tool integration exists.
3. Using the ID of the toolchain, [look up the ID of the tool integration](https://cloud.ibm.com/apidocs/toolchainlist-tools).
4. Update the tool integration within the targeted toolchain.



* Curl
* Java
* Node
* Python
* Go



curl -X PATCH --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/merge-patch+json" --data '{ "name": "{new_tool_name}", "parameters": {new_tool_parameters} }' "{base_url}/toolchains/{toolchain_id}/tools/{tool_id}"

import com.ibm.cloud.continuous_delivery.cd_toolchain.v2.CdToolchain;
import com.ibm.cloud.continuous_delivery.cd_toolchain.v2.model.;
...
CdToolchain toolchainService = CdToolchain.newInstance();
See [Retrieving service endpoints](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-retrieve-endpoints-serverless).

To use the IBM Analytics Engine Go SDK, you need the following values:



* IAM_API_KEY: The API key generated when creating the service credentials. You can retrieve by viewing the service credentials on the [IBM Cloud dashboard](https://cloud.ibm.com/resources).
* instance_guid: The value in resource_instance_id generated when the service credentials are created. You can retrieve by viewing the service credentials on the [IBM Cloud dashboard](https://cloud.ibm.com/resources).
* IAE_ENDPOINT_URL : The service endpoint URL including the https:// protocol. See [Service endpoints](https://cloud.ibm.com/apidocs/ibm-analytics-engine-v3?code=javaservice-endpoints).







 Initializing the configuration 

The Go SDK allows you to construct the service client in one of two ways by:



* By setting client options programmatically

You can construct an instance of the IBM Analytics Engine service client by specifying various client options, like the authenticator and service endpoint URL, programmatically:

package main

import (
"fmt"
"github.com/IBM/go-sdk-core/v3/core"
"github.com/IBM/ibm-iae-go-sdk/ibmanalyticsengineapiv3"
)

func main() {
// Create an IAM authenticator.
authenticator := &core.IamAuthenticator{
ApiKey: "{apikey}", // eg "0viPHOY7LbLNa9eLftrtHPpTjoGv6hbLD1QalRXikliJ"
URL: "{api auth url}", // "https://iam.cloud.ibm.com/identity/token"
}
Retrieving action logs with Schematics API 



1. To retrieve the logs for an action, such as generate a plan, apply a plan, and destroy resources using IBM Cloud® Schematics Python APIs, create a Python file and provide a name of your choice, for example, schematics_logs_api.py.
2. Copy and paste the [Retrieve Schematics workspace action details using Python API](https://cloud.ibm.com/docs/ibm-spectrum-lsf?topic=ibm-spectrum-lsf-retrieve-action-logsexample-request-retrieve-action-logs) example request into your Python file.
3. Change the following parameters as part of the request:



* Replace the authenticator = IAMAuthenticator('<ibm-api-key>') variable with your IBM Cloud API key.
* Change the API endpoint to the endpoint mentioned in this link according to the location where you want your Schematics workspace to reside, for example, schematics_service.set_service_url('https://us.schematics.cloud.ibm.com').



4. Inside the schematics_service.get_workspace_activity function, provide the following parameters:



* Provide the workspace ID that you generated in the [Creating a workspace](https://cloud.ibm.com/docs/ibm-spectrum-lsf?topic=ibm-spectrum-lsf-creating-workspace) task, for example, us-south.workspace.Terraform-Schematics-Python-Workspace.b3bbc9f5.
* Provide an activity ID that was generated as a successful response for the specific action for which you want to retrieve logs. You received an activity ID when you successfully completed the action in the Schematics workspace.



5. Run the Python script by using python3 <python-file-name> to retrieve the logs for an action for your Schematics workspace in the IBM Cloud.
6. You get an action ID, name, and action status, such as COMPLETED or FAILED, in response when it is determined whether the parameters passed as part of the request are valid.
To access the Watson Assistant REST APIs, your application needs to be able to authenticate with IBM Cloud® and connect to the assistant in the environment where it is deployed. You'll need to copy the service credentials and environment ID and paste them into your application code. You'll also need the URL for the location of your service instance (for example, https://api.us-south.assistant.watson.cloud.ibm.com).

To find this information, follow these steps:



1. Go to the Environments page and click the tab for the environment you want to connect to.
2. Click the ![Environment settings icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/gear-icon-black.png) icon to open the environment settings.
3. Select API details to see details for the environment, including the service instance URL and environment ID. To find the API key, follow the link in the Service credentials section.







 Communicating with the Watson Assistant service 

Interacting with the Watson Assistant service from your client application is simple. We'll start with an example that connects to the service, sends a single empty message, and prints the output to the console:



* Python
* Node



 Example 1: Creates service object, sends initial message, and
 receives response.

from ibm_watson import AssistantV2
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

 Create Assistant service object.
authenticator = IAMAuthenticator('{apikey}') replace with API key
assistant = AssistantV2(
version = '2021-11-27',
authenticator = authenticator
)
assistant.set_service_url('{url}') replace with service instance URL
assistant_id = '{environment_id}' replace with environment ID

 Start conversation with empty message.
result = assistant.message_stateless(
assistant_id,
).get_result()
If you want to update multiple values at the same time, follow the steps for [Updating variables with Schematics API](https://cloud.ibm.com/docs/hpc-slurm?topic=hpc-slurm-update-variables&interface=api).





 Example Python request 

 Create a Schematics workspace using Python API

import json, logging

from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_schematics.schematics_v1 import SchematicsV1

logging.basicConfig()
logging.root.setLevel(logging.NOTSET)
logging.basicConfig(level=logging.NOTSET)

authenticator = IAMAuthenticator('<ibmcloud-api-key>')

schematics_service = SchematicsV1(authenticator = authenticator)

schematics_service.set_service_url('https://us.schematics.cloud.ibm.com')

template_source_data_request_model = {}
template_source_data_request_model['env_values'] = [
{
"name": "TF_CLI_ARGS_plan",
"value": "-parallelism=250",
},
{
"name": "TF_CLI_ARGS_apply",
"value": "-parallelism=250"
}
]
template_source_data_request_model['folder'] = ''
template_source_data_request_model['type'] = 'terraform_v0.14'
template_source_data_request_model['variablestore'] = [
{
"name": "ssh_key_name",
"value": "hpcc-slurm-key",
},
{
"name": "resource_group",
"value": "Default"
}]

template_repo_request_model = {}
Once the SDK is initialized, the appConfigClient can be obtained across other modules as shown below:

// other modules

const { AppConfiguration } = require('ibm-appconfiguration-node-sdk');
const appConfigClient = AppConfiguration.getInstance();

feature = appConfigClient.getFeature('online-check-in');
const enabled = feature.isEnabled();
const featureValue = feature.getCurrentValue(entityId, entityAttributes)





 Supported data types 

You can configure feature flags and properties with App Configuration, supporting the following data types: Boolean, Numeric, SecretRef, and String. The String data type can be in the format of a text string, JSON, or YAML. The SDK processes each format as shown in the table.



Table 1. Example outputs

 Feature or Property value Data type Data format Type of data returned by getCurrentValue().value Example output 

 true BOOLEAN not applicable boolean true 
 25 NUMERIC not applicable number 25 
 a string text STRING TEXT string a string text 
 {"firefox": { <br>"name": "Firefox", <br>"pref_url": "about:config" <br>}} STRING JSON JSONObject {"firefox":{"name":"Firefox","pref_url":"about:config"}} 
 men: <br>- John Smith <br>- Bill Jones <br>women: <br>- Mary Smith <br>- Susan Williams STRING YAML java.lang.String `"men:<br><br><br><br> * John Smith<br> * Bill Jones\women:<br> * Mary Smith<br> * Susan Williams"`<br><br><br>
For information about IBM Cloud security, see the [IBM Cloud Service Description](https://www.ibm.com/software/sla/sladb.nsf/searchsaas/?searchview&searchorder=4&searchmax=0&query=%28IBM+Cloud+Service+description%29)

US Health Insurance Portability and Accountability Act (HIPAA) support is available for Premium plans in the Washington, DC location created on or after 1 April 2019. See [Enabling EU and HIPAA supported settings](https://cloud.ibm.com/docs/account?topic=account-eu-hipaa-supportedeu-hipaa-supported) for more information.



 Browser support and prerequisites 

For the list of IBM Cloud® prerequisites and supported browsers, see [Prerequisites](https://cloud.ibm.com/docs/overview?topic=overview-prereqs-platform).





 Discovery tooling 

Discovery includes a complete set of online tools - the Discovery tooling - to help you quickly setup an instance of the service and populate it with data.

The Discovery tooling is designed to save time by eliminating the need to use APIs to configure and populate your service. This lets your application developers concentrate on creating high value ways for end users to experience Discovery. See [Getting started with the tooling](https://cloud.ibm.com/docs/discovery?topic=discovery-getting-started) for an introduction to the Discovery tooling.





 Next steps 



* Get started with either the Discovery tooling or the Discovery API:



* [Getting started with the Discovery tooling](https://cloud.ibm.com/docs/discovery?topic=discovery-getting-started)
* [Getting started with the Discovery API](https://cloud.ibm.com/docs/discovery?topic=discovery-gs-api)



* Discovery supports a number of SDKs to simplify the development of applications. The SDKs are available for many popular programming languages and platforms, including Node.js, Java, and Python.
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

logging.basicConfig()
logging.root.setLevel(logging.NOTSET)
logging.basicConfig(level=logging.NOTSET)

authenticator = IAMAuthenticator('<ibmcloud-api-key>')

schematics_service = SchematicsV1(authenticator = authenticator)

schematics_service.set_service_url('https://us.schematics.cloud.ibm.com')

logging.info("Started Deleting Schematic Workspace")

workspace_delete_response = schematics_service.delete_workspace(
    w_id='<workspace id>',
    refresh_token='<refresh-token>',
    destroy_resources= True,
).get_result()

print(json.dumps(workspace_delete_response, indent=2))

logging.info("Completed Deleting Schematic Workspace")





 Example Python response 

INFO:root:Started Deleting Schematic Workspace
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): iam.cloud.ibm.com:443
DEBUG:urllib3.connectionpool:https://iam.cloud.ibm.com:443 "POST /identity/token HTTP/1.1" 200 987
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): us.schematics.cloud.ibm.com:443
DEBUG:urllib3.connectionpool:https://us.schematics.cloud.ibm.com:443 "DELETE /v1/workspaces/us-south.workspace.Schematic-Sunil-Test-Workspace.5a4cbf11?destroy_resources=true HTTP/1.1" 200 2
""
INFO:root:Completed Deleting Schematic Workspace
The new domain controllers would have the Additional Domain controller role while the existing domain controllers would have the primary domain controller role. For more information, see [Understanding AD site topology](https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/understanding-active-directory-site-topology). The following diagram shows the Active Directory Domain Services topology for this extended domain with AD sites model.

Zoom

![Extend domain with AD sites diagram](https://cloud.ibm.com/docs-content/v1/content/5bdb37c0149145723c5437e8176651928565e722/vmwaresolutions/images/adds-extenddomainwithsites.svg)

Figure 4. Extend domain with AD sites diagram

The IBM Cloud for VMware Solutions infrastructure domain is used for the user credentials and service accounts of your system administrators and the resource objects for the underlay-connected infrastructure components only. The existing forest can be linked to the IBM Cloud for VMware Solutions forest with the use of trusts if required.





 Extended domain model 

This extended domain model is the simplest model. With this model, you can seamlessly set up and use IBM Cloud in a hybrid scenario with the least impact to the applications. Layer 2 network connectivity is required between your data center and IBM and is, therefore, an ideal model for VMware® HCX. This model allows for the existing domain controllers to remain initially on-premises and these domain controllers are accessible by using the stretched layer 2 network from the migrated VMs. Domain and DNS configuration in the migrated VMs does not need to change for the migration. At the required time, the domain controllers can be migrated to the vCenter Server instance with no change.

Depending on the complexity of the Active Directory Domain Services, when the layer 2 network extension is removed, more Active Directory Domain Services tasks might need to be completed if the complete forest domain is not moved to IBM Cloud. The use of AD sites can help with the control of replication traffic across the layer 3 network between on-premises and IBM Cloud. See to the extended domain with AD sites model described in the previous section.
1. Select sites: on-premises and vCloud Organization, click Continue.
2. Select Source Compute Profile.
3. Select Remote Compute Profile. For example, CloudCompute.
4. Select All Services, click Continue.
5. Click Continue, on page Advanced Configuration - Override Uplink Network profiles (Optional)
6. Click Continue.
7. Click Continue, leave default on page Advanced Configuration - Configure WAN Optimization Service Bandwidth Limit.
8. Provide Service Name, click Finish.



6. Watch the task list for Service Mesh creation. After successful completion, the on-premises location has three HCX appliances and the cloud location has three HCX appliances.





 Results 

An HCX Service Mesh is the effective HCX services configuration for a source and destination site. A Service Mesh can be added to a connected Site Pair with a valid Compute Profile created on both sites.

Adding a Service Mesh initiates the deployment of HCX Interconnect virtual appliances on both of the sites. An interconnect Service Mesh is always created at the source site.







 Network stretching 

To stretch a network (VLAN or VXLAN) with HCX, complete the following steps from the client-side vCenter web user interface.



1. Log in to the vSphere Web Client.
2. From the Home menu, select the HCX option.
3. In the left menu, under Services, click Network Extension.
4. Click Extend Network:



1. Select the network to be extended.
2. Type the current default gateway and subnet mask in CIDR format.
3. Scroll down and click Stretch to begin the network stretch workflow.





Network progress is monitored in the vCenter client tasks pane.





 Concepts and best practices for network stretching 

The glue that bridges the client-side network to the cloud side VXLAN is a sophisticated multitunnel VPN that consists of proprietary HCX technology. It is not based on NSX, but does work with NSX and extend its capability.
Integration variables 

By writing expressions, you can access integration variables, which are context variables that are specific to integrations (such as the web chat and phone integrations). All integration variables are contained in the system_integrations JSON object, which you can access using the following expression:

${system_integrations}

The system_integrations object has the following structure:

{
"channel": {
"name": "{channel_name}",
"private": {
"user": {
"id": "{user_id}",
"phone_number": "{phone_number}",
"name": "{name}"
}
}
},
"chat": {...},
"voice_telephony": {...},
"text_messaging": {...},
"whatsapp": {...},
"slack": {...},
"facebook": {...},
"teams": {...}
}
Show more



 channel 

Always included. This object contains general information about the channel that is being used to communicate with the assistant.



 Properties 

Properties contained in the private object are treated as private variables, which are not included in logs.



Properties of the channel object

 Name Type Description 

 channel.name String The name of the channel that is in use. One of the following values:<br><br><br><br> * Web chat<br> * Phone<br> * SMS<br> * Whatsapp<br> * Slack<br> * Facebook Messenger<br><br><br> 
 channel.private.user.id String The ID of the user who is interacting with the assistant through the channel. This ID is specific to the channel and might be different from the user ID Watson Assistant uses for billing purposes.
[Architecture](https://cloud.ibm.com/docs-content/v1/content/f84e2238288b7f0355715a4c355609ce7ac48fb0/solution-tutorials/images/solution36-configuring-IPSEC-VPN/sec-priv-vpn.png)

Figure 1. Architecture diagram of the tutorial



1. Document VPN Configuration
2. Create IPSec VPN on a VRA
3. Configuration of data center VPN and tunnel
4. Create GRE tunnel
5. Create static IP route
6. Configure firewall







 Before you begin 

This tutorial connects the secure private enclosure in the [Isolate workloads with a secure private network](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-secure-network-enclosuresecure-network-enclosure) tutorial to your data center. That tutorial must be completed first.





 Step 1: Document VPN configuration 

Configuring an IPSec VPN site-to-site link between your data center and IBM Cloud requires coordination with your onsite networking team to determine many of the configuration parameters, the type of tunnel and IP routing information. The parameters have to be in exact accordance for an operational VPN connection. Typically your onsite networking team will specify the configuration to match agreed corporate standards and provide you with the necessary IP address of the data center VPN gateway, and the subnet address ranges that can be accessed.

Before commencing setup of the VPN, the IP addresses of the VPN gateways and IP network subnet ranges must be determined and available for the data center VPN configuration and for the secure private network enclosure in the IBM Cloud. These are illustrated in the following figure, where the APP zone in the secure enclosure will be connected via the IPSec tunnel to systems in the ‘DC IP Subnet’ in the client data center.

Zoom

!
namespace: <ingress_resource_namespace>
data:
auth_logging: <true|false>
 Log all authentication attempts.
auth_logging_format:
 Format for authentication logs. For more info, see https://oauth2-proxy.github.io/oauth2-proxy/configurationauth-log-format
cookie_csrf_expire: "15m"
 Expiration timeframe for CSRF cookie. Default is "15m".
cookie_csrf_per_request: <true|false>
 Enable multiple CSRF cookies per request, making it possible to have parallel requests. Default is "false".
cookie_domains:
 A list of optional domains to force cookies to. The longest domain that matches the request’s host is used. If there is no match for the request’s host, the shortest domain is used. Example: sub.domain.com,example.com
cookie_expire: "168h0m0s"
 Expiration timeframe for cookies. Default: "168h0m0s".
cookie_samesite: ""
 SameSite attribute for cookies. Supported values: "lax", "strict", "none", or "".
email_domains: ""
 Authenticate IDs that use the specified email domain. To authenticate IDs that use any email domain, use "". Default: "". Example: example.com,example2.com
pass_access_token: <true|false>
 Pass the OAuth access token to the backend app via the X-Forwarded-Access-Token header.
request_logging: <true|false>
 Log all requests to the backend app.
request_logging_format:
 Format for request logs. For more info, see https://oauth2-proxy.github.io/oauth2-proxy/configurationrequest-log-format
scope:
 Scope of the OAuth authentication.
[Architecture](https://cloud.ibm.com/docs-content/v1/content/01ccb31b85637ed5f03008c920c9596354caaf98/virtual-router-appliance/includes/solution-tutorials/includes/solution-tutorials/images/solution36-configuring-IPSEC-VPN/sec-priv-vpn.png)

Figure 1. Architecture diagram of the tutorial



1. Document VPN Configuration
2. Create IPSec VPN on a VRA
3. Configuration of data center VPN and tunnel
4. Create GRE tunnel
5. Create static IP route
6. Configure firewall







 Before you begin 

This tutorial connects the secure private enclosure in the [Isolate workloads with a secure private network](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-secure-network-enclosuresecure-network-enclosure) tutorial to your data center. That tutorial must be completed first.





 Step 1: Document VPN configuration 

Configuring an IPSec VPN site-to-site link between your data center and IBM Cloud requires coordination with your onsite networking team to determine many of the configuration parameters, the type of tunnel and IP routing information. The parameters have to be in exact accordance for an operational VPN connection. Typically your onsite networking team will specify the configuration to match agreed corporate standards and provide you with the necessary IP address of the data center VPN gateway, and the subnet address ranges that can be accessed.

Before commencing setup of the VPN, the IP addresses of the VPN gateways and IP network subnet ranges must be determined and available for the data center VPN configuration and for the secure private network enclosure in the IBM Cloud. These are illustrated in the following figure, where the APP zone in the secure enclosure will be connected via the IPSec tunnel to systems in the ‘DC IP Subnet’ in the client data center.

Zoom

!