vania-janet/multiturn-rag-retrieval-data huggingface dataset:
In particular, you must not use functions that generate random numbers or return the current time.







 Filter functions 

Design documents with options.partitioned set to true can't contain a filters field.

Filter functions are design documents that filter the [changes feed](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-databasesget-changes). They work by applying tests to each of the objects included in the changes feed.

If any of the function tests fail, the object is "removed" or "filtered" from the feed. If the function returns a true result when applied to a change, the change remains in the feed. In other words, filter functions "remove" or "ignore" changes that you don't want to monitor.

Filter functions can also be used to modify a [replication task](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-advanced-replicationfiltered-replication-adv-repl).

Filter functions require two arguments: doc and [req](https://docs.couchdb.org/en/stable/json-structure.htmlrequest-object).

The doc argument represents the document that is tested for filtering.

The req argument includes more information about the request. With this argument, you can create filter functions that are more dynamic because they're based on multiple factors such as query parameters or the user context.

For example, you could control aspects of the filter function tests by using dynamic values that are provided as part of the HTTP request. However, in many filter function use cases, only the doc parameter is used.

See the following example design document that includes a filter function:

{
"_id":"_design/example_design_doc",
"filters": {
"example_filter": "function (doc, req) { ... }"
}
}

See the following example of a filter function:

function(doc, req){
// we need only mail documents
if (doc.type != 'mail'){
return false;
}
// we're interested only in new ones
The header includes the authentication scheme (Basic), followed by the [BASE64](https://en.wikipedia.org/wiki/Base64) encoding of a string created by concatenating:



* Your username
* The : character
* Your password



In practice, many application libraries that are used for creating HTTP requests can do this encoding for you.

For more information, see [Security scheme](https://cloud.ibm.com/apidocs/cloudantsecurity-scheme) on basic authentication.







 Authorization 

After authenticating, the next test is to decide whether you're allowed to do certain tasks. This decision is called authorization.

When you authenticate with the IBM Cloudant system, it "knows" who you are. The next question is, what tasks are you allowed to do?

You might create a complete list of all the possible tasks that you can do, for each aspect of an IBM Cloudant system, such as a database or a document. Although simple, this approach would require many lengthy lists. Keeping those lists accurate and complete is impractical.

A better approach uses the idea of "roles". The various tasks can be grouped into collections that are typical of some generic roles. For example, the task of creating or deleting a database is characteristic of someone with an administrative role. Similarly, the task of creating or updating a document is characteristic of someone with a "writing" role.

Rather than explicitly listing every task you can do, you're given one or more roles. If you have a role, then you can do all the tasks that are associated with that role.





 Roles 

The following section applies only to legacy credentials. For more information about using roles with IAM credentials, see [IBM Cloudant roles](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudantibm-cloudant-roles-ai).

IBM Cloudant has a number of roles available.
For more information, see the [CORS documentation](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-cross-origin-resource-sharing). 







 Protection against data loss or corruption 

IBM Cloudant has a number of features to help you maintain data quality and availability:



Table 2. IBM Cloudant data quality and availability features

 Feature Description 

 Redundant and durable data storage By default, IBM Cloudant saves to disk three copies of every document to three different nodes in a cluster. Saving the copies ensures that a working failover copy of your data is always available, regardless of failures. 
 Data Replication and export You can replicate your databases continuously between clusters in different data centers or Apache CouchDB. Another option is to export data from IBM Cloudant (in JSON format) to other locations or sources (such as your own data center) for added data redundancy. 







 Deleting your data in IBM Cloudant 

You can delete individual documents in the IBM Cloudant Dashboard or by using an API. Documents are not technically deleted but instead are compacted.

For more information, see [Deletion of data](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-general-data-protection-regulation-gdpr-deletion-of-data).

To delete a document, follow these steps:



1. Go to IBM Cloudant Dashboard.
2. On the Databases page, click the database that contains the documents that you want to delete.
3. Click the checkbox next to the documents that you want to delete.
4. Click Delete.



The document is selected for compaction.

For more information, see [Delete a document](https://cloud.ibm.com/apidocs/cloudantdeletedocument) in the API Reference documentation.



 Deleting IBM Cloudant instances 

You can delete a database instance in the IBM Cloudant Dashboard or by using an API.

Once an instance is deleted, all data within the database, as well as the account-level information, such as authentication data, is deleted automatically after the 7-day grace period ends.
Provide a JSON string option or specify a JSON file to read from by providing a filepath option that begins with a @, e.g. --locks=@path/to/file.json.

--mode (string)
: Set the lock mode. Allowable values: remove_previous, and remove_previous_and_delete. Use remove_previous to create a lock that clears existing locks with matching names. Use remove_previous_and_delete to also delete data from the previous version.

Allowable values are: remove_previous, remove_previous_and_delete.





 Example 

ibmcloud secrets-manager secret-locks-bulk-create --id=0b5571f7-21e6-42b7-91c5-3f5ac9793a46 --locks='[{"name": "lock-example-1", "description": "lock for consumer 1", "attributes": {"anyKey": "anyValue"}}]' --mode=remove_previous





 Example output 

Example of response body to create secret locks

{
"secret_id" : "0cf4addb-7a90-410b-a3a7-a15bbe2b7909",
"secret_group_id" : "d8371728-95c8-4c12-b2af-1af98adb9e41",
"versions" : [ {
"version_id" : "7bf3814d-58f8-4df8-9cbd-f6860e4ca973",
"version_alias" : "current",
"locks" : "lock-3", "lock-4" ],
"payload_available" : true
}, {
"version_id" : "5bf89b0c-df55-c8d5-7ad6-8816951c6784",
"version_alias" : "previous",
Virtual Private Cloud (VPC) Log Analysis

+6

Activity Tracker hosted event search,Secrets Manager,App ID,Key Protect,Hyper Protect Crypto Services,Object Storage



* 1 hour
* 2023-05-05



[Serverless web application and API with Code Engine](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-serverless-webapp)Serverless web application and API with Code Engine

In this tutorial, you will create a serverless web application using a bucket in Object Storage and implementing the application backend using IBM Cloud Code Engine and IBM Cloudant as JSON document database.

Code Engine Cloudant

+1

Object Storage



* 1 hour
* 2023-06-16



[Build a data lake using object storage](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-smart-data-lake)Build a data lake using object storage

Definitions of the term data lake vary, but in the context of this tutorial, a data lake is an approach to storing data in its native format for organizational use. To that end, you will create a data lake for your organization using Object Storage. By combining Object Storage and Data Engine, data analysts can query data where it lies using Structured Query Language (SQL). You'll also leverage the Data Engine (previously SQL Query) service in a Jupyter Notebook to conduct a simple analysis. When you're done, allow non-technical users to discover their own insights.

Object Storage Data Engine



* 1 hour
* 2023-06-14



[Accelerate delivery of static files using a CDN](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-static-files-cdn)Accelerate delivery of static files using a CDN

This tutorial walks you through how to host and serve website assets (images, videos, documents) and user generated content in a IBM Cloud Object Storage, and how to use a IBM® Content Delivery Network (CDN) for fast and secure delivery to users around the world.

Content Delivery Network (CDN) Object Storage



* 2 hours
Streaming to Cloud Object Storage by using Data Engine 

Extend your data pipeline to Cloud IBM Cloud® Object Storage to easily archive data for long-term storage or to gain insight by leveraging interactive queries or big data analytics. From the Event Streams UI, topics can be selected and linked to Cloud Object Storage buckets, with data automatically and securely streamed by using the fully managed IBM Cloud® Data Engine service. All data is stored in Parquet format, making it easy to manage and process.

Zoom

![Streaming to Cloud Object Storage by usingData Engine](https://cloud.ibm.com/docs-content/v1/content/e0c3acba1296ff980e76d5db456d53adefaabba4/EventStreams/ES_streams_landing.svg)

Figure 1. Diagram showing streaming to Cloud Object Storage by using Data Engine

The following task walks you through:



* Creating the required services.
* Setting up Cloud Object Storage landing by using Data Engine.
* Verifying that the events are stored in Object Storage.



Data Engine consumes batches of events from Kafka and stores the data as Parquet objects in the Cloud Object Storage service. The process is triggered in the background by Event Streams submitting an SQL landing statement to Data Engine.

Complete the following steps to start the streams landing.



 Step 1. Prerequisites 

Ensure that you configured the following services:



* An Event Streams instance - Standard or Enterprise plan. You must create credentials.
* A Cloud Object Storage instance with at least one bucket.
* A Data Engine instance - Standard plan.
* An IBM® Key Protect instance.



These services can also be created after you start configuring your stream landing job in the set-up wizard.

Ensure that you have the following permissions:



* Permission to create service-to-service authentication.
* Permission to create service IDs and API keys.
* Permission to write to IBM® Key Protect (to store the API key).
* Reader access role for the cluster, topic and group resources within the Event Streams service instance (or a Reader access role for the service instance as a whole).
[For example](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-referencesyntax_of_variablevalue) 
 secure Optional Set the secure parameter to true. By default, this parameter is set to false. 
 val1 Optional In the payload you can provide an environment variable that can execute in your workspace during plan, apply or destroy stage. Also values are encrypted and stored in COS. 



IBM Cloud Schematics supports setting up environment variable such as TF_PARALLELISM, TF_LOG. For more information about the list of environment variable and its usage, see [List of environment variables](https://cloud.ibm.com/docs/schematics?topic=schematics-set-parallelismlist-special-env-vars).

Example

ibmcloud schematics workspace new --file example.json







 ibmcloud schematics refresh 

Perform an IBM Cloud refresh action against your workspace. A refresh action validates the IBM Cloud resources in your account against the state that is stored in the Terraform state file of your workspace. If differences are found, the Terraform state file is updated accordingly.

Syntax

ibmcloud schematics refresh --id WORKSPACE_ID [--output OUTPUT]

Command options



Schematics refresh flags

 Flag Required / Optional Description 

 --id or -i Required The unique identifier of the workspace that you want to refresh and run an action against. To find the ID of a workspace, run ibmcloud schematics workspace list command. 
 --output or -o Optional Returns the command-line output in JSON format. Currently only JSON file format is supported. 
 --json or -j Deprecated Prints the output in the JSON format. 



Example

ibmcloud schematics refresh --id myworkspace-a1aa1a1a-a11a-11





 ibmcloud schematics state list
brand: 'Salter',
name: 'Digital Kitchen Scales',
description: 'Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green',
price: 14.99,
image: 'assets/img/0gmsnghhew.jpg'
};

service.postDocument({
db: 'products',
document: productsDoc
}).then(response => {
console.log(response.result);
});

The previous Go example requires the following import block:

import (
"encoding/json"
"fmt"
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/go-sdk-core/v5/core"
)

All Go examples require the service object to be initialized. For more information, see the API documentation's [Authentication section](https://cloud.ibm.com/apidocs/cloudant?code=goauthentication-with-external-configuration) for examples.

See an example of JSON data that contains an updated document:

{
"id": "exampleid",
"ok": true,
"rev": "2-056f5f44046ecafc08a2bc2b9c229e20"
}

Recall that for a partitioned database the $DOCUMENT_ID is formed from a partition key part and a document key part.

The response contains the ID and the new revision of the document, or an error message if the update failed.

See an example response after a successful update:

{
"id": "exampleid",
"ok": true,
"rev": "2-056f5f44046ecafc08a2bc2b9c229e20"
}
: The base64-encoded data to send to the destination; for example, Q29kZSBFbmdpbmU=. If you specify the --data-base64 option, do not use the --data option. This value is optional.

--destination, -d
: The name of the application or job resource that you want to receive events; for example, myapp. If needed, use the --path option to further qualify an app destination. This value is optional.

--destination-type, --dt
: The type of the destination. Valid values are app and job. This value is optional.

--extension, --ext
: Set CloudEvents extensions to send to the destination. Must be in NAME=VALUE format. This action adds a new CloudEvents extension or overrides an existing CloudEvent attribute. Specify one extension per --extension option; for example, --ext extA=A --ext extB=B. This value is optional.

--extension-rm, --ext-rm
: Remove CloudEvents extensions to send to the destination by specifying the name of the key. Specify one extension per --ext-rm option; for example, --ext-rm extA --ext-rm extB. This value is optional.

--output, -o
: Specifies the format of the command output. Valid values are json, yaml, jsonpath=JSONPATH_EXPRESSION, and jsonpath-as-json=JSONPATH_EXPRESSION. Use jsonpath to specify the path to an element of the JSON output. This value is optional.

--path
: The path within the destination application where events are forwarded; for example, /events. The default path is the root URL of the destination application. This option can only be specified if destination-type is app. This value is optional.

--quiet, -q
: Specify this option to reduce the output of the command. This value is optional. The default value is false.
The old style credential uses the format <RANDOM_ID>-bluemix for username, which matches your IBM Cloudant instance URL. The new style credentials use apikey-v2-<RANDOM_ID>.



 Objectives 



1. Update your applications to use the new style credentials in place of the instance URL style credentials.
2. Revoke access to the old style IBM Cloudant legacy credential.







 Step 1: Generating new IBM Cloudant legacy credentials 



1. Use the IBM Cloud Dashboard or the IBM Cloud CLI to [generate new service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudantcreating-service-credentials) for your IBM Cloudant instance. See [Creating service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-revoke-instance-url-style-credentialcreating-service-credentials) for further instructions.







 Step 2: Updating applications 



1. Update all applications that have access to the IBM Cloudant instance to use the new username and password combination.







 Step 3: Revoking access to the instance URL style credential 

This operation cannot be undone. Make sure all your applications are no longer using the old style credential before you start this procedure.



1. Go to [IBM Cloud](https://cloud.ibm.com/resources).
2. Find your IBM Cloudant instance on the list of resources and open it.

Zoom

![Select your instance from the list of instances in your resource list.](https://cloud.ibm.com/docs-content/v1/content/522c6f62358b063f921283400a601c3f9bc66f08/Cloudant/tutorials/images/img0011.png)

Figure 1. IBM Cloudant instances in resource list
3. Click the Revoke button under the Cloudant credentials status section.
By default, an IBM Cloudant Query index is global (for example, not partitioned) but on a partitioned database, a partitioned index can be created by adding partitioned: true when the index is created: e To create a partitioned index on firstname and surname, the POST /<dbname>/_index is used:

{
"index": {
"fields": ["firstname", "surname"]
},
"ddoc": "jsonindexes",
"name": "byName",
"type": "json",
"partitioned": true
}

Partitioned indexes can be used when you run only a partitioned query, for example, by using the [GET /<dbname>/_partition/<partition key>/_find](https://cloud.ibm.com/apidocs/cloudant?code=javapostpartitionfind-partitioned-databases) API endpoint.

For more information, see [Creating a partitioned index](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-queryselector-syntax).





 Can I use regular expressions in my queries? 

Yes! IBM Cloudant Query has a [$regex operator](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-querythe-regex-operator) that allows regular expression terms within a query.

Proceed with caution: if a query contains only a $regex operator, then a secondary index cannot help you - the query results in a document-by-document scan of the database.

A $regex operator can be tagged onto the end of an already performant query. For example, if we already have a type=json index on firstname and surname, we can use the following example:

{
"selector": {
"firstname": "Charles",
"surname": "Dickens",
"title": {
"$regex": "^Oliv"
}
},
"limit": 10
}
Click Public Applications to select Region and Runtime.
4. Type a unique name for your app and click Create. The app name must be unique in the whole IBM Cloud environment.



Once created, a Getting started page is added to the left navigation pane. Follow the instructions in that page to download the starter code of your app, modify, and deploy it.

The app is created with one instance and 512 MB memory quota by default. You can increase the memory, or add more instances to get high availability of your app, for example, three instances with 1 GB memory per instance. Click Overview to specify your app instances and memory quota. For example, type 3 for instances and 1 GB for memory quota, and click Save. You can also see the files, logs, and environment variables to troubleshoot your problems.



 Binding a service by using IBM Cloud console 

After creating your app, connect to a database with your app. You can store and retrieve the app data by using a database query language. In this scenario, you decide to use the IBM Cloudant service that is provided by IBM Cloud.

To use IBM Cloud with your Cloud Foundry app, create a service instance and bind your app to the service instance:



1. In the IBM Cloud catalog, select the IBM Cloudant service. Add a unique name for your IBM Cloudant service and click Create. In the Cloudant Manage panel, launch the service by clicking Launch.
2. Click Connections. Then, click Create connection.
3. Click Connect next to your app.
4. The Restage App window is displayed. Click Restage.



Now your app is bound to the IBM Cloudant service. The <VCAP_SERVICES> environment variable contains the data that is required for the app to communicate with the service instance. Because IBM Cloud hosts several apps on the same virtual machine, multiple apps cannot use the same HTTP port number to receive incoming requests. To avoid conflicts, each app is given a unique port number. This port number is available in the <VCAP_APP_PORT> variable.

Follow these steps to see the list of <VCAP_SERVICES> values associated with your app in the console.



1.
* SERVER: ID or name of the server.
* --output: Specify output format, only JSON is supported. One of: JSON.
* -q, --quiet: Suppress verbose output.



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







 ibmcloud is bare-metal-server-initialization-values 

Retrieve configuration variables that are used to initialize the bare metal server.

ibmcloud is bare-metal-server-initialization-values SERVER [--private-key (KEY | @KEY_FILE) --private-key-passphrase PRIVATE_KEY_PASSPHRASE]] [--output JSON] [-q, --quiet]



 Command options 



* SERVER: ID or name of the server.
* --private-key: key|@key-file. The private key in PEM format to decrypt password.
* --private-key-passphrase: The passphrase for the encrypted private key.
* --output: Specify output format, only JSON is supported. One of: JSON.
* -q, --quiet: Suppress verbose output.



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







 ibmcloud is bare-metal-server-network-interface 

View details of a network interface of a bare metal server.

ibmcloud is bare-metal-server-network-interface SERVER NIC [--output JSON] [-q, --quiet]



 Command options 



* SERVER: ID or name of the server.
* NIC: ID or name of the network interface.
* --output: Specify output format, only JSON is supported. One of: JSON.
* -q, --quiet: Suppress verbose output.



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







 ibmcloud is bare-metal-server-network-interface-create 

Create a network interface for a bare metal server.
For example, you can run some setup queries writing to cos://us-geo/my-bucket/tempstore, where each query creates new objects inside that prefix with a distinct jobid=<job_id> name. You can then run an aggregate query over all of the setup results by using cos://us-geo/my-bucket/tempstore as a [composite input table](https://cloud.ibm.com/docs/sql-query?topic=sql-query-readingcompositeInput). The aggregate query treats jobid as if it were a column in the input table (for example, in a WHERE clause). This concept is the Hive-style partitioning concept that Hadoop SQL engines employ for data that is stored in Hadoop Distributed File System (HDFS).

If you want to run a query over the combined results of multiple previous queries, ensure that these have compatible outputs so that their schemas can be merged. For more information, see the section on [composite input tables](https://cloud.ibm.com/docs/sql-query?topic=sql-query-readingcompositeInput). To make this work properly for CSV format, all setup queries must use the same column names and sequence in their SELECT clause, so the results have compatible schemas. If you later need to introduce new columns in extra setup queries, add these columns to the end of the column list. If not, the structure of the composite tempstore data set gets corrupted, causing unreadable objects, corrupted data, or unreliable results.





 Cloud Object Storage endpoints 

Your Cloud Object Storage instance has one of the supported endpoints. Data Engine supports all [public and private Object Storage endpoints](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints). To save space, you can use the alias that is shown instead of the full endpoint name.

Aliases to tethering endpoints (specific endpoints within cross region domains, for example, dal-us-geo) are considered legacy. They continue to work until further notice but are planned to be deprecated sometime in the future.