user6464615
user6464615

Reputation: 11

Unable to delete dataset created from Watson Analytics API

When I create dataset using Watson Analytics APIs (https://developer.ibm.com/watson-analytics/#getstarted), the Watson Analytics UI does not allow me to delete the dataset. Is there a way to delete it?

Upvotes: 1

Views: 99

Answers (1)

Robert Hatfield
Robert Hatfield

Reputation: 106

It would help to know the API calls you executed. Can you add code to your question?

You can delete a dataset via API. Did you try this?

curl -v -X DELETE -H "X-IBM-Client-Id:<client-id>" -H "X-IBM-Client-Secret:<client-secret>" -H "Authorization: <token>" https://api.ibm.com/watsonanalytics/run/data/v1/datasets/{id}

What state does your Watson Analytics dataset tile display? Is show "Transferring", or is it a usable dataset?

You can access an action menu from the 3-dots on the tile. The documentation you referenced below mentions two ways of uploading data. The single PUT method of uploading data, and the segmented upload. Did you use segmented upload? If so, did you send the last "empty" put?

For example:

curl -v -X POST -H "X-IBM-Client-Id:<client-id>" -H "X-IBM-Client-Secret:<client-secret>" -H "Authorization: Bearer <token>" -H "Content-Type:application/json" -H "Accept:application/json" https://api.ibm.com/watsonanalytics/run/data/v1/datasets -d "{ 'name' :'TestData' }"

Obtain id from the response

curl -v -X PUT -H "X-IBM-Client-Id:<client-id>" -H "X-IBM-Client-Secret:<client-secret>" -H "Authorization: Bearer <token>" -H "Content-Type:text/csv" https://api.ibm.com/watsonanalytics/run/data/v1/datasets/<id>/content/00001 -d "<some data>"
curl -v -X PUT -H "X-IBM-Client-Id:<client-id>" -H "X-IBM-Client-Secret:<client-secret>" -H "Authorization: Bearer <token>" -H "Content-Type:text/csv" https://api.ibm.com/watsonanalytics/run/data/v1/datasets/<id>/content/00002 -d "<some more data>"

The data set tile will display "Transferring" at this point. End the transfer with an empty PUT. Watson Analytics will then deploy the data you have uploaded.

curl -v -X PUT -H "X-IBM-Client-Id:<client-id>" -H "X-IBM-Client-Secret:<client-secret>" -H "Authorization: Bearer <token>" -H "Content-Type:text/csv" https://api.ibm.com/watsonanalytics/run/data/v1/datasets/<id>/content

I hope that helps. If you add some details to your question I can update this answer.

Upvotes: 1

Related Questions