vania-janet/multiturn-rag-retrieval-data huggingface dataset:
A PreSigned URL is not generated using the IBM Cloud UI; however, you can use CyberDuck to generate the “pre-signed URL”. It is free. For details, see this [Slack channel](https://ibm-cloudplatform.slack.com/archives/C0VJSU370/p1606859253294800).





 How can I generate a Auth Token using the IAM API Key using REST? 

For more information on working with the API, see [Creating IAM token for API Key](https://cloud.ibm.com/docs/account?topic=account-iamtoken_from_apikey) and [Congfiguration Authentication](https://cloud.ibm.com/apidocs/cos/cos-configurationauthentication).





 How can I use the Object Storage web console to download and upload large objects? 

You can use IBM Cloud CLI or the API to download large objects. Alternatively, plugins such as Aspera /rclone can be used.





 What are the libraries that the Object Storage SDK supports? 

Object Storage provides SDKs for Java, Python, NodeJS, and Go featuring capabilities to make the most of IBM Cloud Object Storage. For information about the features supported by each SDK, see the [feature list](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-sdk-about).





 When a file is uploaded to a cross region bucket using the ‘us-geo’ endpoint, how long is the delay before the file is available at the other US sites? 

The data are spread immediately without delay and the uploaded files are available once the write is successful.





 How do I access the reclaimed resources? 

Create a new set of credentials to access the restored resources.





 Can I host a website using a Object Storage bucket? 

You can use Object Storage bucket to host a static website. For details, see [Hosting Website using COS](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-static-website-tutorial).
blocks: 1,
}).then(response => {
console.log(response.result);
});

from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()

response = service.put_capacity_throughput_configuration(
blocks=1
).get_result()

print(response)

putCapacityThroughputConfigurationOptions := service.NewPutCapacityThroughputConfigurationOptions(
1,
)

capacityThroughputConfiguration, response, err := service.PutCapacityThroughputConfiguration(putCapacityThroughputConfigurationOptions)
if err != nil {
panic(err)
}

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

The previous Go example requires the following import block:

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

The returned structure includes the following fields:

current
: Details the current capacity that is allocated and shows both the number of capacity blocks and breakdown of throughput requests classes.

target
: Details the target capacity set and shows both the number of capacity blocks and the breakdown of throughput requests classes.

blocks
: Number of provisioned throughput capacity blocks, where block is 100 reads/sec, 50 writes/sec, and 5 global queries/sec.

throughput
: A breakdown of the specific number of reads/sec, writes/sec, and global queries/sec.

See the following example JSON response with the target capacity set:

{
"current": {
"throughput": {
"read": 500,
"write": 250,
"blocks": 5,
"query": 25
}
number = document[0]
name = document[1]
description = document[2]
temperature = document[3]

 Create a JSON document that represents all the data in the row.
jsonDocument = {
"numberField": number,
"nameField": name,
"descriptionField": description,
"temperatureField": temperature
}

 Create a document by using the Database API.
newDocument = myDatabaseDemo.create_document(jsonDocument)

 Check that the documents exist in the database.
if newDocument.exists():
print("Document '{0}' successfully created.".format(number))

if __name__=='__main__':
main()
Show more
3. From the command line, run demo.py by typing a command similar to the following one.

python3 demo.py

Once you run the script, return to [Step 5. Retrieving data](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-and-populating-a-simple-ibm-cloudant-database-on-ibm-cloudretrieving-data) to complete the tutorial.
[External link icon](https://cloud.ibm.com/docs-content/v1/content/dc2670e9228a1dbe562d3d2c7ee63f7a48ba27c3/icons/launch-glyph.svg)](https://json.org), except as noted:



* string:
Example: "Hello world"
* number:
Example: 0, 0.1, -22, -2.43
* boolean:
true or false
* null:
null
* Not supported:
* objects
Example: {}
* arrays
Example: []



* Values must be comma-delimited.
* Rows must be delimited by using the newline character (n).
* The header row must consist of only string values.







 Sample CSV file 

"temperature", "confidence","status"
1, 0.1, "normal"
2, 0.2, "normal"
3, 0.3, "error"
4, 0.4, "normal"

The first line or "header row" determines the properties that are included in the device JSON in all generated device JSON event objects. Each subsequent line or "data row" sets the value of those properties in each generated device JSON event object.

Tip: When you import the CSV file, you can select Loop simulated data from file to cycle through the data lines in sequence to achieve a continuous data feed. If this toggle is not set, each data row in the CSV is sent once at the frequency that is set by the schedule.

The sample CSV file results in event payloads of the following type:

{
"temperature": 1,
"confidence": 0.1,
"status": "normal"
}







 Sharing and reusing simulations 

You can export your simulation details for reuse or sharing:



1. In the Simulations window, click Import/Export.
2. Select the Export tab.
3.
"name" : "foo-partitioned-index",
"type" : "json",
"partitioned": true
}

See the following example of a JSON object that creates a global index that is called bar-global-index for the field called bar:

{
"index": {
"fields": ["bar"]
},
"name" : "bar-global-index",
"type" : "json",
"partitioned": false
}

See the following example of returned JSON, confirming that the index was created:

{
"result": "created"
}



Table 1. Request body format

 Field Description 

 index fields - A JSON array of field names that uses the [sort syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-querysort-syntax). Nested fields are also allowed, for example, person.name. 
 ddoc (optional) Name of the design document in which the index is created. By default, each index is created in its own design document. Indexes can be grouped into design documents for efficiency. However, a change to one index in a design document invalidates all other indexes in the same document. 
 type (optional) Can be json or text. Defaults to json. 
 name (optional) Name of the index. If no name is provided, a name is generated automatically. 
 partitioned (optional, boolean) Determines whether this index is partitioned. For more information, see [the partitioned field](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-querysection1-the-partitioned-field). 





 The partitioned field 

This field sets whether the created index is a partitioned or global index.



Table 2. Partitioned field values

 Value Description Notes 

 true Create the index as partitioned. Can be used only in a partitioned database. 
 false Create the index as global. Can be used in any database.
db: 'readings',
partitionKey: 'bridge-9876',
selector: selector
}).then(response => {
console.log(response.result);
});

