vania-janet/multiturn-rag-retrieval-data huggingface dataset:
The topic itself points out the danger of deletion: data will be lost. Of course, when that is the goal, caution should be exercised that only the targeted deletions should occur. Check—and double-check—instances, bucket names, and any prefixes or paths that need to be specified.



 Overview 

The code pattern in this exercise configures a client before creating one for the purpose of gathering a list of items for the purpose of deleting each object.

The code pattern in this exercise configures a client before creating one for the purpose of gathering a list of items for the purpose of deleting each object.

The code pattern in this exercise configures a client before creating one for the purpose of gathering a list of items for the purpose of deleting each object.

The code pattern in this exercise configures a client before creating one for the purpose of gathering a list of items for the purpose of deleting each object.



* Java
* Python
* Go
* Node



package com.cos;

import java.sql.Timestamp;
import java.util.List;

import com.ibm.cloud.objectstorage.ClientConfiguration;
import com.ibm.cloud.objectstorage.SDKGlobalConfiguration;
import com.ibm.cloud.objectstorage.auth.AWSCredentials;
import com.ibm.cloud.objectstorage.auth.AWSStaticCredentialsProvider;
import com.ibm.cloud.objectstorage.auth.BasicAWSCredentials;
import com.ibm.cloud.objectstorage.client.builder.AwsClientBuilder.EndpointConfiguration;
import com.ibm.cloud.objectstorage.services.s3.AmazonS3;
import com.ibm.cloud.objectstorage.services.s3.AmazonS3ClientBuilder;
import com.ibm.cloud.objectstorage.services.s3.model.Bucket;
import com.ibm.cloud.objectstorage.services.s3.model.ListObjectsRequest;
Key is not in a valid state

Reason code: KEY_ACTION_INVALID_STATE_ERR





 HTTP status code 

409 - Conflict

The HTTP 409 Conflict response status code indicates a request conflict with current state of the server.

Conflicts are most likely to occur in response to a PUT request. For example, you may get a 409 response when uploading a file which is older than the one already on the server resulting in a version control conflict.





 Context 

