All Products
Search
Document Center

OpenSearch:BuildIndex

Last Updated:Oct 16, 2024

Triggers reindexing.

Operation description

Method

POST

URI

/openapi/ha3/instances/{instanceId}/actions/build-index

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
searchengine:BuildIndexupdate
  • Instance
    acs:searchengine:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request syntax

POST /openapi/ha3/instances/{instanceId}/actions/build-index HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
instanceIdstringYes

The instance ID.

ha-cn-7mz2iv7sq01
bodyobjectNo

The request body, which is a JSON string. For more information, see the following parameters.

dataSourceNamestringNo

The name of the data source.

my_data_source
domainstringNo

The data center in which the data source is deployed.

test
dataSourceTypestringNo

The type of the data source.

swift
partitionstringNo

The partition in the MaxCompute table. This parameter is required if type is set to odps.

20201010
dataTimeSecintegerNo

The timestamp in seconds. The value must be of the INTEGER type. This parameter is required if you specify an API data source.

1640867288
buildModestringNo

The reindexing method. Valid values: api: API data source. indexRecover: data recovery by using indexing.

indexRecover
generationlongNo

The data restoration version.

160131146

Sample requests



POST /openapi/ha3/instances/ha3_instance_name/actions/build-index

​ 

 {

    "dataSourceName": "my_data_source",

    "domain": "test", // Specifies where the data source is deployed.

    "indexes": [

      "index1",

      "index2"

    ],
    "dataSourceType": "odps", // Set this parameter to odps or swift. This parameter is required.

    "partition": "20201010", // This parameter is required for the odps data source.

    "dataTimeSec": 1640867288 // The timestamp in seconds. It is of the INT type. This parameter is required for the API-pushed data source.

  }

 ​  ​ 

{

    "dataSourceName": "my_data_source",

    "domain": "test", // Specifies where the data source is deployed.

    "indexes": [

      "index1",

      "index2"

    ],

    "dataSourceType": "swift", // Set this parameter to odps or swift. This parameter is required.

    "partition": "20201010", // This parameter is required for the odps data source.

    "dataTimeSec": 1640867288 // The timestamp in seconds. It is of the INT type. This parameter is required for the API-pushed data source.
  }

 ​

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

requestIdstring

id of request

407BFD91-DE7D-50BA-8F88-CDE52A3B5E46
resultobject

The list of clusters

{}

Sample responses

Sample success responses 

{

  "requestId": "0A6EB64B-B4C8-CF02-810F-E660812972FF",

  "result": []

}

Examples

Sample success responses

JSONformat

{
  "requestId": "407BFD91-DE7D-50BA-8F88-CDE52A3B5E46",
  "result": {}
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-01-12Add OperationView Change Details