Exemple #1
0
 def get_property(graph_id, auth=None):
     """
     :param graph_id:
     :param auth:
     """
     url = "/api/v1.2/graph-connections/%d/schema/propertykeys" % graph_id
     code, res = Request().request(method="get", path=url, types="hubble")
     return code, res
Exemple #2
0
 def query_load_job(graph_id, auth=None):
     """
     查询导入任务,可返回ID
     :param auth:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/" % graph_id
     code, res = Request().request(method='get', path=url, types="hubble")
     return code, res
Exemple #3
0
 def get_edgeLabel(graph_id, auth=None):
     """
     验证:EdgeLabel读权限
     :param graph_id:
     :param auth:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/schema/edgelabels" % graph_id
     code, res = Request().request(method='get', path=url, types="hubble")
     return code, res
Exemple #4
0
 def get_index(graph_id, auth=None):
     """
     查看IndexLabel
     :param auth:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/schema/indexlabels" % graph_id
     code, res = Request().request(method='get', path=url, types="hubble")
     return code, res
Exemple #5
0
 def mapping_complete_next_step(graph_id, job_id, auth=None):
     """
     设置映射完成,点击下一步
     :param auth:
     :param graph_id:
     :param job_id:导入任务ID
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d/file-mappings/next-step" % (
         graph_id, job_id)
     code, res = Request().request(method='put', path=url, types="hubble")
     return code, res
Exemple #6
0
 def query_all_load_tasks(graph_id, job_id, auth=None):
     """
     查询全部导入任务
     :param auth:
     :param graph_id:
     :param job_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d/load-tasks" % (
         graph_id, job_id)
     code, res = Request().request(method='get', path=url, types="hubble")
     return code, res
Exemple #7
0
 def delete_graph_connect(graph_id, auth=None):
     """
     删除全部图链接
     :param auth:
     :param graph_id:
     :return:
     """
     url = '/api/v1.2/graph-connections/%d' % graph_id
     code, res = Request().request(method="delete",
                                   path=url,
                                   types="hubble")
     return code, res
Exemple #8
0
 def view_async_tasks_results(graph_id, async_task_id, auth=None):
     """
     查看异步任务结果
     :param auth:
     :param async_task_id:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/async-tasks/%d" % (graph_id,
                                                              async_task_id)
     code, res = Request().request(method='get', path=url, types="hubble")
     return code, res
Exemple #9
0
 def upload_file_next_step(graph_id, job_id, auth=None):
     """
     上传文件完成,点击下一步
     :param auth:
     :param graph_id:
     :param job_id:导入任务ID
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d/upload-file/next-step" % (
         graph_id, job_id)
     code, res = Request().request(method='put', path=url, types="hubble")
     return code, res
Exemple #10
0
 def query_all_file_mapping(graph_id, job_id, auth=None):
     """
     查看所有文件映射
     :param auth:
     :param graph_id:
     :param job_id:导入任务ID
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d/file-mappings" % (
         graph_id, job_id)
     code, res = Request().request(method='get', path=url, types="hubble")
     return code, res
Exemple #11
0
 def get_graph_connect(param=None, auth=None):
     """
     查看图链接
     :param param:
     :param auth:
     :return:
     """
     url = '/api/v1.2/graph-connections'
     code, res = Request().request(method="get",
                                   path=url,
                                   params=param,
                                   types="hubble")
     return code, res
Exemple #12
0
 def reuse_edgeLabel(body, graph_id, auth=None):
     """
     :param body:
     :param auth:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/schema/edgelabels/reuse" % graph_id
     code, res = Request().request(method='post',
                                   path=url,
                                   json=body,
                                   types="hubble")
     return code, res
Exemple #13
0
 def delete_property(graph_id, param=None, auth=None):
     """
     :param param:
     :param auth:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/schema/propertykeys" % graph_id
     code, res = Request().request(method='delete',
                                   path=url,
                                   params=param,
                                   types="hubble")
     return code, res
Exemple #14
0
 def add_graph_connect(body, auth=None):
     """
     添加图链接
     :param auth:
     :param body
     :return:
     """
     url = "/api/v1.2/graph-connections"
     code, res = Request().request(method="post",
                                   path=url,
                                   json=body,
                                   types="hubble")
     return code, res
Exemple #15
0
 def create_property(body, graph_id, auth=None):
     """
     :param body:
     :param auth:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/schema/propertykeys" % graph_id
     code, res = Request().request(method='post',
                                   path=url,
                                   json=body,
                                   types="hubble")
     return code, res
Exemple #16
0
 def gremlin_task(body, graph_id, auth=None):
     """
     执行GREMLIN任务
     :param body:
     :param auth:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/gremlin-query/async-task" % graph_id
     code, res = Request().request(method='post',
                                   path=url,
                                   json=body,
                                   types="hubble")
     return code, res
Exemple #17
0
 def update_graph_connect(graph_id, body, auth=None):
     """
     修改图链接
     :param auth:
     :param graph_id:
     :param body:
     :return:
     """
     url = '/api/v1.2/graph-connections/%d' % graph_id
     code, res = Request().request(method="put",
                                   path=url,
                                   types="hubble",
                                   json=body)
     return code, res