from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()

response = service.post_partition_find(
db='readings',
partition_key='bridge-9876',
selector={
'deviceID': {'$eq': 'device-123456'},
'ts': {'$gte': '20181213'}
}
).get_result()

print(response)

selector := map[string]interface{}{
"deviceID": map[string]string{
"$eq": "device-123456",
},
"ts": map[string]string{
"$gte": "20181213",
},
}

postPartitionFindOptions := service.NewPostPartitionFindOptions(
"readings",
"bridge-9876",
selector,
)

findResult, response, err := service.PostPartitionFind(postPartitionFindOptions)
if err != nil {
panic(err)
}

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

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.
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. The minimum value is 1.

--sort (string)
: Sort a collection of secrets by the specified field in ascending order. To sort in descending order use the - character

Available values: id | created_at | updated_at | expiration_date | secret_type | name
* --long: Retrieve all image details.
* --json: Format output in JSON.



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







 ibmcloud pi instance 



 View details of a server instance 

ibmcloud pi instance INSTANCE_ID [--json]



* INSTANCE_ID: The unique identifier or name of the instance.



Options



* --json: Format output in JSON.



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







 ibmcloud pi instance-capture 



 Capture a server instance 

ibmcloud pi instance-capture INSTANCE_ID --destination DEST --name NAME [--volumes "VOLUME-ID1 .. VOLUME-IDn"] [--access-key KEY] [--secret-key KEY] [--region REGION] [--image-path PATH] [(--job | --task)]



* INSTANCE_ID: The unique identifier or name of the instance.



Options



* --destination: Destination for the deployable image (image-catalog, cloud-storage, both).
* --name: Name of the deployable image that is created for the captured instance.
* --volumes: Space separated list of identifiers or names of the volumes to capture with the instance.
* --access-key: Cloud Object Storage HMAC access key. Required if destination is cloud-storage.
* --secret-key: Cloud Object Storage HMAC secret key. Required if destination is cloud-storage.
* --region: Cloud Object Storage region (us-east, us-south, eu-de). Required if destination is cloud-storage.
* --image-path: Cloud Object Storage image path. Required if destination is cloud-storage.
* --job: The operation will be processed as a job.
* --task: [DEPRECATED] The operation will be processed as a task. Task processing is deprecated in favor of job processing. Default.
Step 2: Running a simple query 

This example demonstrates how IBM Cloudant Query finds documents based on the descriptionField with the value boiling.

To run the query, follow these steps:



1. Copy the following sample JSON into a data file named query1.json:

{
"selector": {
"descriptionField": "boiling"
}
}
2. Run the following command to query the database:

acurl "https://$ACCOUNT.cloudant.com/databasedemo/_find" -X POST -H "Content-Type: application/json" -d @query1.json
3. Review the query results:

{
"docs": [{
"_id": "91d1fa833d28efe15069604f98de701d",

"_rev": "1-f998fc7b89d4466c1e7bb204b1b00f74",
"numberField": 1,
"nameField": "one",
"descriptionField": "boiling",
"temperatureField": 100
}],
"bookmark": "g1AAAABweJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYorWBqmGKYlWhgbpxhZpKalGpoamFmaGZikWVqkpJobGKaA9HHA9BGlIwsAmn8eLw",
"warning": "No matching index found, create an index to optimize query time."
}



