0

I'm using IBM Graph and I'd like to be able to delete my entire graph to reload the data. I'm told that I need to delete my service instance and create a new one. Is there any other way to do this without having to keep creating new instances?

Alaa Mahmoud
  • 743
  • 3
  • 18

2 Answers2

0

Yes absolutely!

The best way to do this is to use the /_graphs endpoint which allows you to manage multiple graphs under the same instance.

Here's how you'd delete grph g2

Delete a graph : DELETE /_graphs/:_gid

$curl  -u  username:password  -X DELETE "http://.../<serviceid>/g2"

But you can also do other neat stuff as well such as

Adding a new graph POST /_graphs

$curl  -u  username:password  -X POST "http://.../<serviceid>/_graphs"

$ {"graph_id":"105512b6-db95-412c-aa3c-6b8fa6c3a844","dbUrl":"http://.../<serviceid>/105512b6-db95-412c-aa3c-6b8fa6c3a844"}

Add a graph with a specific name POST /_graphs/:_gid

$curl  -u  username:password  -X POST "http://.../<serviceid>/_graphs/g2"

$ {"graph_id":"g2","dbUrl":"http://127.0.0.1:3001/service123/g2"}

Get List of Graphs GET /_graphs

$curl  -u  username:password  -X GET "http://.../<serviceid>/_graphs"

$ {"graph_ids":["g2","105512b6-db95-412c-aa3c-6b8fa6c3a844","203312b6-de95-412c-ab3c-6b8fe6cda844"]}
Alaa Mahmoud
  • 743
  • 3
  • 18
0

the "delete" method doesn't support in bluemix, it will return below error when trying to delete a graph:

{"code":"MethodNotAllowedError","message":"DELETE is not allowed"}