GetClusterDataInformation
Retrieves the index migration data information.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
elasticsearch:GetClusterDataInformation |
get |
*All Resource
|
None | None |
Request syntax
POST /openapi/cluster/data-information HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
string |
No |
The cluster type, access address, and index information to be queried. |
{"dataSourceType":"elasticsearch","endpoint":"http://es-cn-npk1shyiq000d****.public.elasticsearch.aliyuncs.com:9200","username":"elastic","password":"xxxxxx","index":"default","type":"default"} |
The request parameters are empty, but the RequestBody must be specified. The following parameters must be included in the RequestBody to specify the cluster information.
| Name | Type | Required | Example | Description |
| dataSourceType | String | Yes | elasticsearch | The cluster type. Default value: elasticsearch. |
| endpoint | String | No | http://10.01.xx.xx | The public endpoint of the cluster. This parameter is required when the source cluster is accessed over the public network. |
| instanceId | String | No | es-cn-09k1rnu3g0002**** | The ID of the Elasticsearch instance. This parameter is required when the source cluster is an Alibaba Cloud Elasticsearch cluster. |
| vpcInstancePort | Integer | No | 9200 | The access port number of the cluster. This parameter is required when the source cluster is an Alibaba Cloud Elasticsearch cluster or a self-managed cluster on an Alibaba Cloud ECS instance. |
| vpcId | String | No | vpc-2ze59tt67m3nzkko9**** | The ID of the VPC where the cluster is deployed. This parameter is required when the source cluster is an Alibaba Cloud Elasticsearch cluster or a self-managed cluster on an Alibaba Cloud ECS instance. |
| vpcInstanceId | String | No | es-09k1rnu3g0002****-worker | The instance ID of the current cluster or the ID of the Server Load Balancer (SLB) instance. This parameter is required when the source cluster is an Alibaba Cloud Elasticsearch cluster. |
| username | String | No | elastic | The username used to access the cluster. |
| password | String | No | xxxxxx | The password used to access the cluster. |
| index | String | No | product | The name of the index. |
| type | String | No | default | The type of the index. |
If index is empty, you can verify whether the Elasticsearch cluster is connectable. If the cluster is connectable, the indices field in the returned result is not empty.
If index is not empty, you can obtain the settings and mapping information of the current index.
If type is not empty, you can obtain the routing field information corresponding to the current type.
The parameters that you must specify vary based on the network environment of the source cluster:
-
Public network cluster: You must specify the endpoint parameter. Example:
{ "dataSourceType": "elasticsearch", "endpoint": "http://es-cn-npk1shyiq000d****.public.elasticsearch.aliyuncs.com:9200", "username": "elastic", "password": "xxxxxx", "index": "default", "type": "default" } -
Self-managed cluster on an Alibaba Cloud ECS instance: You must specify the vpcInstancePort, vpcId, and vpcIp parameters. Example:
{ "dataSourceType": "elasticsearch", "vpcId":"vpc-2ze55voww95g82gak****", "vpcInstancePort": "9200", "vpcIp": "10.12.xx.xx", "username" : "elastic", "password" : "xxxxxx", "index": "product", "type" : "default" } -
Alibaba Cloud Elasticsearch cluster: You must specify the vpcInstancePort, vpcId, vpcInstanceId, and instanceId parameters. Example:
{ "dataSourceType" : "elasticsearch", "vpcId":"vpc-2ze55voww95g82gak****", "vpcInstancePort" : "9200", "vpcInstanceId" : "es-cn-09k1rnu3g0002****-worker", "instanceId" : "es-cn-oew1oxiro000f****", "username" : "elastic", "password" : "xxxxxx", "index": "product", "type" : "default" }
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1**** |
| Result |
object |
The returned result. |
|
| connectable |
boolean |
Indicates whether the cluster is connectable. |
true |
| metaInfo |
object |
The metadata information of the cluster. |
|
| mapping |
string |
The mapping configuration of the cluster. |
{\"_doc\":{\"properties\":{\"user\":{\"properties\":{\"last\":{\"type\":\"text\",...}}}}}} |
| settings |
string |
The settings configuration of the cluster. |
{\n \"index\": {\n \"replication\": {\n}.....}} |
| typeName |
array |
The type of the specified index. |
|
|
string |
The type of the specified index. |
["index1-type"] |
|
| fields |
array |
The fields corresponding to the index mapping. |
|
|
string |
The fields corresponding to the index mapping. |
["id","name"] |
|
| indices |
array |
The list of indexes in the cluster. |
|
|
string |
The list of indexes in the cluster. |
["index1","index2","index3"] |
Examples
Success response
JSON format
{
"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\"]"
]
}
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.