This error occurs when an "action" is performed on a key and the [key state](https://cloud.ibm.com/docs/key-protect?topic=key-protect-key-states) is not valid.

Some actions to consider:



* The key state must be active (state value is 1) to wrap, unwrap, rotate, set key for deletion (dual auth), unset key for deleteion (dual auth), or disable the key
* This error occurs when you try to enable an expired key (state value is 3) or restore a key that has been destroyed (state value is 5)





 Example 1 

The key disable request fails because you cannot disable a key that was previously disabled.

 disable a key the first time
$ ibmcloud kp key disable $KEY_ID -i $KP_INSTANCE_ID

Disabling key: '6933...<redacted>...5dbf', in instance: 'a192...<redacted>...7411'...
OK

 this CLI request fails because the key is deleted a second time
$ ibmcloud key disable $KEY_ID -i $KP_INSTANCE_ID

Disabling key: '69332...<redacted>...5dbf', in instance: 'a192...<redacted>...7411'...
FAILED
kp.Error:
correlation_id='aca1...<redacted>...66e9',
msg='Conflict:
Key is not in active state:
Boot volumes are detached and deleted when the instance is deleted.





 What happens to my data when I delete a Block Storage for VPC data volume? 

When you delete a Block Storage for VPC volume, your data immediately becomes inaccessible. All pointers to the data on that volume are removed. The inaccessible data is eventually overwritten as new data is written to the data block. IBM guarantees that data deleted cannot be accessed and that deleted data is eventually overwritten. For more information, see [Block Storage for VPC data eradication](https://cloud.ibm.com/docs/vpc?topic=vpc-managing-block-storageblock-storage-data-eradication).





 I have compliance requirements for data deletion. What can I do to ensure that my data is inaccessible? 

IBM guarantees that your data is inaccessible on the physical disk and is eventually [eradicated](https://cloud.ibm.com/docs/vpc?topic=vpc-managing-block-storageblock-storage-data-eradication). If you have extra compliance requirements such as NIST 800-88 Guidelines for Media Sanitization, you must perform data sanitation procedures before you delete your volumes. For more information, see the [NIST 800-88 Guidelines for Media Sanitation](https://csrc.nist.gov/publications/detail/sp/800-88/rev-1/final).





 What rules apply to volume names and can I rename a volume later on? 

Valid volume names can include a combination of lowercase alphanumeric characters (a-z, 0-9) and the hyphen (-), up to 63 characters. Volume names must begin with a lowercase letter and be unique across the entire VPC infrastructure.

You can change the name of an existing volume in the UI. For more information, see [Managing Block Storage for VPC](https://cloud.ibm.com/docs/vpc?topic=vpc-managing-block-storagerename).





 Does the volume need to be pre-warmed to achieve expected throughput? 

You do not have to pre-warm a volume.
The HTTP 409 Conflict response status code indicates a request conflict with current state of the server.

Conflicts are most likely to occur in response to a PUT request. For example, you may get a 409 response when uploading a file which is older than the one already on the server resulting in a version control conflict.





 Context 

This error occurs when a key, used for "Registrations", is deleted.

In most cases, a key with registrations can be deleted using the --force option.

If the registered resource has preventKeyDeletion set to true, then a force delete will fail and this error mesage will be shown.

In other words, all registrations must have preventKeyDeletion set to false.

Registrations are associations between root keys and other cloud resources, such as Cloud Object Storage (COS) buckets or Cloud Databases deployments.

For more information about Registrations, see [viewing associations between root keys and encrypted IBM Cloud resources](https://cloud.ibm.com/docs/key-protect?topic=key-protect-view-protected-resources).







 25 - The key is not dual auth enabled and... 



 Message 

The key is not dual auth enabled and cannot be set for deletion

Reason code: NOT_DUAL_AUTH_ERR





 HTTP status code 

409 - Conflict

The HTTP 409 Conflict response status code indicates a request conflict with current state of the server.

Conflicts are most likely to occur in response to a PUT request. For example, you may get a 409 response when uploading a file which is older than the one already on the server resulting in a version control conflict.





 Context 

This error occurs when you try to authorize a deletion or remove an authorization and the key does not have a dual authorization policy.

These examples show the error using the API and the CLI.



 Example 1 

This example attempts to authorize a deletion and remove an authorization using the API.

 create a root key
curl -X POST https://resource-controller.cloud.ibm.com/v2/resource_instances -H 'Authorization: Bearer <>' -H 'Content-Type: application/json' -d '{
"name": "my-instance",
"target": "blue-us-south",
"resource_group": "5g9f447903254bb58972a2f3f5a4c711",
"resource_plan_id": "databases-for-x-standard",
"disk_encryption_key_crn": "crn:v1:<...>:key:<id>"
}'

If you provision a deployment through the CLI or API, the HPCS key needs to be identified by its full CRN, not just its ID. An HPCS CRN is in the format crn:v1:<...>:key:<id>.





 Key Rotation 

HPCS offers manual and automatic [key rotation](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-set-rotation-policy) and key rotation is supported by Cloud Databases deployments. When you rotate a key, the process initiates a Syncing KMS state task, and your deployment is reencrypted with the new key. The task is displayed on the Tasks panel on your deployment's Overview and the associated HPCS and Cloud Databases events are sent to Activity Tracker.





 Deleting the Deployment 

If you delete a deployment that is protected with an HPCS key, the deployment remains registered against the key during the soft-deletion period (up to 9 days). If you need to delete the key in the soft-deletion period, you must [force delete](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-delete-keys) the key. After the soft-deletion period, the key can be deleted without the force.
Delete an image registry access secret.

ibmcloud ce registry delete --name NAME [--force] [--ignore-not-found] [--quiet]



 Command Options 

--name, -n
: The name of the image registry access secret. This value is required.

--force, -f
: Force deletion without confirmation. This value is optional. The default value is false.

--ignore-not-found, --inf
: If not found, do not fail. This value is optional. The default value is false.

--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 delete --name myregistry -f





 Example output 

Deleting image registry access secret myregistry...

OK







 ibmcloud ce registry get 

Display the details of an image registry access secret.

ibmcloud ce registry get --name NAME [--decode] [--output OUTPUT] [--quiet]



 Command Options 

--name, -n
: The name of the image registry access secret. This value is required.

--decode, -d
: Show the Data output as decoded in the details. If this option is not specified, the Data details are base64-encoded. This value is optional. The default value is false.

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





 Example 

ibmcloud ce registry get --name myregistry





 Example output
Delete a function.

ibmcloud ce function delete --name FUNCTION_NAME [--force] [--ignore-not-found] [--quiet]



 Command Options 

--name, -n
: The name of the function. This value is required.

--force, -f
: Force deletion without confirmation. This value is optional. The default value is false.

--ignore-not-found, --inf
: If not found, do not fail. This value is optional. The default value is false.

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





 Example 

ibmcloud ce fn delete --name myfunction





 Example output 

Are you sure you want to delete function 'myfunction'? [y/N]> y
Deleting function 'myfunction'...
OK







 ibmcloud ce function get 

Display the details of a function.

ibmcloud ce function get --name FUNCTION_NAME [--output OUTPUT] [--quiet] [--save SAVE]



 Command Options 

--name, -n
: The name of the function. This value is required.

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

--save, -s
: Save the source source code of the function to the local file system. This option is supported for only functions that were created with inline code. This value is optional.





 Example 

ibmcloud ce fn get --name myfunction





 Example output
A request to get a version of a key-value secret in the default secret group returns the following response:

{
"request_id": "400000-60000-8e000-0ad0-00000bc0000caebe",
"lease_id": "",
"renewable": false,
"lease_duration": 0,
"data": {
"data": {
"key": "value"
},
"metadata": {
"created_time": "2022-01-13T21:31:49.893962888Z",
"deletion_time": "",
"destroyed": false,
"version": 1
}
},
"wrap_info": null,
"warnings": null,
"auth": null
}







 Delete the latest version of a key-value secret 

Delete the latest version of a key-value secret. After you delete the version, you cannot retrieve it by using list or get API calls. However, it is a soft delete and the underlying data is not removed. You can undo the deletion by calling the [undelete](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-vault-manage-kv&interface=apikv-version-restore) API endpoint.



 Example request 

curl -X DELETE 'https://{instance_id}.{region}.secrets-manager.appdomain.cloud/v1/ibmcloud/kv/data/{secret_name}' -H 'Accept: application/json' -H 'X-Vault-Token: {Vault-Token}'



Table 3. Delete the latest version of a key-value secret request parameters

 Request parameter Description 

 instance_id The ID of the Secrets Manager instance. 
 region The region in which the Secrets Manager instance was created. 
 secret_name The name of the key-value secret. 
 Vault-Token The authentication token that is retrieved from Vault. 







 Example response
"status": "available"
}
]
}
]
}
Show more







 Deleting a speaker model 