Next, you find a document in the database by using two fields.





 Step 3: Running a query with two fields 

This example uses two fields to find a document with the values: freezing and -5.

The search is described by using a ['selector' expression](https://cloud.ibm.com/apidocs/cloudantpostfind) that looks like the following example:

{
"selector": {
"descriptionField": "freezing",
"temperatureField": -5
}
}

You can tailor the results by adding more details within the selector expression. The fields parameter specifies the fields to include with the results. In our example, the results include the nameField, descriptionField, and temperatureField, as shown in the following example.
number = document[0]
name = document[1]
description = document[2]
temperature = document[3]

 Create a JSON document that represents all the data in the row.
jsonDocument = {
"numberField": number,
"nameField": name,
"descriptionField": description,
"temperatureField": temperature
}

 Create a document by using the Database API.
newDocument = myDatabaseDemo.create_document(jsonDocument)

 Check that the documents exist in the database.
if newDocument.exists():
print("Document '{0}' successfully created.".format(number))

if __name__=='__main__':
main()
Show more
3. From the command line, run demo.py by typing a command similar to the following one.

python3 demo.py

Once you run the script, return to [Step 5. Retrieving data](https://cloud.ibm.com/docs/services/Cloudant?topic=Cloudant-creating-and-populating-a-simple-ibm-cloudant-database-on-ibm-cloudretrieving-data) to complete the tutorial.
if (doc.ts) {
emit( doc.ts, null);
}
}"
}
},
"language": "javascript"
}

The result is that the map code is turned into a JSON-compatible string, and included in a design document.

Once the design document is saved, IBM Cloudant triggers server-side processes to build the fetch/by_ts view. It creates this view by iterating over every document in the database, and sending each one to the JavaScript map function. The function returns the emitted key-value pair. As the iteration continues, each key-value pair is stored in a B-Tree index. After the index is built for the first time, subsequent reindexing is performed only against new and updated documents. Deleted documents are de-indexed. This time-saving process is known as incremental MapReduce, as shown in the following diagram:

Zoom

![A database is created with 1000 documents. A design document is added, which triggers the building of one or more views. The view builds asynchronously until it is complete. The arrival of 250 more docs makes the index incomplete again. The view will build automatically in the background, or when queried.](https://cloud.ibm.com/docs-content/v1/content/522c6f62358b063f921283400a601c3f9bc66f08/Cloudant/images/DesDocMan00.svg)

Figure 1. Illustration of Incremental MapReduce

It's worth remembering the following points:



* The construction of an index happens asynchronously. IBM Cloudant confirms that the design document was saved. To check on the progress of the construction of the index, you must poll IBM Cloudant's [_active_tasks](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-active-tasksactive-tasks) endpoint.
* The more data that you have, the longer it takes before the index is ready.
rev: '2-9a0d1cd9f40472509e9aac6461837367'
}).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.

See an example response after a successful deletion request.

{
"id": "exampleid",
"ok": true,
"rev": "2-056f5f44046ecafc08a2bc2b9c229e20"
}
To change the output format to JSON, use --output json.
* -m, --rotation-interval-month



Specify the rotation time interval (in months) for a key. The default value is -1.



* -s, --standard-key

Set the parameter only if you want to create a [standard key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-envelope-encryptionkey-types). To create a root key, omit the --standard-key parameter.
* -v, --iv

Used with import tokens. The initialization vector (IV) that is generated when you encrypt a nonce. The IV value is required to decrypt the encrypted nonce value that you provide when you make a key import request to the service.

To generate an IV, encrypt the nonce by running ibmcloud kp import-token nonce-encrypt.
* --key-ring

A unique, human readable name for the key-ring. Required if the user doesn't have permissions on the default key ring.









 kp key delete 

[Delete a key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-delete-keys) that is stored in your Key Protect service.

ibmcloud kp key delete KEY_ID_OR_ALIAS
-i, --instance-id INSTANCE_ID
[--key-ring KEY_RING_ID]
[-f, --force]
[-o, --output OUTPUT]



 Examples 

These are examples of kp key delete.



 Example 1 

Delete a root key.

 create a root key
$ ibmcloud kp key create my-root-key

Creating key: 'my-root-key', in instance: '390086ac-76fa-4094-8cf3-c0829bd69526'...
OK
Key ID Key Name
curl "https://$ACCOUNT.cloudant.com/_api/v2/monitoring/disk_use?cluster=myclustername&format=json"

See an example result after you request disk use data in JSON format:

