vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Exporting an image to IBM Cloud Object Storage 

From the Image Templates page, you can export an image template to an [IBM Cloud® Object Storage](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-about-cloud-object-storage) account.

The image export process takes a preexisting, private standard image template, or an encrypted image template and coverts the image into an image file that is stored in a specified location on an IBM Cloud Object Storage account.

If you imported a VMDK image, you can export that image in VHD or VMDK format. Because of the differences between the image formats, a chance of data loss exists. To protect your data if data loss occurs, the original VHD file is retained.



 Before you begin 

First, go to the device menu and make sure that you have the correct account permissions to complete the tasks.



* Go to your console's device menu. For more information, see [Navigating to devices](https://cloud.ibm.com/docs/image-templates?topic=virtual-servers-navigating-devices).
* Make sure that you have write access to IBM Cloud Object Storage. Only the account owner, or a user with the Manage Users classic infrastructure permission, can adjust the permissions.



For more information about permissions, see [Classic infrastructure permissions](https://cloud.ibm.com/docs/account?topic=account-infrapermissioninfrapermission) and [Managing device access](https://cloud.ibm.com/docs/virtual-servers?topic=virtual-servers-managing-device-access).

If you plan to export this image template to IBM Cloud Object Storage, make sure the image template name does not contain any characters that can be problematic in a web address. For example, ?, =, <, and other special characters might cause unwanted behavior if not URL-encoded.





 Exporting an image to IBM Cloud Object Storage 

Use the following steps to export an image template to IBM Cloud Object Storage.



1. From the Devices menu, select Manage > Images.
2.
In IBM Cloud Console, create an instance of IBM Cloud Object Storage and create a bucket to store the data. For more information, see the [Getting started tutorial for IBM Cloud Object Storage](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-getting-started-cloud-object-storage-cloud-object-storage)



1. Create the IBM Cloud Object Storage instance in the region where your key management service is provisioned.
2. When you create the bucket, the Resiliency setting must be Regional.
3. Optionally, when you create the bucket, you can [encrypt it with your DEK](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-encryption).









 Preparing your encrypted images 



1. Select an unencrypted image that works in the IBM Cloud infrastructure environment that you want to encrypt. One option is to use an existing virtual server to [create an image template](https://cloud.ibm.com/docs/image-templates?topic=image-templates-creating-an-image-templatecreating-an-image-template). For more information, see [Work with an image template that was created from a cloud-init provisioned virtual server](https://cloud.ibm.com/docs/image-templates?topic=image-templates-provisioning-with-a-cloud-init-enabled-imagework-with-an-image-template-created-from-a-cloud-init-provisioned-virtual-server). You can also use an existing VHD image. Make sure that the image meets [encrypted image requirements](https://cloud.ibm.com/docs/image-templates?topic=image-templates-encrypted-image-reqsencrypted-image-reqs).
2.
PUT /{db}/{docid}/{attname} <br>[Cloudant](https://cloud.ibm.com/apidocs/cloudantputattachment), [CouchDB](https://docs.couchdb.org/en/latest/api/document/attachments.htmlput--db-docid-attname) Upload the supplied content as an attachment to the specified document. For IBM Cloudant, use {attachment_name} instead of {attname}. 
 DELETE /{db}/{docid}/{attname} <br>[Cloudant](https://cloud.ibm.com/apidocs/cloudantdeleteattachment), [CouchDB](https://docs.couchdb.org/en/latest/api/document/attachments.htmldelete--db-docid-attname) Delete the attachment associated with the specified doc. For IBM Cloudant, use {attachment_name} instead of {attname}.
[IBM Cloud Object Storage](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-getting-started-cloud-object-storage) You can use IBM Cloud Object Storage to store unstructured data in the IBM Cloud. [View docs](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-kp) 







 Compute service integrations 

You can integrate Key Protect with the following compute services.



Table 3. Supported compute services.

 Service Description Integration docs 

 [IBM Cloud image templates](https://cloud.ibm.com/docs/image-templates?topic=image-templates-getting-started-with-image-templatesgetting-started-with-image-templates) You can use IBM Cloud image templates to capture an image of a virtual server to quickly replicate its configuration with minimal changes in the order process. With the End to End (E2E) Encryption feature, you can bring your own encrypted, cloud-init enabled operating system image. [View docs](https://cloud.ibm.com/docs/image-templates?topic=image-templates-using-end-to-end-e2e-encryption-to-provision-an-encrypted-instanceusing-end-to-end-e2e-encryption-to-provision-an-encrypted-instance) 
 [KMIP for VMware](https://cloud.ibm.com/docs/vmwaresolutions?topic=vmwaresolutions-kmip_standalone_considerations) KMIP for VMware works together with VMware native vSphere encryption and vSAN encryption to provide simplified storage encryption management together with the security and flexibility of Key Protect or Hyper Protect Crypto Services customer-managed keys. [View docs](https://cloud.ibm.com/docs/vmwaresolutions?topic=vmwaresolutions-kmip_standalone_considerations)
Also, your image can't be used with a bare metal profile or instance groups, or encrypted. An image can only be added to one product within one private catalog at a time. If the image you want to import is already imported into another product, you must remove the image from that product or delete the product before you add the image to a new product.
5. Enter the software version, for example, 1.0.0.
6. Select Developer tools as the category.
7. Click Add product.







 Step 3: Review the image details 



1. From the Version list table, click the row that contains your virtual server image.
2. Review your images and click Add region if you want to add an image from another region. Images that you add must have the same digest or checksum as the original image that you added in step 2.
3. After you review your images, click Next.







 Step 4: Review the version details 

Review the details of this version of your software, and click Next.





 Step 5: Set the license requirements 

If users are required to accept any license agreements beyond the IBM Cloud Services Agreement, provide the URL to each agreement. Or, if users can bring their own licenses, you can provide that URL as well.



1. Click Add license.
2. Enter the name and URL of the license, and click Add license.
3. Click Next.







 Step 6: Edit your readme file 

Use the [readme file template](https://cloud.ibm.com/media/docs/downloads/software/sw-readme-tab-template.md) to document the instructions for installing your software. For the purposes of this tutorial, the following steps describe how to edit the description of the readme file.



1. Click the Edit icon ![Edit icon](https://cloud.ibm.com/docs-content/v1/content/4d8c6eec891cff72b666dc24bd3211810c77fb42/icons/edit-tagging.svg).
2.
(https://cloud.ibm.com/docs-content/v1/content/b6066ebcc4ff31f2a8b558531f2ee791d108a7e1/cloud-pak-multicloud-management/images/buckets.png)

Figure 3. Example Standard type bucket created
2. Upload the CloudForms installation image (file name: cfme-rhos-5.11.4.x86_64.qcow2) to your IBM Cloud Object Storage. Select your bucket and click Add Objects to upload the images. For more information, see [Uploading data by using the console](https://cloud.ibm.com/docs/services/cloud-object-storage?topic=cloud-object-storage-uploadupload-console). Note: You can use the Aspera high-speed transfer plug-in to upload images larger than 200 MB.

Zoom

![Figure showing example that uses Aspera uploaded file to bucket.](https://cloud.ibm.com/docs-content/v1/content/b6066ebcc4ff31f2a8b558531f2ee791d108a7e1/cloud-pak-multicloud-management/images/upload_images_to_bucket.png)

Figure 4. Example using Aspera uploaded file to bucket
3. From IBM Cloud Identity and Access Management (IAM), create an authorization between the Virtual Private Cloud (VPC) Infrastructure (source service) > Image Service for VPC (resource type) and Cloud Object Storage (target service). For more information, see [Create an authorization](https://cloud.ibm.com/docs/iam?topic=iam-serviceauthserviceauth).

Important: The configuration must be set up as this example or permissions can fail.

Zoom

![Figure showing example IAM authorization.]
If you plan to export this image template to IBM Cloud Object Storage, make sure the image template name does not contain any characters that can be problematic in a web address. For example, ?, =, <, and other special characters might cause unwanted behavior if not URL-encoded.





 Exporting an image to IBM Cloud Object Storage 

Use the following steps to export an image template to IBM Cloud Object Storage.



1. From the Devices menu, select Manage > Images.
2. Click Actions for the image template that you want to export and select Export Image to IBM COS. If an image template with the configuration that you want is not yet available, see [Creating an Image Template](https://cloud.ibm.com/docs/image-templates?topic=image-templates-creating-an-image-templatecreating-an-image-template).
3. Complete the required fields (see table 1).
4. Click OK to export the image to the specified location in the IBM Cloud Object Storage Account.





 Field Value 

 File Name Enter the file name for the image. 
 IBM Cloud Object Storage Select an IBM Cloud Object Storage account. 
 Location Select the specific geographic region where you want the image template stored. 
 Bucket Select the IBM Cloud Object Storage bucket where you want the image template stored. Only buckets that exist in the regional location that you selected are valid. An error message is displayed if you specify a bucket that doesn't exist in the selected location. 
 API Key Specify the service ID API key that has write access to IBM Cloud Object Storage. For more information, see [Managing service ID API keys](https://cloud.ibm.com/docs/account?topic=account-serviceidapikeysserviceidapikeys). 
 Target file type Select the file type that you want to export. If you imported a VMDK image, you can export that image in VHD or VMDK format. If the file was originally in VHD format, you can export only as VHD. 







 Next Steps 

Because each image is a different size and has different characteristics, the export process might take several minutes before it completes.
IBM Cloudant backup and recovery 

Although data is stored redundantly within an IBM Cloudant cluster, it's important to consider extra backup measures. For example, redundant data storage doesn't protect against mistakes when data is changed.

Review the [IBM® Cloudant® for IBM Cloud® Disaster Recovery guide](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-disaster-recovery-and-backupdisaster-recovery-and-backup) to understand where backup fits in with the other features that IBM Cloudant offers to support Disaster Recovery (DR) and High Availability (HA) requirements.



 Introducing CouchBackup 

IBM Cloudant provides a supported tool for snapshot backup and restore. The tool is called CouchBackup, and is open source. It's a node.js library, and you can install it on [NPM](https://www.npmjs.com/package/@cloudant/couchbackup).

The CouchBackup package includes the library and two command-line tools:



1. couchbackup, which dumps the JSON data from a database to a backup text file.
2. couchrestore, which restores data from a backup text file to a database.



The CouchBackup tools have [limitations](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-ibm-cloudant-backup-and-recoverylimitations).





 Backing up your IBM Cloudant data 

You can do a simple backup by using the couchbackup tool. To back up the animaldb database to a text file called backup.txt, you might use a command similar to the following example:

couchbackup --url "$SERVICE_URL" --db animaldb > backup.txt

The [NPM readme file](https://github.com/cloudant/couchbackup/blob/master/README.md) details other options, including the ones in this list:



* Environment variables to set the names of the database and URL.
* Using a log file to record the progress of a backup.
* The ability to resume an interrupted backup.
For more information, see [ibmcloud is image](https://cloud.ibm.com/docs/vpc?topic=vpc-infrastructure-cli-plugin-vpc-referenceimage) in the VPC CLI reference page.





 Retrieving custom image details by using the API 

You can view the details of a custom image, such as name and ID, operating system and version, encryption status, deprecation or obsolescence dates, and assigned resource group, by using the application programming interface (API).

To retrieve the details of a specific custom image by using the API, use [Retrieve an image](https://cloud.ibm.com/apidocs/vpc/latestget-image). For the$image_id variable, specify the ID of the custom image that you want to retrieve.

curl -X GET ”$vpc_api_endpoint/v1/images/$image_id?version=2022-11-21&generation=2" -H "Authorization: Bearer $iam_token"





 Exporting a custom image to IBM Cloud Object Storage 

You can export a custom image to IBM Cloud Object Storage. Later, you might want to copy the image to a new region by importing it again, or you might want to extract the image outside of VPC for use in a different location, such as on premises. Charges might be incurred for storing images in IBM Cloud Object Storage. For more information, see [Billing](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-billing).



 Prerequisites 

To export a custom image, you must meet the following prerequisites:



* You need an IAM role that includes the is.image.image.export and is.image.image.operate actions. For more information, see [Managing IAM access for VPC Infrastructure Services](https://cloud.ibm.com/docs/vpc?topic=vpc-iam-getting-started).
* You need an IBM Cloud Object Storage service instance created. You must also create an authorization for the Image Service for VPC to access IBM Cloud Object Storage with the Writer service access role.
Creating a document 

The steps that are shown here demonstrate how to create a document.



1. Send a POST request with the document's JSON content to create a document.
2. Run the following command: https://$ACCOUNT.cloudant.com/$DATABASE.





 Creating a document by using HTTP 

The following steps show you how to create a document by using HTTP.



1. Send a PUT request with the document's JSON content by using HTTP to create a document.
2. Run the following command:



PUT /$DATABASE/$DOC_ID HTTP/1.1
Content-Type: application/json





 Examples of how to create a document 

See an example of creating an IBM Cloudant document for this JSON in a nonpartitioned database:

{

"type": "event",
"userid": "abc123",
"eventType": "addedToBasket",
"productId": "1000042",
"date": "2019-01-28T10:44:22.000Z"

}

You can customize creating a document for the programming language that you want to use by selecting the language in the code examples.

See an example of creating a document:



* Curl
* Java
* Python
* Go
* Node



curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X PUT "$SERVICE_URL/events/0007241142412418284" -H "Content-Type: application/json" --data '{ "type": "event", "userid": "abc123", "eventType": "addedToBasket", "productId": "1000042", "date": "2019-01-28T10:44:22.000Z }'

import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.Document;
import com.ibm.cloud.cloudant.v1.model.DocumentResult;
ibmcloud is image-create my-ubuntu-16-amd64 --file cos://us-south/custom-image-vpc-bucket/customImage-0.qcow2 --os-name ubuntu-16-amd64 --deprecate-at 2023-03-01T06:11:28+05:30 --obsolete-at 2023-12-31T06:11:28+05:30

For more information, see [ibmcloud is image-create](https://cloud.ibm.com/docs/vpc?topic=vpc-vpc-referenceimage-create)in the VPC CLI reference page.







 Importing a custom image by using the API 

Make sure that your compatible custom image is available in IBM Cloud Object Storage. For more information, see [Creating a Linux custom image](https://cloud.ibm.com/docs/vpc?topic=vpc-create-linux-custom-image), [Creating a Windows custom image](https://cloud.ibm.com/docs/vpc?topic=vpc-create-windows-custom-image), [Bring your own license](https://cloud.ibm.com/docs/vpc?topic=vpc-byol-vpc-about) and [Uploading data](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-upload) to IBM Cloud Object Storage.

When you have an image available in IBM Cloud Object Storage, you can import it to IBM Cloud VPC infrastructure by using the application programming interface (API).

To import a custom image by using the API, use [Create an image](https://cloud.ibm.com/apidocs/vpc/latestcreate-image).

Specify the file.href subproperty with the location of the image. Specify the operating_system.name subproperty with the name of the image operating system.
Use the vhd-util tool to [encrypt your VHD image](https://cloud.ibm.com/docs/image-templates?topic=image-templates-create-encrypted-image).
5. In IBM Cloud Object Storage, navigate to your bucket and click Add Objects to [upload](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-upload) the encrypted image. You can use the Aspera high-speed transfer plug-in to upload images larger than 200 MB.



If you're interested in automating image encryption, check out this IBM Cloud [blog post](https://www.ibm.com/cloud/blog/automate-the-encryption-of-a-virtual-server-image-for-deployment-onto-classic-infrastructure).





 Importing an encrypted image and ordering an instance 



1. Using IBM Cloud Identity and Access Management (IAM), create a service ID to authenticate with when you import the encrypted image into IBM Cloud console.



1. Create a [service ID](https://cloud.ibm.com/docs/account?topic=account-serviceidsserviceids).
2. Assign an [access policy](https://cloud.ibm.com/docs/account?topic=account-userrolespolicytypes). Assign access for these services: IBM Cloud Object Storage and key management.
3. Create an [API key for a service ID](https://cloud.ibm.com/docs/account?topic=account-serviceidapikeyscreate_service_key).
4. For more information, see [Introducing IBM Cloud IAM Service IDs and API Keys](https://www.ibm.com/cloud/blog/introducing-ibm-cloud-iam-service-ids-api-keys).



2.
Building applications that store information in IBM Cloudant 

Learn how to build your Code Engine application from source code that is stored on your local workstation. This tutorial uses sample source that is used to build the app. This application connects to an IBM Cloudant database and stores input from that app.

A build, or image build, is a mechanism that you can use to create a container image from your source code. Code Engine supports building from a Dockerfile and Cloud Native Buildpacks.

Before you begin



* [Set up your Code Engine CLI environment](https://cloud.ibm.com/docs/codeengine?topic=codeengine-install-cli).
* [Create and work with a project](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project).
* [Git](https://git-scm.com/downloads)
* [Node.js and NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)



All Code Engine users are required to have a Pay-as-you-Go account. Tutorials might incur costs. Use the Cost Estimator to generate a cost estimate based on your projected usage. For more information, see [Code Engine pricing](https://cloud.ibm.com/docs/codeengine?topic=codeengine-pricing).



 Step 1: Create an IBM Cloudant service instance and database 

Your first step is to create an IBM Cloudant service instance and then create a database. You can create one [from the console](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant) or by using CLI commands. In addition, create service credentials that you can pass to your application.



1. Create an IBM Cloudant service instance, follow the steps in [Getting started with IBM Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant).
In this exercise, you create the dashboard-demo[database](https://cloud.ibm.com/apidocs/cloudantputdatabase), which is the database that you use in this tutorial.



1. From the IBM Cloudant Dashboard, click Create database.

The Create database window opens.
2. Enter the database name dashboard-demo.
3. Select Non-partitioned, and click Create.

The dashboard-demo database opens automatically.



Now, you can create some documents.





 Step 3: Adding documents to the database 

The [documents](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-documentsdocuments) that you create in this exercise include the data that you use to query the dashboard-demo database in later exercises.



1. Click Create document.

The New Document window opens.
2. Copy the following sample text and replace the existing text in the new document. Use the following sample text for document 1:

{
"firstname": "Sally",
"lastname": "Brown",
"age": 16,
"location": "New York City, NY",
"_id": "doc1"
}
3. Repeat steps 1 and 2 to add the remaining four documents to the database. Use the following sample text for document 2:

{
"firstname": "John",
"lastname": "Brown",
"age": 21,
"location": "New York City, NY",
"_id": "doc2"
}

Use the following sample text for document 3:

{
"firstname": "Greg",
"lastname": "Greene",
"age": 35,
"location": "San Diego, CA",
"_id": "doc3"
}

Use the following sample text for document 4:

{
"firstname": "Anna",
"lastname": "Greene",
"age": 44,
From the IBM Cloudant Dashboard, select the books database.
2. Select the Design Documents tab.
3. Select New View from the menu.
4. Keep New document in the drop-down field.
5. Enter a name in the Index name field. This name is the new view name.
6. Select _count from the Reduce (optional) drop-down menu. This way our results are counted.
7. Paste the following code into the Map function field:

function (doc) {
emit(doc.year, null);
}

See an example of the window in the following screen capture:

Zoom

![To create a new MapReduce view, add a design document name; add _design documents; add an Index name, and add a Map function.](https://cloud.ibm.com/docs-content/v1/content/522c6f62358b063f921283400a601c3f9bc66f08/Cloudant/images/indexingdashboard6.png)

Figure 4. New View window

The subsequent MapReduce view allows documents to be found by year (as that is the key of the index). But if we select the checkbox for the Reduce function from the Options pull-down menu, the index aggregates the results, grouping by key (year):

Zoom

![The subsequent MapReduce view allows documents to be found by year (as that is the key of the index). But if we select the checkbox for the Reduce function from the Options pull-down menu, the index aggregates the results, grouping by key (year).](https://cloud.ibm.com/docs-content/v1/content/522c6f62358b063f921283400a601c3f9bc66f08/Cloudant/images/indexingdashboard7.png)

Figure 5. Windows for running queries

See an example result from after the index aggregated the results.

Zoom