To delete a speaker model, use the DELETE /v1/speakers/{speaker_id} method. Deleting a speaker model does not affect any prompts that are associated with the deleted speaker. The prosodic data that defines the quality of a prompt is established when the prompt is created. A prompt is static and remains unaffected by deletion of its associated speaker. However, the prompt cannot be resubmitted or updated with its original speaker once that speaker is deleted.



 Delete a speaker model example 

The following example deletes the speaker model that has the specified speaker ID:

IBM Cloud

curl -X DELETE -u "apikey:{apikey}" "{url}/v1/speakers/{speaker_id}"

IBM Cloud Pak for Data

curl -X DELETE --header "Authorization: Bearer {token}" "{url}/v1/speakers/{speaker_id}"
The delete action can take up to 30 minutes, but when the process is complete, the instance no longer appears on the virtual server instances page.

For more information, see the [Delete an instance](https://cloud.ibm.com/apidocs/vpcdelete-instance) in the Virtual Private Cloud API documentation.





 Toggle the auto-deletion of boot volumes attached to an instance using the UI 

By default, a boot volume created as part of provisioning a virtual server instance is deleted when the instance is deleted. If an existing boot volume is attached as part of provisioning a virtual server instance, the volume is preserved by default when the instance is deleted. You can control this by setting the auto-delete option on the Edit boot volume panel when creating an instance. For more information, see [Creating virtual server instances](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-virtual-servers&interface=ui).





 Toggle the auto-deletion of boot volumes attached to an instance using the CLI 

By default, a boot volume created as part of provisioning a virtual server instance is deleted when the instance is deleted. If an existing boot volume is attached as part of provisioning a virtual server instance, the volume is preserved by default when the instance is deleted. You can control this by specifying the auto_delete property when creating the instance or updating the boot volume attachment. For more information, see [Creating virtual server instances](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-virtual-servers&interface=cli).





 Toggle the auto-deletion of boot volumes attached to an instance using the API 

By default, a boot volume created as part of provisioning a virtual server instance is deleted when the instance is deleted. If an existing boot volume is attached as part of provisioning a virtual server instance, the volume is preserved by default when the instance is deleted.
"versions": [1, 2]
}'