[
{
"target": "sumSeries(net.cloudant.mycustomer001.db.df.srv.used)",
"datapoints":
523562172416.0, 1391019360],
524413976576.0, 1391019420],
519036682240.0, 1391019480],
518762102784.0, 1391019540],
523719393280.0, 1391019600]
]
},
{
"target": "sumSeries(net.cloudant.mycustomer001.db.df.srv.free)",
"datapoints":
6488926978048.0, 1391019360],
6487768301568.0, 1391019420],
6493145661440.0, 1391019480],
6493420257280.0, 1391019540],
4330660167680.0, 1391019600]
]
}
]
Show more





 With format=raw 

The raw format data contains a series of text strings, identifying the name of the metric and associated values.

The text string (for example sumSeries(net.cloudant.mycustomer001.db.df.srv.used)) is the name of the metric. The next two numbers are the start and end times, expressed as UTC epoch seconds. The final number is the step size in seconds.

The numbers after the | character contain the metric data that is obtained from your chosen endpoint.
}

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

The previous Go example requires the following import block:

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

The returned structure includes the following fields:



* throughput - Breakdown of the current number of reads, writes, and global queries used.



See the following example JSON response of the current consumption of capacity:

{
"throughput": {
"read": 133,
"write": 42,
"query": 13
}
}
: To find alternatives to IBM Cloudant's IBM® Db2® Warehouse on Cloud feature, see the [data-flow-examples repository](https://github.com/cloudant-labs/data-flow-examples) for tutorials on extracting IBM Cloudant documents and writing the data to a Db2 Warehouse on Cloud table.







 January 2018 



 10 January 2018 

The following changes were made in build 6620:

IBM Cloudant Query and empty partial_filter_selector field
: IBM Cloudant Query falls back to selector on an empty partial_filter_selector field.







 December 2017 



 28 December 2017 

The following changes were made in build 6600:

IBM Cloudant Query and $or operations
: IBM Cloudant Query fields that are referenced within $or operations are considered when IBM Cloudant Query determines the usable indexes for a particular selector.





 7 December 2017 

The following changes were made in build 6588:

New!create_target_params parameter
: A new parameter, create_target_params, was added for you to customize the target database that is created on a new replication. You can now customize the cluster's default values for the number of shards and replicas to create.

/_scheduler
: A request to /_scheduler without specifying subsections docs or jobs now returns a Not found error.

new_edits value
: A new error is returned when a new_edits value is invalid in the /db/_bulk_docs URL. The error is 400: Bad request.

eval() and Function() constructors
: For security reasons, by default, the use of eval() and Function() constructors is disabled in JavaScript.

Prefer: return=minimal header
: Added the header Prefer: return=minimal to return only essential headers. This header reduces the size of the request, which gives a performance improvement to nonbrowser clients.

Disabled JavaScript constructors
: If a user calls the disabled JavaScript constructors, eval() or Function(), an error message similar to this one is returned, Call to eval() was blocked by CSP.
panic(err)
}
b, _ := json.MarshalIndent(allDocsResult3, "", " ")
fmt.Println(string(b))
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]] ! ! ! ! ! for examples.This practice means you define the size of the data set and the range of the _id field to return, but that isn't quite the same as pagination.The startkey/endkey values are in double quotation marks because they're expected to be JSON-encoded and JSON.stringify('order00077') === "order00077".<-- </section "id="section-the-limit-startkey-endkey-parameters" "> --><-- <section "id="section-pagination-options" "> --> Pagination options For performance reasons, if you are displaying large amounts of data, you must consider using pagination. In these examples, documents are fetched in blocks of five. However, in a real application, the page size might be different and depends on document size, latency demands, memory consumption, and other tradeoffs.You can use the options that are described in the following sections.<-- <section "id="section-option-1-fetch-one-doc-too-many" "> --> Option 1 - Fetch one document too many Instead of fetching five documents (limit=5), fetch 5+1 (limit=6), but hide the sixth document from your users.
putDatabaseOptions.SetPartitioned(true)

ok, response, err := service.PutDatabase(putDatabaseOptions)
if err != nil {
panic(err)
}

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

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.





 Document structure 

First, let's define a simple document format to work with:

{
"deviceID": "device-123456",
"infrastructureID": "bridge-9876",
"ts": "20181211T11:13:24.123456Z",
"reading": {
"temperature": {
"value": 12,
"unit": "c"
}
}
}

This document uses the partitioning scheme based on a piece of infrastructure. The document ID might include the infrastructure ID as the partition key, and include both device and timestamp as the document key:

bridge-9876:device-123456-20181211T11:13:24.123456Z





 Creating indexes 

For the queries described previously, you need two indexes:



1. A global index-mapping device ID to infrastructure ID
2. A partitioned index-mapping device ID to reading





 Creating a global view index 

A view index is the most efficient way to do the simple device ID to infrastructure ID mapping. To define it, upload a design document with options.partitioned set to false as this index is global.