vania-janet/multiturn-rag-retrieval-data huggingface dataset:
1. Create a file named: 'registration.json based on the example template. Replace the values in the example template payload registration with the actual values based on your installation.

- CLIENT_ID Your base64 encoded character string.
- CLIENT_SECRET Your base64 encoded character string.

Note: The <CLIENT_ID> and <CLIENT_SECRET> need to be generated. The values can be any string, but normally a 32 character string that is base64 encoded is used. You can use BASE64 to encode your character string. For more information, see: [BASE64](https://www.base64encode.org/).

Example command that uses base64 to encode a character string:


 Generate two encrypted streams from some longer-than-32-characters strings

echo There is a huge white elephant in LA zoo |base64
echo 12345678901234567890123456789012345 |base64


- CP4MCM_CONSOLE_URL The URL of the IBM Cloud Pak for Multicloud Management console.
- post_logout_redirect_uris The URL of the IBM Cloud Pak for Multicloud Management console.
- trusted_uri_prefixes The URL of the IBM Cloud Pak for Multicloud Management console with "forward slash" /.
- redirect_uris The URL of the IBM Cloud Pak for Multicloud Management console with the path to callback and the URL of the CloudForms host with the path to the redirect_uri.

Note: You can run the following command on the IBM Cloud Pak for Multicloud Management cluster to determine the URL of the IBM Cloud Pak for Multicloud Management console:

oc get routes icp-console -o=jsonpath='{.spec.host}' -n kube-system


2. After the file 'registration.json' is completed, run the command to register CloudForms as an OIDC client.

Example cloudctl command:
 {: codeblock}
cloudctl iam oauth-client-register -f registration.json
: Replaces the password that is stored for a username_password secret with a randomly generated, 32-character password that contains uppercase letters, lowercase letters, digits, and symbols.





 Examples 

Manually rotate the secret data that is stored for an arbitrary secret.

vault write -format=json ibmcloud/arbitrary/secrets/fe874c2b-e8fd-bbb6-9f19-e91bbe744735/rotate payload="Updated secret data."

Manually rotate the password that is stored for a username_password secret.

vault write -format=json ibmcloud/username_password/secrets/cb32abc1-2a4b-e0fd-f403-233e5249e130/rotate password="my-updated-password"

Replace the password that is stored for a username_password secret with a randomly generated 32-character password.

vault write -format=json -force ibmcloud/username_password/secrets/cb32abc1-2a4b-e0fd-f403-233e5249e130/rotate





 Output 

The command to manually rotate a username_password secret with a user-provided password returns the following output:

{
"request_id": "9cb258e5-fbc9-7a37-f8c9-c5ab1dd7b823",
"lease_id": "",
"lease_duration": 0,
"renewable": false,
"data": {
"created_by": "iam-ServiceId-b7ebcf90-c7a9-495b-8ce8-bbf33cb95ca0",
"creation_date": "2020-10-22T15:09:19Z",
You can troubleshoot errors in the deployment process by using the ibmcloud cf logs <Your-App-Name> --recent command.





 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. In your browser, log in to IBM Cloud and go to the Dashboard. Select Create resource.
2. Search for IBM Cloudant, and select the service.
3. For Available authentication methods, select Use both legacy credentials and IAM. You can leave the default settings for the other fields. Click Create to create the service.
4. In the navigation, go to Connections, then click Create connection. Select your app, and click Connect.
5. Using the default values, click Connect & restage app to connect the database to your app. Click Restage when prompted.

IBM Cloud will restart your app and provide the database credentials to your app using the VCAP_SERVICES environment variable. This environment variable is available to the app only when it is running on IBM Cloud.



Environment variables enable you to separate deployment settings from your source code. For example, instead of specifying a database password in your source code, you can store it in an environment variable that you reference in your source code.





 Step 6: Use the database 

We're now going to update your local code to point to this database. We'll create a JSON file that will store the credentials for the services the app will use. This file will get used ONLY when the app is running locally. When running in IBM Cloud, the credentials will be read from the VCAP_SERVICES environment variable.



1. In the get-started-node directory, create a file called vcap-local.json with the following content:

{
"services": {
"cloudantNoSQLDB": [
{
"credentials": {
"url":"CLOUDANT_DATABASE_URL"
},
"label": "cloudantNoSQLDB"
}
]
}
}
It is only required to specify the unique resource by name inside this VPC.
* --output: Specify output format, only JSON is supported. One of: JSON.
* -q, --quiet: Suppress verbose output.



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







 ibmcloud is instance-group-delete 

Delete one or more instance groups.

ibmcloud is instance-group-delete (INSTANCE_GROUP1 INSTANCE_GROUP2 ...) [--output JSON] [-f, --force] [-q, --quiet]



 Command options 



* INSTANCE_GROUP1: ID or name of the instance group.
* INSTANCE_GROUP2: ID or name of the instance group.
* --output: Specify output format, only JSON is supported. One of: JSON.
* --force, -f: Force the operation without confirmation.
* -q, --quiet: Suppress verbose output.



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







 ibmcloud is instance-group-load-balancer-delete 

Delete an instance group load balancer.

ibmcloud is instance-group-load-balancer-delete INSTANCE_GROUP [-f, --force] [-q, --quiet]



 Command options 



* INSTANCE_GROUP: ID or name of the instance group.
* --force, -f: Force the operation without confirmation.
* -q, --quiet: Suppress verbose output.



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







 ibmcloud is instance-group-managers 

List all managers for an instance group.

ibmcloud is instance-group-managers INSTANCE_GROUP [--output JSON] [-q, --quiet]



 Command options 



* INSTANCE_GROUP: ID or name of the instance group.
* --output: Specify output format, only JSON is supported. One of: JSON.
* -q, --quiet: Suppress verbose 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.

--quiet, -q
: Specify this option to reduce the output of the command. This value is optional. The default value is false.





 Example 

ibmcloud ce registry get --name myregistry





 Example output 

Getting image registry access secret myregistry...
OK

Name: myregistry
Project: myproject
Project ID: 01234567-abcd-abcd-abcd-abcdabcd1111
Created: 2021-02-23T09:10:01-05:00
Data:
---
.dockerconfigjson: abcdabcdabcdabcdabcdnVzZXJuYW1lIjoiaWFtYXBpa2V5IiwicGFzc3dvcmQiOiJoQllTSTc5Uk8yQUIxSDV3RUs2UzhScV9uNzE4NkQ1eWt1M1FOUk85aFpfaCIsImVtYWlsIjoiYUBiLmMiLCabcdabcdabcdabcdabcdT21oQ1dWTkpOemxTVHpKQlFqRklOWGRGU3paVE9GSnhYMjQzTVRnMlJEVjabcdabcdabcdabcdabcdbG9XbDlvIn19fQ==







 ibmcloud ce registry list 

List all image registry access secrets in a project.

ibmcloud ce registry list [--output OUTPUT] [--quiet] [--sort-by SORT_BY]



 Command Options 

--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.

--quiet, -q
: Specify this option to reduce the output of the command. This value is optional. The default value is false.

--sort-by, -s
: Specifies the column by which to sort the list. Valid values are name and age. This value is optional. The default value is name.





 Example 

ibmcloud ce registry list





 Example output 

Listing image registry access secrets...

OK

Name Age
myregistry 19m22s







 ibmcloud ce registry update 

Update an image registry access secret.
One of: JSON.
* -q, --quiet: Suppress verbose output.



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







 ibmcloud is snapshot-clone-delete 

Delete zonal snapshot clones in one or more zones.

ibmcloud is snapshot-clone-delete SNAPSHOT (ZONE_NAME1 ZONE_NAME2 ...) [--output JSON] [-f, --force] [-q, --quiet]



 Command examples 



* ibmcloud is snaphost-clone-delete r134-77e21079-7291-44c2-866a-8f1848bc10f0 --zone us-south-2
* ibmcloud is snapshot-clone-delete aaa-default-snapshot-2 us-east-1







 Command options 



* SNAPSHOT: ID or Name of the snapshot.
* ZONE_NAME1: The zone name that this snapshot clone resides in.
* ZONE_NAME2: The zone name that this snapshot clone resides in.
* --output: Specify output format, only JSON is supported. One of: JSON.
* --force, -f: Force the operation without confirmation.
* -q, --quiet: Suppress verbose output.



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







 ibmcloud is snapshot-clones 

List all zonal snapshot clones.

ibmcloud is snapshot-clones SNAPSHOT [--output JSON] [-q, --quiet]



 Command examples 



* ibmcloud is snapshot-clones aaa-default-snapshot-2
* ibmcloud is snapshot-cls f0542d32-2c92-4f64-9d25-8469a5bef29d







 Command options 



* SNAPSHOT: ID or Name of the snapshot.
* --output: Specify output format, only JSON is supported. One of: JSON.
Currently only JSON file format is supported. 
 --json or -j Deprecated Prints the output in the JSON format. 



Example

ibmcloud schematics output --id myworkspace3_2-31cf7130-d0c4-4d





 ibmcloud schematics plan 

Scan the Terraform template in your source repository and compare this template against the IBM Cloud resources that are already deployed. The command-line output shows the IBM Cloud resources that must be added, modified, [persisted](https://cloud.ibm.com/docs/schematics?topic=schematics-general-faqpersist-file), or removed to achieve the state that is described in your configuration file. IBM Cloud Schematics supports 50 API requests per minute, per host, and per customer. The host can be us-east, us-south, eu-gb, or eu-de region. You need to wait before calling the command again.

Your workspace must be in an Inactive, Active, Failed, or Stopped state to perform a Schematics plan action.

During the creation of the Terraform execution plan, you cannot make any changes to your workspace.

Syntax

ibmcloud schematics plan --id WORKSPACE_ID [--output OUTPUT] [--json]

Command options



Schematics output flags

 Flag Required / Optional Description 

 --id or -i Required The unique identifier of the workspace that points to the Terraform template in your source repository that you want to scan. 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 plan --id myworkspace-a1aa1a1a-a11a-11 --json







 Resource query commands 

Dynamically build resource inventories by using resource queries.
Create resource from JSON file with parent ID a0ef1-d3b4j0:

ibmcloud catalog entry-create -c @entry.json -p 'a0ef1-d3b4j0'







 ibmcloud catalog entry-update 

Update an existing catalog entry (catalog admin or editor of an account only):

ibmcloud catalog entry-update ID [-c PARAMETERS_AS_JSON] [--global]



 Command options 

-c
: Valid JSON object that contains catalog-specific configuration parameters, provided either inline or in a file. For a list of supported configuration parameters, see documentation for the particular catalog entry.

--global
: Operate in global scope





 Examples 

Update resource j402-dnf1i from JSON file:

ibmcloud catalog entry-update 'j402-dnf1i' -c update







 ibmcloud catalog entry-delete 

Delete a catalog entry(catalog admin of an account only)

ibmcloud catalog entry-delete ID [--global]



 Command options 

--global
: Operate in global scope





 Examples 

Delete resource j402-dnf1i:

ibmcloud catalog delete j402-dnf1i







 ibmcloud catalog entry-visibility 

Get the visibility for a catalog entry(catalog admin of an account only)

ibmcloud catalog entry-visibility ID [--global]



 Command options 

--global
: Operate in global scope





 Examples 

Get visibility of resource j402-dnf1i in global scope:

ibmcloud catalog entry-visibility 'j402-dnf1i' --global







 ibmcloud catalog entry-visibility-set 

Update the visibility of an existing catalog entry(catalog admin of an account only):
authEndpoint = "https://iam.cloud.ibm.com/identity/token"
serviceEndpoint = "<endpoint>" // example: https://s3.us-south.cloud-object-storage.appdomain.cloud
)

// UUID
func random(min int, max int) int {
return rand.Intn(max-min) + min
}

func main() {

// UUID
rand.Seed(time.Now().UnixNano())
UUID := random(10, 2000)

// Variables
newBucket := fmt.Sprintf("%s%d", "go.bucket", UUID) // New bucket name
objectKey := fmt.Sprintf("%s%d%s", "go_file_", UUID, ".txt") // Object Key
content := bytes.NewReader([]byte("This is a test file from Go code sample!!!"))
downloadObjectKey := fmt.Sprintf("%s%d%s", "downloaded_go_file_", UUID, ".txt") // Downloaded Object Key

//Setting up a new configuration
conf := aws.NewConfig().
WithRegion("<storage-class>"). // Enter your storage class (LocationConstraint) - example: us-standard
WithEndpoint(serviceEndpoint).
WithCredentials(ibmiam.NewStaticCredentials(aws.NewConfig(), authEndpoint, apiKey, serviceInstanceID)).
WithS3ForcePathStyle(true)

// Create client connection
sess := session.Must(session.NewSession()) // Creating a new session
client := s3.New(sess, conf) // Creating a new client

// Create new bucket
_, err := client.CreateBucket(&s3.CreateBucketInput{
One of: JSON.
* --interactive, -i:
* -q, --quiet: Suppress verbose output.



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







 ibmcloud is instance-template-create-override-source-template 

Create an instance template by overriding a source template.

ibmcloud is instance-template-create-override-source-template --source-template SOURCE_TEMPLATE [--name NAME] [--profile PROFILE] [--zone ZONE] [--vpc VPC] [--image IMAGE | --catalog-offering CATALOG_OFFERING | --catalog-offering-version CATALOG_OFFERING_VERSION] [--total-volume-bandwidth TOTAL_VOLUME_BANDWIDTH] [--boot-volume BOOT_VOLUME_JSON | @BOOT_VOLUME_JSON_FILE] [--volume-attach VOLUME_ATTACH_JSON | @VOLUME_ATTACH_JSON_FILE] [--keys KEYS] [--dedicated-host DEDICATED_HOST | --dedicated-host-group DEDICATED_HOST_GROUP | --placement-group PLACEMENT_GROUP] [--user-data DATA] [(--subnet SUBNET --rip RIP | (--address ADDRESS --auto-delete true | false --ip-name IP_NAME)] --sgs SGS] --allow-ip-spoofing false | true]) | --primary-network-interface PRIMARY_NETWORK_INTERFACE_JSON | @PRIMARY_NETWORK_INTERFACE_JSON_FILE] [--network-interface NETWORK_INTERFACE_JSON | @NETWORK_INTERFACE_JSON_FILE] [--metadata-service, --ms true | false --metadata-service-protocol, --msp http | https | --metadata-service-response-hop-limit, --msrhl METADATA_SERVICE_RESPONSE_HOP_LIMIT,MSRHL]] [--host-failure-policy restart | stop] [--resource-group-id RESOURCE_GROUP_ID | --resource-group-name RESOURCE_GROUP_NAME] [--output JSON] [-q, --quiet]



 Command examples
For more information, see the [Resource Groups FAQ](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-ibm-cloud-resource-groups) about how to migrate.



 IBM Cloudant API keys and Use only IAM 

Use of IBM Cloudant API keys alongside IAM is possible but not recommended. This recommendation is made because IBM Cloudant API keys and permissions are not visible or manageable by using the IAM policy interface, rendering holistic access management impossible.

The choice between Use only IAM or Use both legacy credentials and IAM affects the following factors:



1. Whether legacy IBM Cloudant account-level credentials are available to manage databases and other account-level actions.
2. The style of credentials that are delivered during service credential generation.



In particular, IBM Cloudant API keys can still be used to manage database access. These credentials must be generated and configured by using the HTTP API.





 Provisioning by using the command line 

When you provision a new IBM Cloudant instance from the command line, provide an option to the ibmcloud tool by using the -p parameter to enable or disable legacy credentials for an account. The option is passed in JSON format and is called legacyCredentials.

To provision an instance as Use only IAM (recommended), run the following command:

ibmcloud resource service-instance-create "Instance Name" cloudantnosqldb Standard us-south -p {"legacyCredentials": false}

When you use IAM roles other than Manager, such as Reader, Writer, Monitor, or Checkpointer, you must use Use only IAM to avoid supplying users with legacy credentials that include greater access permissions.

To provision an instance as Use both legacy credentials and IAM, run the following command:

ibmcloud resource service-instance-create "Instance Name" cloudantnosqldb Standard us-south -p {"legacyCredentials": true}





 Service credential JSON examples for each option 

The choice between Use only IAM and Use both legacy credentials and IAM access control affects how credentials are delivered to your application when you bind and generate service credentials.
deviceID: {'$eq': 'device-123456'}
}
service.postPartitionFind({
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'}}
).get_result()

print(response)

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

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. For more information, see the API documentation's [Authentication section](https://cloud.ibm.com/apidocs/cloudant?code=goauthentication-with-external-configuration) for examples.





 Querying for recent results for a device
Data is stored in triplicate in IBM Cloudant, so each shard of a database is stored multiple times, often across a region's availability zones.

When you make an API call to write data and get a response back, we write the data to at least two of the three storage nodes. Data is flushed to disk - it isn't cached in memory to be flushed data. We consider that technique too risky and prone to data loss.

When you create a database, a number of database shards are created (16 by default) which are spread around the cluster. Three copies of each shard exist, which equals 48 shard copies.

You don't see any of this activity. The activity is handled for you transparently when you create a database.

What happens if a node goes down or needs to be rebooted for maintenance? The rest of the cluster continues as normal. Most shards still have three copies of data but some have only two. API calls continue to work as normal, only two copies of the data are written.

Even if two nodes go down, most shards still have three copies, some have two, and some have one. Writes continue to work, although the HTTP response code reflects that the quorum of two node confirmations wasn't reached.

It's the same story for reads. Service continues with a failed node. We can survive one failed node...

Or more failed nodes. If a copy of each node exists, the API continues to function.

When a node returns, it catches up any missed data from its peers and then returns into service, handling API calls and answering queries for data.

The nature of this configuration is that IBM Cloudant exhibits eventual consistency. Any node can handle a request. Data is distributed around nodes without the sort of locking that you might see in a relational database.

IBM Cloudant favors availability over consistency: It would rather be up and answering API calls than be down because it can't provide consistency guarantees. (A relational database is often configured in the opposite way: It operates in a consistent manner or not at all.) The upshot of eventual consistency for a developer is that your app must not read its writes in a short time.
* Unique to IBM Cloudant.
* Access to each service instance requires its own set of credentials.
* Uses HTTP basic authentication with credentials that aren't bound to an individual user or service.









The Use only IAM mode means that only IAM credentials are provided through service binding and credential generation. You gain the following advantages when you use IBM Cloud IAM:



* Managing access to IBM Cloudant with the standard tooling of IBM Cloud.
* Using credentials that you can easily revoke and rotate when you use IBM Cloud IAM.



For more information about the advantages and disadvantages between these modes, see [Advantages and disadvantages of the two access control mechanisms](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudantadvantages-and-disadvantages-of-the-two-access-control-mechanisms-ai).





When you create a new IBM Cloudant instance from the command line, you must include the ibmcloud tool by using the -p parameter. This parameter enables or disables legacy credentials for an account by passing the option in JSON format. The option is called legacyCredentials.

To create an instance as Use only IAM, run the following command:

ibmcloud resource service-instance-create "Instance Name" 
cloudantnosqldb Standard us-south 
-p '{"legacyCredentials": false}'

If you don't use Use only IAM mode when you use the IAM Reader and Writer roles, you might grant users legacy credentials with more access permissions than you intended.





You can generate service credentials in the primary IBM Cloud IAM interface. When you select Use only IAM, service credentials include only IAM values. The service credential JSON looks like the following example:

{
"apikey": "MxVp86XHkU82Wc97tdvDF8qM8B0Xdit2RqR1mGfVXPWz",
"host": "2922d728-27c0-4c7f-aa80-1e59fbeb04d0-bluemix.cloudant.com",