Table 4. Delete specified versions of a key-value secret request parameters

 Request parameter Description 

 instance_id The ID of the Secrets Manager instance. 
 region The region in which the Secrets Manager instance was created. 
 secret_name The name of the key-value secret. 
 Vault-Token The authentication token that is retrieved from Vault. 
 versions The specified versions that are to be deleted. 







 Example response 

A request to get delete specified versions of a key-value secret in the default secret group returns the following response:

{
"request_id": "43abde16-6a33-971f-1690-469eccc00d91",
"lease_id": "",
"renewable": false,
"lease_duration": 0,
"data": null,
"wrap_info": null,
"warnings": null,
"auth": null
}







 Undelete a key-value secret 

Restore a previously deleted version of a key-value secret.



 Example request 

curl -X POST 'https://{instance_id}.{region}.secrets-manager.appdomain.cloud/v1/ibmcloud/kv/undelete/{secret_name}' -H 'Accept: application/json' -H 'X-Vault-Token: {Vault-Token}' -H 'Content-Type: application/json' -d '{
"versions": [
1, 2
]
}



Table 5. Undelete a version of a key-value secret request parameters

 Request parameter Description 

 instance_id The ID of the Secrets Manager instance. 
 region The region in which the Secrets Manager instance was created. 
 secret_name The name of the key-value secret. 
 Vault-Token The authentication token that is retrieved from Vault. 
 versions The versions of the key-value secret you want to delete. 







 Example response
The status of the instance is changed to Deleting. When the instance is deleted successfully, the components of the instance are released, and the status of the instance is changed to Deleted.
4. If you want to delete the instance record from the VMware Solutions console, complete the following steps:



1. Click Actions again and then click Delete from the console.
2. In the Delete instance window, click Delete.









 Related links 



