Originally published on September 2 on Medium – https://medium.com/@dtoczala/i-just-deleted-my-watson-service-im-doomed-11f4aef8ef16
When you work with smart people, you tend to learn some really cool little tips and tricks. One of the smart people that I work is Josh Cohen, and he learned about a neat little trick for recovering an IBM Cloud service instance that you might have accidentally deleted.
How it’s Done
So let’s assume that you have mistakenly deleted an instance of an IBM Watson service. Some services might be very easy to replace — but others will not be so easy to replace or restore. This will help with those. It will require you to use the IBM Cloud Command Line Interface (CLI), so maybe it would be wise to download that now.
Since this is a command line interfac e (CLI), you will be doing all of these commands from a Terminal window, or Terminal app. Step one of the process is to use the CLI to first obtain a list of your “reclamations” in your account. These “reclamations” are the deleted instances that you have within the last time period (which might be within 7–30 days, depending on the service). You will first need to login to the IBM Cloud, and then you will need to put yourself into the correct account/context. Also note that you might need to update to a newer version of the IBM Cloud CLI. Your login will look like this:
ibmcloud login -u -p
or with some “sample” settings…
ibmcloud login -u firstname.lastname@example.org -p bigmouth
…and then you will list out your reclamations in this account
ibmcloud resource reclamations
You will then see a list of all of the services that are available to be recovered. It will list out an ID, a Resource Instance ID, the Entity CRN, a State and a target time. The output is very wide — you will need to stretch your screen width so the fields line up and make sense. The target time is key — this shows when the resource in question will actually be deleted (and be unable to be recovered).
You will want to copy the ID (that first field), and then use this with the restore command. So you will next enter in something that looks like this, on the IBM cloud command line:
ibmcloud resource reclamation-restore <ID>
…or with a “real” ID it might look like this:
ibmcloud resource reclamation-restore 29a8cafe-2158–4ea5-feed–83738beef98d
Now go and check your IBM Cloud console. You should see that “deleted” service now alive and well, and available in your IBM Cloud account.
If you want to learn more about how to do reclamations, and how to do a HARD delete of services (so they cannot be restored), check out the IBM Cloud help on resource reclamations.