vania-janet/multiturn-rag-retrieval-data huggingface dataset:
When you exceed the number of allowed events, IBM Cloudant generates a [429 Too Many Requests](https://cloud.ibm.com/apidocs/cloudantlist-of-http-codes) response. You must make sure ahead of time that your applications can handle 429 responses.

If you use the most recent versions of the [client libraries](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-client-libraries) that IBM Cloudant supports, you can set up your applications to handle 429 responses. This step is important because most client libraries don't automatically attempt to retry a request when a 429 response occurs. You need to verify that your application handles 429 responses correctly because IBM Cloudant limits the number of retries. Regularly exceeding the number of requests indicates that you need to move to a different plan.
* Resource Groups FAQ

 Resource Groups FAQ 

You can migrate IBM® Cloudant® for IBM Cloud® resource instances into resource groups.

Since 16 July 2018, new IBM Cloudant resource instances are provisioned into resource groups, rather than Cloud Foundry spaces.



You can migrate IBM Cloudant instances on the following plans:



* Lite
* Standard
* Dedicated Hardware



To migrate an IBM Cloudant instance from a Cloud Foundry space to a resource group, see [Migrating Cloud Foundry service instances and apps to a resource group](https://cloud.ibm.com/docs/account?topic=account-migrate).





The migration process doesn't cause any downtime.





Since 16 July 2018, new instances are provisioned into resource groups rather than Cloud Foundry spaces. Resource instances created before this date have an associated Cloud Foundry organization and space. Instances created after this date are associated with a resource group instead.





New Standard plan instances are provisioned into resource groups. In order to create these instances onto a Dedicated Hardware instance, the Dedicated Hardware instance must first be migrated into a resource group.

For more information about how to do this migration, see [Migrating Cloud Foundry service instances and apps to a resource group](https://cloud.ibm.com/docs/account?topic=account-migrate).
More information can be found in [the curl reference](https://cloud.ibm.com/docs/cloud-object-storage/cli?topic=cloud-object-storage-curl), as well as [the API reference documentation](https://cloud.ibm.com/docs/cloud-object-storage/api-reference?topic=cloud-object-storage-compatibility-api).





 Using libraries and SDKs 

IBM COS SDKs are available for [Python](https://cloud.ibm.com/docs/cloud-object-storage/libraries?topic=cloud-object-storage-python), [Java](https://cloud.ibm.com/docs/cloud-object-storage/libraries?topic=cloud-object-storage-java), [Go](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-using-go), and [Node.js](https://cloud.ibm.com/docs/cloud-object-storage/libraries?topic=cloud-object-storage-node). These libraries are forked and modified versions of the AWS S3 SDKs that support [IAM token-based authentication](https://cloud.ibm.com/docs/cloud-object-storage/iam?topic=cloud-object-storage-iam-overview), as well as support for [Key Protect](https://cloud.ibm.com/docs/cloud-object-storage/basics?topic=cloud-object-storage-encryption).





 Building applications on IBM Cloud 

IBM Cloud® provides flexibility to developers in choosing the right architectural and deployment options for a given application.
"products",
)

databaseInformation, response, err := service.GetDatabaseInformation(getDatabaseInformationOptions)
if err != nil {
panic(err)
}

b, _ := json.MarshalIndent(databaseInformation, "", " ")
fmt.Println(string(b))

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

const service = CloudantV1.newInstance({});

service.getDatabaseInformation({db: 'products'}).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"
)

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.

The elements of the returned structure are shown in the following table:



Table 1. Database details

 Field Description 

 compact_running Set to true if the database compaction routine is operating on this database. 
 db_name The name of the database. 
 disk_format_version The version of the physical format that is used for the data that is stored on disk. 
 disk_size Size in bytes of the data as stored on the disk. Views indexes aren't included in the calculation. 
 doc_count A count of the documents in the specified database. 
 doc_del_count Number of deleted documents. 
 instance_start_time Always 0. 
 other JSON object that contains a data_size field. 
 purge_seq The number of purge operations on the database. 
 sizes A JSON object, containing file, external, and active sizes.
* Optional: Output FORMAT can be only json or text.



* Flag: --output FORMAT











 Set bucket CORS 



* Action: Sets the CORS configuration for a bucket in the user's IBM Cloud Object Storage account.
* Usage:ibmcloud cos bucket-cors-put --bucket BUCKET_NAME [--cors-configuration STRUCTURE] [--region REGION] [--output FORMAT]
* Parameters to provide:



* The name of the bucket.



* Flag: --bucket BUCKET_NAME



* Optional: A STRUCTURE using JSON syntax in a file.



* Flag: --cors-configuration STRUCTURE
* JSON Syntax: --cors-configuration file://<filename.json> ======= The --cors-configuration command takes a JSON structure that describes the CORS configuration. In this example, the file:// prefix is used to load the JSON structure from the specified file.





{
"CORSRules": [
{
"AllowedHeaders": "string", ...],
"AllowedMethods": "string", ...],
"AllowedOrigins": "string", ...],
"ExposeHeaders": "string", ...],
"MaxAgeSeconds": integer
}
...
]
}