* [Ordering Cyber Recovery](https://cloud.ibm.com/docs/vmwaresolutions?topic=vmwaresolutions-cr_orderinginstance_reqs)
* [Viewing Cyber Recovery instances](https://cloud.ibm.com/docs/vmwaresolutions?topic=vmwaresolutions-cr_viewinginstances)
* [Managing virtual servers](https://cloud.ibm.com/docs/virtual-servers?topic=virtual-servers-managing-virtual-servers)
* [Contacting IBM Support](https://cloud.ibm.com/docs/vmwaresolutions?topic=vmwaresolutions-trbl_support)
If you want to remove a specific safeset, create a [support case](https://cloud.ibm.com/unifiedsupport/supportcenter) so that the IBM Cloud Backup Admins can erase it on the backend.

When a Backup deletion request is submitted to the vaults, the data is automatically deleted from the associated vaults. Because backup deletion requests are submitted and processed by the vaults immediately, backup deletion requests cannot be canceled.

Backup data deletion is permanent. After the data is deleted from vaults, it cannot be recovered or restored.





 What happens to backups when the Backup service is canceled? Can you keep the backups for later use and restore to another server? 

No. When the Backup service is canceled, your vault with the backed-up data is deleted. You can't log in to the Cloud Backup Portal with the canceled credentials either. For more information, see [Canceling the IBM Cloud Backup service](https://cloud.ibm.com/docs/Backup?topic=Backup-cancelBackup).
$ ibmcloud kp key create my-root-key

Creating key: 'my-root-key', in instance: '390086ac-76fa-4094-8cf3-c0829bd69526'...
OK
Key ID Key Name
8635b804-9966-4918-a16b-d561fdbf181f my-root-key

 show key details
$ ibmcloud kp key show 8635b804-9966-4918-a16b-d561fdbf181f

Grabbing info for key id: 8635b804-9966-4918-a16b-d561fdbf181f...
OK
Key ID Key Name Description Creation Date Expiration Date
8635b804-9966-4918-a16b-d561fdbf181f my-root-key 2020-05-05 19:58:02 +0000 UTC Key does not expire

 delete the key
$ ibmcloud kp key delete 8635b804-9966-4918-a16b-d561fdbf181f

Deleting key: 8635b804-9966-4918-a16b-d561fdbf181f, from instance: 390086ac-76fa-4094-8cf3-c0829bd69526...
OK
Deleted Key
8635b804-9966-4918-a16b-d561fdbf181f





 Example 2 

Delete a root key and show the JSON output.

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

{
"id": "9cca88c9-019e-4f0a-9e76-8e657c6b9720",
"name": "my-root-key",
"type": "application/vnd.ibm.kms.key+json",
If not specified, the region logged into, or targeted, will be used.

--force
: Will delete the target without providing the user with any additional prompt.

help | --help | -h
: List options available for the command.





 Example 

The following is an example using the ibmcloud atracker target rm --region us-east --target xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx command.

Are you sure you want to remove the target with target ID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx? [y/N]>y
OK
Target with target ID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx was successfully removed.

The following is an example using the ibmcloud atracker target rm --region us-east --target xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -force command.

This example shows a failed command where the specified target could not be found.

FAILED
Something went wrong. Error: Delete "https://us-east.atracker.cloud.ibm.com/api/v1/targets/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx": dial tcp: lookup us-east.atracker.cloud.ibm.com: no such host







 Validating a target using the CLI 

Use this command to validate that a target is correctly configured for an IBM Cloud Activity Tracker Event Routing region.

ibmcloud atracker target validate --target <TARGET> [--region <REGION>] [--output JSON]



 Command options 

--target <TARGET>
: The ID or name of the target.

--region <REGION> | -r <REGION>
: Name of the region, for example, us-south or eu-gb. If not specified, the region logged into, or targeted, will be used.

--output JSON
: If specified, output will be returned in JSON format.
The enforce_token attribute will affect imported keys during creation, rotation, and restoration. The create_root_key, import_root_key, create_standard_key, and import_standard_key attributes will only affect keys at creation time. All other Key Protect actions (wrap, unwrap, etc.) are unaffected and can be invoked on the key as usual.





 Enabling and updating a keyCreateImportAccess policy for your Key Protect instance with the console 

If you prefer to manage keyCreateImportAccess policy settings using Key Protect's graphical interface, you can use the IBM Cloud console.

If "enforce_token" is enabled, all import key actions will not be available in the UI. The "enforce_token" option makes [Secure Import](https://cloud.ibm.com/docs/key-protect?topic=key-protect-create-import-tokens) a requirement for all key imports. Secure Import support is only available in the Key Protect CLI or API.

After creating a Key Protect instance, complete the following steps to enable a keyCreateImportAccess policy:



1. [Log in to the IBM Cloud console](https://cloud.ibm.com/login/).
2. Go to Menu > Resource List to view a list of your resources.
3. From your IBM Cloud resource list, select your provisioned instance of Key Protect.
4. Click the Instance policies link on the left side of the page.



* Find the Create and import access panel (at the top of the page).
* Enable or disable any keyCreateImportAccess settings you desire. Note that any create or import key actions that have been disabled will no longer be available via the "Add Key" modal.
* Click Save or Cancel (whichever is appropriate).









 Enabling and updating a keyCreateImportAccess policy for your Key Protect instance with the API 

As a security admin, you can enable or update a keyCreateImportAccess policy for a Key Protect instance by making a PUT call to the following endpoint.