Exemple #18
0
 def view_async_tasks_all(graph_id, param=None, auth=None):
     """
     查看所有异步任务
     :param param:
     :param auth:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/async-tasks" % graph_id
     code, res = Request().request(method='get',
                                   path=url,
                                   params=param,
                                   types="hubble")
     return code, res
Exemple #19
0
 def collect_query_statement(body, graph_id, auth=None):
     """
     收藏语句
     :param auth:
     :param body:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/gremlin-collections" % graph_id
     code, res = Request().request(method='post',
                                   json=body,
                                   path=url,
                                   types="hubble")
     return code, res
Exemple #20
0
 def delete_index(name, graph_id, auth=None):
     """
     删除indexLabel删除
     :param name:
     :param auth:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/schema/indexlabels/%s" % (
         graph_id, name)
     code, res = Request().request(method='delete',
                                   path=url,
                                   types="hubble")
     return code, res
Exemple #21
0
 def delete_load_job(graph_id, job_id, auth=None):
     """
     删除导入任务
     :param auth:
     :param graph_id:
     :param job_id:导入任务ID
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d" % (graph_id,
                                                              job_id)
     code, res = Request().request(method='delete',
                                   path=url,
                                   types="hubble")
     return code, res
Exemple #22
0
 def create_load_job(body, graph_id, auth=None):
     """
     创建导入任务
     :param auth:
     :param body:
     :param graph_id:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager" % graph_id
     code, res = Request().request(method='post',
                                   json=body,
                                   path=url,
                                   types="hubble")
     return code, res
Exemple #23
0
 def delete_edgeLabel(graph_id, param=None, auth=None):
     """
     删除edgeLabel
     :param param: {}
     :param graph_id:
     :param auth:
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/schema/edgelabels" % graph_id
     code, res = Request().request(method='delete',
                                   path=url,
                                   params=param,
                                   types="hubble")
     return code, res
Exemple #24
0
 def delete_edge_mapping(graph_id, job_id, file_id, edge_id, auth=None):
     """
     删除边映射
     :param auth:
     :param graph_id:
     :param job_id:导入任务ID
     :param file_id:文件ID
     :param edge_id:边映射ID
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d/file-mappings/%d/edge-mappings/%s" % (
         graph_id, job_id, file_id, edge_id)
     code, res = Request().request(method='delete',
                                   path=url,
                                   types="hubble")
     return code, res
Exemple #25
0
 def get_loadfile_token(graph_id, job_id, param=None, auth=None):
     """
     获取文件token
     :param auth:
     :param graph_id:
     :param job_id:导入任务ID
     :param param:
     :return: ?names=movie.csv
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d/upload-file/token" % (
         graph_id, job_id)
     code, res = Request().request(method='get',
                                   path=url,
                                   params=param,
                                   types="hubble")
     return code, res
Exemple #26
0
 def retry_load(graph_id, job_id, param, auth=None):
     """
     重试导入
     :param auth:
     :param graph_id:
     :param param:
     :param job_id:导入任务ID
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d/load-tasks/retry" % (
         graph_id, job_id)
     code, res = Request().request(method='post',
                                   path=url,
                                   params=param,
                                   types="hubble")
     return code, res
Exemple #27
0
 def update_load_job(body, graph_id, job_id, auth=None):
     """
     修改导入任务名称
     :param auth:
     :param graph_id:
     :param job_id:导入任务ID
     :param body:需要修改的名称
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d" % (graph_id,
                                                              job_id)
     code, res = Request().request(method='put',
                                   path=url,
                                   json=body,
                                   types="hubble")
     return code, res
Exemple #28
0
 def add_load_setting(body, graph_id, job_id, auth=None):
     """
     添加导入设置
     :param body:
     :param auth:
     :param graph_id:
     :param job_id:导入任务ID
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d/file-mappings/load-parameter" % (
         graph_id, job_id)
     code, res = Request().request(method='post',
                                   path=url,
                                   json=body,
                                   types="hubble")
     return code, res
Exemple #29
0
 def add_edge_mapping(body, graph_id, job_id, file_id, auth=None):
     """
     添加边映射
     :param body:
     :param auth:
     :param graph_id:
     :param job_id:导入任务ID
     :param file_id:文件ID
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d/file-mappings/%d/edge-mappings" % (
         graph_id, job_id, file_id)
     code, res = Request().request(method='post',
                                   path=url,
                                   json=body,
                                   types="hubble")
     return code, res
Exemple #30
0
 def delete_file(graph_id, job_id, file_name, param, auth=None):
     """
     删除文件
     :param auth:
     :param graph_id:
     :param file_name:需要上传一个字典   {"file": open("./add_data/finally.csv", 'rb')}
     :param job_id:导入任务ID
     :param param: total=1&index=1&name=finally.csv&token=
     :return:
     """
     url = "/api/v1.2/graph-connections/%d/job-manager/%d/upload-file" % (
         graph_id, job_id)
     code, res = Request().request(method='post',
                                   path=url,
                                   params=param,
                                   files=file_name,
                                   types="hubble")
     return code, res