更新时间:2022-02-22 GMT+08:00

查询索引

功能介绍

查询在图上创建的所有索引。

URI

  • URI 格式
    GET /ges/v1.0/{project_id}/graphs/{graph_name}/indices
  • 参数说明
    表1 URI参数说明

    参数

    是否必选

    类型

    说明

    project_id

    String

    项目编号,用于资源隔离。请参考获取项目ID

    graph_name

    String

    图名称。

请求

  • 请求样例
    GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices

    SERVER_URL:图的访问地址,取值请参考业务面API使用限制

响应

  • 参数说明
    表2 参数说明

    参数

    是否必选

    类型

    说明

    errorMessage

    String

    系统提示信息,执行成功时,字段可能为空。执行失败时,用于显示错误信息。

    errorCode

    String

    系统提示信息,执行成功时,字段可能为空。执行失败时,用于显示错误码。

    result

    String

    查询结果,成功时为success。

    indices

    List

    查询结果,索引列表。

    indexType

    String

    查询结果,索引类别。

    indexName

    String

    查询结果,索引名称。

    indexProperty

    List

    查询结果,创建的索引属性列表。

  • 请求成功样例
    Http Status Code: 200
    {
      "data": {
        "result": "success",
        "indices": [
          {
            "indexType": "GlobalCompositeVertexIndex",
            "indexName": "ageIndx",
            "indexProperty": [
              "age"
            ],
            "hasLabel": "true"
           
          }
        ]
      }
    }
  • 请求成功样例
    Http Status Code: 200
    {
      "data": {
        "indices": [
          {
            "indexType": "GlobalCompositeVertexIndex",
            "indexName": "ageIndx",
            "indexProperty": [
              "age"
            ],
            "hasLabel": true
           
          }
        ]
      },
       "result": "success"
    }
  • 请求失败样例
    Http Status Code: 400
    {
      "errorMessage": "graph [demo] is not found",
      "errorCode": "GES.8605"
    }

返回值

  • 正常

    200

  • 异常
    表3 异常返回值说明

    返回值

    说明

    400 Bad Request

    请求错误。

    401 Unauthorized

    鉴权失败。

    403 Forbidden

    没有操作权限。

    404 Not Found

    找不到资源。

    500 Internal Server Error

    服务内部错误。

    503 Service Unavailable

    服务不可用。