简体   繁体   English

在IBM Graph中,如何删除我的整个图并重新开始而不删除我的实例

[英]In IBM Graph, How can delete my entire graph and start over without deleting my instance

I'm using IBM Graph and I'd like to be able to delete my entire graph to reload the data. 我正在使用IBM Graph,并且希望能够删除整个图以重新加载数据。 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? 还有其他方法可以不必继续创建新实例吗?

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. 最好的方法是使用/ _graphs端点,该端点允许您在同一实例下管理多个图。

Here's how you'd delete grph g2 这是删除GRPH G2的方法

Delete a graph : DELETE /_graphs/:_gid 删除图表: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 添加新图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 添加具有特定名称的图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 获取图形列表GET / _graphs

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

$ {"graph_ids":["g2","105512b6-db95-412c-aa3c-6b8fa6c3a844","203312b6-de95-412c-ab3c-6b8fe6cda844"]}

the "delete" method doesn't support in bluemix, it will return below error when trying to delete a graph: bluemix中不支持“ delete”方法,在尝试删除图形时它将返回以下错误:

{"code":"MethodNotAllowedError","message":"DELETE is not allowed"} {“代码”:“ MethodNotAllowedError”,“消息”:“不允许删除”}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM