GetClusterDataInformation - 索引迁移数据信息

更新时间:
复制 MD 格式

获取索引迁移数据信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

elasticsearch:GetClusterDataInformation

get

*全部资源

*

无 无

请求语法

POST /openapi/cluster/data-information HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

body

string

否

待查询的集群类型、访问地址及索引等信息。

{"dataSourceType":"elasticsearch","endpoint":"http://es-cn-npk1shyiq000d****.public.elasticsearch.aliyuncs.com:9200","username":"elastic","password":"xxxxxx","index":"default","type":"default"}

请求参数为空,但需填写 RequestBody。 RequestBody 中需要填入以下参数,用来指定集群信息。 | 名称 | 类型 | 是否必选 | 示例值 | 描述 | | ---- | ---- | ---- | ---- | | dataSourceType| String | 是 | elasticsearch |集群类型,默认为 elasticsearch。| | endpoint| String | 否 | http://10.01.xx.xx |集群公网域名。源集群的网络环境为公网时必填。| | instanceId| String | 否 | es-cn-09k1rnu3g0002**** |Elasticsearch 实例 ID。源集群的网络环境为阿里云 Elasticsearch 集群时必填。| | vpcInstancePort| Integer | 否 | 9200 |集群的访问端口号。源集群的网络环境为阿里云 Elasticsearch 集群、阿里云 ECS 服务自建集群时必填。| | vpcId| String | 否 | vpc-2ze59tt67m3nzkko9**** |集群所在的专有网络 ID。源集群的网络环境为阿里云 Elasticsearch 集群、阿里云 ECS 服务自建集群时必填。| | vpcInstanceId| String | 否 | es-09k1rnu3g0002****-worker |当前集群的实例 ID 或负载均衡 SLB(Server Load Balancer)实例 ID。源集群的网络环境为阿里云 Elasticsearch 集群时必填。| | username| String | 否 | elastic |集群的访问用户名。| | password| String | 否 | xxxxxx |集群的访问密码。| | index| String | 否 | product |索引名称。| | type| String | 否 | default |索引类型。|

说明
  • index 为空,可校验 Elasticsearch 集群是否可连通。如果可连通,返回结果中 indices 不为空。

  • index 不为空,可获取当前 index 下,settings 和 mapping 的信息。

  • type 不为空,可获取当前 type 对应的 routing 字段信息。

源集群的网络环境不同,需要填写的参数不同:

  • 公网集群:需要填写的参数包括 endpoint,示例如下。

     ```
      {
       "dataSourceType": "elasticsearch",
       "endpoint": "http://es-cn-npk1shyiq000d****.public.elasticsearch.aliyuncs.com:9200",
       "username": "elastic",
       "password": "xxxxxx",
       "index": "default",
       "type": "default"
       }
    ```
    
  • 阿里云 ECS 服务自建集群:需要填写的参数包括 vpcInstancePort、vpcId 和 vpcIp,示例如下。

    ```
     {
          "dataSourceType": "elasticsearch",
          "vpcId":"vpc-2ze55voww95g82gak****",
          "vpcInstancePort": "9200",
          "vpcIp": "10.12.xx.xx",
          "username" : "elastic",
          "password" : "xxxxxx",
          "index":  "product",
          "type" : "default"
     }
    ```
    
  • 阿里云 Elasticsearch 集群:需要填写的参数包括 vpcInstancePort、vpcId、vpcInstanceId 和 instanceId,示例如下。

    {
        "dataSourceType" : "elasticsearch",
        "vpcId":"vpc-2ze55voww95g82gak****",
        "vpcInstancePort" : "9200",
        "vpcInstanceId" : "es-cn-09k1rnu3g0002****-worker",
        "instanceId" : "es-cn-oew1oxiro000f****",
        "username" : "elastic",
        "password" : "xxxxxx",
        "index":  "product",
        "type" : "default"
     }
    
    

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****

Result

object

返回结果。

connectable

boolean

是否可连通。

true

metaInfo

object

集群的元数据信息。

mapping

string

集群的 Mapping 配置。

{\"_doc\":{\"properties\":{\"user\":{\"properties\":{\"last\":{\"type\":\"text\",...}}}}}}

settings

string

集群的 Settings 配置。

{\n \"index\": {\n \"replication\": {\n}.....}}

typeName

array

指定索引的 type。

string

指定索引的 type。

["index1-type"]

fields

array

索引 Mapping 对应的字段。

string

索引 Mapping 对应的字段。

["id","name"]

indices

array

集群的索引列表。

string

集群的索引列表。

["index1","index2","index3"]

示例

正常返回示例

JSON格式

{
  "RequestId": "5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****",
  "Result": {
    "connectable": true,
    "metaInfo": {
      "mapping": "{\\\"_doc\\\":{\\\"properties\\\":{\\\"user\\\":{\\\"properties\\\":{\\\"last\\\":{\\\"type\\\":\\\"text\\\",...}}}}}}",
      "settings": "{\\n  \\\"index\\\": {\\n    \\\"replication\\\": {\\n}.....}}",
      "typeName": [
        "[\"index1-type\"]"
      ],
      "fields": [
        "[\"id\",\"name\"]"
      ],
      "indices": [
        "[\"index1\",\"index2\",\"index3\"]"
      ]
    }
  }
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。