* Optional: The REGION where the bucket is present. If this flag is not provided, the program uses the default option that is specified in config.



* Flag: --region REGION



* Optional: Output FORMAT can be only json or text.



* Flag: --output FORMAT











 Put object 



* Action: Upload an object to a bucket in a user's IBM Cloud Object Storage account.
Specifically, project configuration data (the deployable architecture reference and selected inputs) is stored in a multi-tenant IBM managed IBM Cloudant database in the project region. The Schematics instances that are created in the customer account for a project are also located in the project region. This ensures that all configuration data is stored in the customer selected region. However, basic project metadata, like the name, description, and state is replicated globally to enable global search and the ability to list all projects across regions.





 Project data protection 

Project's are a multi-tenant platform service where all project data is encrypted at rest and in flight. Project primary storage uses separate documents for each project in IBM® Cloudant® for IBM Cloud®. IBM Cloudant provides robust data protection and security. For example, IBM Cloudant encrypts all data at rest and automatically stores three copies of every document to different nodes in a cluster. In addition, project data is periodically backed up to IBM Cloud® Object Storage, which is also encrypted. Access to project data is protected by IAM authentication and authorization policies that ensure client isolation. All project data is encrypted in flight by using HTTPS with TLS1.2+.

For more information on IBM Cloudant data protection, see [Securing your data in IBM Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-securing-your-data-in-cloudant). For more information on Object Storage data protection, see [Data security](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-security).
"total_rows": 11,
"offset": 0,
"rows":
{ "id": "4eee973603bf77f30b1f880ed83df76a" ....},
{ "id": "4eee973603bf77f30b1f880ed83f469a" ....},
{ "id": "65fa623a384648740ec1f39b495d591c" ....},
{ "id": "d7404903579d6d5880514c22ad983529" ....},
{ "id": "example" ....},
{ "id": "mydoc" ....} // <-- This is the 6th result we use as the startkey of the next request
]
}
See the following example of a second request: curl -H "Authorization: Bearer $API_BEARER_TOKEN" "$SERVICE_URL/orders/_all_docs?limit=6&startkey="mydoc""
See the following example of a second response: {
"total_rows": 11,
"offset": 5,
"rows":
{ "id": "mydoc" ....},
{ "id": "order00057" ....},
...
]
}
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/core"
All Go examples require the service object to be initialized. For more information, see the API documentation's Authentication section]] ! ! ! !
--secret-prototype ([SecretPrototype](https://cloud.ibm.com/docs/secrets-manager-cli-plugin?topic=secrets-manager-cli-plugin-secrets-manager-clicli-secret-prototype-example-schema))
: Specify the properties for your secret. Required.

Provide a JSON string option or specify a JSON file to read from by providing a filepath option that begins with a @, e.g. --secret-prototype=@path/to/file.json.





 Example 

ibmcloud secrets-manager secret-create --secret-prototype='{"custom_metadata": {"anyKey": "anyValue"}, "description": "Description of my arbitrary secret.", "expiration_date": "2023-10-05T11:49:42Z", "labels": ["dev","us-south"], "name": "example-arbitrary-secret", "secret_group_id": "default", "secret_type": "arbitrary", "payload": "secret-data", "version_custom_metadata": {"anyKey": "anyValue"}}'







 ibmcloud secrets-manager secrets 

List the secrets that are available in your Secrets Manager instance. Note: If the --all-pages option is not set, the command will only retrieve a single page of the collection.

ibmcloud secrets-manager secrets [--offset OFFSET] [--limit LIMIT] [--sort SORT] [--search SEARCH] [--groups GROUPS]



 Command options 

--offset (int64)
: The number of secrets to skip. By specifying offset, you retrieve a subset of items that starts with the offset value. Use offset with limit to page through your available resources.

Usage: If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use ..?offset=25&limit=25.

The minimum value is 0.

--limit (int64)
: The number of secrets to list.

The maximum value is 1000.
For more information, see [Session state at disconnection](https://cbonte.github.io/haproxy-dconv/1.7/configuration.html8.5). 
 dbName The IBM Cloudant database name targeted by the HTTP Request. 
 dbRequest The database request endpoint. 
 userAgent Software that is acting on behalf of the user, such as a browser or client library. 
 sslVersion The version of Transport Layer Security that the request is using. 
 cipherSuite The cipher suite used for the request. 
 requestClass The class of metrics that the request is billed against. Unlimited is an unmetered event. For more information, see [Request classes](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-ibm-cloud-publicrequest-classes). 
 parsedQueryString A parsed version that shows the breakdown of the parameters that are passed in the query string. If IBM Cloudant cannot parse the rawQueryString, this value is null. 
 rawQueryString Full text of the query string as passed to the service. 
 logSourceCRN The CRN of the IBM Cloudant instance emitting logs. 
 meta A line reserved for additional information from IBM Cloudant. 
 timings connect - The total time to accept TCP connection and execute handshakes for SSL protocol. This time happens only once during the connection's lifetime, so subsequent requests that are sent over the same connection show 0 for this value. <br>request - The total time to get the client request. It's the time that is elapsed between the first bytes received and the moment the service receives the last byte of the request body. <br>transfer- The data transmission time to transfer the full response from the service to the client. <br>response- The total active time for the HTTP request, between the moment the service received the first byte of the request header and the emission of the last byte of the response body. 



The request and transfer timings are included in response.
Creating a presigned URL 

Presigned URLs in IBM Cloud® Object Storage create temporary links that can be used to share an object without requiring additional user credentials when accessed.

Of course, one can also [provide a temporary target for sending a PUT request](https://medium.com/codait/keeping-your-secrets-between-cloud-object-storage-and-your-browser-part-1-68f4b83bbd38) also without needing to provide any more information for authentication. The easiest way to create presigned URLs is using the [AWS CLI](https://cloud.ibm.com/docs/cloud-object-storage/cli?topic=cloud-object-storage-aws-cli). But first, you may need to run aws configure in order to set your Access Key ID and Secret Access Key from your own [HMAC-enabled service credential](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-uhc-hmac-credentials-main). When you have completed configuring your CLI, use the following example as a template and replace the endpoint and name of your bucket with the appropriate information:

$ aws --endpoint-url=https://{endpoint} s3 presign s3://{bucket-name}/{new-file-key}

If the service credential used to generate the HMAC credentials (used as the Access Key ID and Secret Access Key configuration above) is deleted, the access for the pre-signed URL will fail.

It is also possible to set an expiration time for the URL in seconds (default is 3600):

$ aws --endpoint-url=https://{endpoint} s3 presign s3://bucket-1/new-file --expires-in 600

It is also possible to construct them programmatically. Here are examples for basic GET operations written in Python.
random-route: true
memory: 128M

In this manifest.yml file, random-route: true generates a random route for your app to prevent your route from colliding with others. If you choose to, you can replace random-route: true with host: <myChosenHostName>, supplying a host name of your choice.





 Step 4: Deploy the app 

You can use the IBM Cloud CLI to deploy apps.



1. Log in to your IBM Cloud account, and select an API endpoint.

ibmcloud login

If you have a federated user ID, instead use the following command to log in with your single sign-on ID. See [Logging in with a federated ID](https://cloud.ibm.com/docs/account?topic=account-federated_id) for more information.

ibmcloud login --sso
2. Target a Cloud Foundry org and space:

ibmcloud target --cf

If you don't have an org or a space set up, see [Adding orgs and spaces](https://cloud.ibm.com/docs/account?topic=account-orgsspacesusers).
3. From within the get-started-python directory push your app to IBM Cloud

ibmcloud cf push

This can take a minute. If there is an error in the deployment process you can use the command ibmcloud cf logs <Your-App-Name> --recent to troubleshoot.



When deployment completes you should see a message indicating that your app is running. View your app at the URL listed in the output of the push command. You can also issue the following command to view your apps status and see the URL.

ibmcloud cf apps

You can also go to the IBM Cloud [resource list](https://cloud.ibm.com/resources) to view your app.





 Step 5: Add a database 

Next, we'll add an IBM Cloudant NoSQL database to this app and set up the app so that it can run locally and on IBM Cloud.



1.
* To complete the migration, follow these [IBM Cloudant instructions](https://cloud.ibm.com/docs/account?topic=account-migratemigrate_instances).





1. Open the More actions menu.
2. Select Migrate to a resource group to get started.
3. Select a resource group.
4. Click Migrate and the instance is migrated for you.
5. Since you can migrate only one instance at a time, you can continue migrating eligible instances after you migrate the first one.



The data in the Cloudant instance is not involved in this migration.There is no Cloudant service downtime as a result of this migration.







 IBM Cloudant Geospatial notice 

Support for the IBM Cloudant Geospatial capability ends on 31 January 2023. In many cases, existing applications fail if changes are not made to address the removal of this functionality before the end of support.



 What is IBM Cloudant Geospatial? 

Data is stored as GeoJSON in the IBM Cloudant database to describe point, line, polygon, multi-point, multi-line, and multi-polygon objects. Each object, as well as the geographic information, can have optional properties: Metadata about the object, which is returned in the search results.

Again, an index is defined as a JavaScript function, and then, queries can be used to ask questions of your collection of geographic features. For example, find me the nearest object to this point; find objects within this polygon; find objects along this path; or find objects that intersect with this object.

To summarize, IBM Cloudant Geo is something unique to the IBM Cloudant service and is used to perform advanced geospatial queries against your databases of GeoJSON objects. It cannot be combined with other index types. It is only of use to Geographic Information Systems or use-cases that have a purely geographic purpose.





 What is changing? 

As of 1 February 2023, the following conditions apply:



* Users cannot query /$DATABASE/_design/$DDOCS/_geo endpoints. Requests to those endpoints return a 404 Not Found response.
Object operations 

The modern capabilities of IBM Cloud® Object Storage are conveniently available via a RESTful API. Operations and methods for reading, writing, and configuring objects (stored within a bucket), are documented here.

For more information about endpoints, see [Endpoints and storage locations](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpointsendpoints).



 A note regarding Access/Secret Key (HMAC) authentication 

When authenticating to your instance of IBM Cloud Object Storage [using HMAC credentials](https://cloud.ibm.com/docs/cloud-object-storage/iam?topic=cloud-object-storage-uhc-hmac-credentials-main), you will need the information represented in Table 1 when [constructing an HMAC signature](https://cloud.ibm.com/docs/cloud-object-storage/iam?topic=cloud-object-storage-hmac-signature).



Table 1. HMAC signature components

 Key Value Example 

 {access_key} Access key assigned to your Service Credential cf4965cebe074720a4929759f57e1214 
 {date} The formatted date of your request (yyyymmdd) 20180613 
 {region} The location code for your endpoint us-standard 
 {signature} The hash created using the secret key, location, and date ffe2b6e18f9dcc41f593f4dbb39882a6bb4d26a73a04326e62a8d344e07c1a3e 
 {timestamp} The formatted date and time of your request 20180614T001804Z 







 Upload an object 

A PUT given a path to an object uploads the request body as an object. All objects uploaded in a single thread should be smaller than 500 MB to minimize the risk of network disruptions.
This video is part 15 - Partitioned database.

IBM Cloudant is a distributed database, which is a discussion that is coming up. Many storage nodes make up an IBM Cloudant service and a database's documents are distributed across the nodes in groups called shards. A single database is said to be sharded or divided into multiple pieces.

In a normal IBM Cloudant database, a document is allocated a shard algorithmically - effectively documents are distributed around the shards randomly.

In a partitioned database, you define which shard the documents are stored in by supplying a partition key.

Partitioned databases are not created with the same PUT /<database name> API call but with an extra query string parameter: partitioned=true.

In the first example, the products database is created as a partitioned database, in the second example, as a standard, unpartitioned database.

When you add documents to a partitioned database, you must supply a document _ID - (no auto-generated document _IDs exist). A document _id has two parts, which are separated by a colon character:

Partition key
: A string that defines on which partition to store the document.

Document key
: A string that uniquely identifies a document within the partition.

In the first example, a book is being added into the book partition of the products database.

Then, another document is being added into the DVD partition and a third into the household partition.

The effect of this is that documents that share a partition key reside in the same shard of the databases. Documents in the same partition are stored together in document key order.

The advantage comes when retrieving data. We can direct IBM Cloudant Queries, MapReduce requests, and searches at a single partition. In this example, an IBM Cloudant Query selector is being sent to the book partition. This action means you exercise only a fraction of the IBM Cloudant infrastructure (only the shard that hosts the book partition is used, the rest of the cluster remains idle).

This scenario makes for faster query performance, cheaper query costs, and better scalability.

The key to great partitioned query performance is the choice of partition key:

It needs to be a value that repeats within your data set.
To find alternatives to IBM Cloudant's IBM® Db2® Warehouse on Cloud feature, see the data-flow-examples repository for tutorials on extracting IBM Cloudant documents and writing the data to a Db2 Warehouse on Cloud table.

Cloudant



* 20 minutes
* 2023-03-30



[Locating your service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials)Locating your service credentials

You can find the credentials for any service that is associated with your account.

Cloudant



* 5 minutes
* 2023-04-06



[Migrating an instance with legacy credentials and IAM Authentication to IAM Only Authentication](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-migrating-to-iam-only)Migrating an instance with legacy credentials and IAM Authentication to IAM Only Authentication

When you create a new service credential by using the IBM Cloud Dashboard or the IBM Cloud CLI, it always produces a new username and password combination. This method applies to legacy credentials as well as a new IAM API key. This tutorial guides you through migrating your instance from generating new legacy credentials and IAM API keys to generating new IAM API keys only.

Cloudant



* 10 minutes
* 2023-03-30



[Revoking a credential that is tied to your instance URL](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-revoke-instance-url-style-credential)Revoking a credential that is tied to your instance URL

In IBM Cloud®, you create a new service credential by using the IBM Cloud Dashboard or the IBM Cloud CLI. This step always produces a new username and password combination as your IBM® Cloudant® for IBM Cloud® legacy credentials. As expected, deleting the service credential effectively revokes access for any applications that use those credentials.

Cloudant



* 10 minutes
* 2023-03-30