API data source

Updated at:

This topic describes how to add a table that uses an API data source.

Add an API data source

  1. On the Instance Details > Table Management page, click Add Table.

  2. Enter the basic information for the table and click Next:

    The basic information includes three settings: Table name,Number of Shards, and Data Update Resources. After you configure these settings, click Next.

    Configuration details:

  • Table name: You can customize this name.

  • Number of Shards: When setting the number of shards, ensure that all index tables have the same number of shards. Alternatively, one index table can have a single shard while the others have the same number of shards. The number of shards for a table must be a positive integer no greater than 256. We recommend that this number does not exceed three times the number of data nodes in your instance.

  • Data Update Resources: The resources used for data updates. Each index includes two free update resources (4 cores and 8 GB each) by default. Resources beyond the free quota incur fees. For details, see Billing overview of OpenSearch Retrieval Engine Edition.

  1. Configure the data source for data synchronization, then click Next:

    In the Full data source section, select API and click Next.

    Parameter details:

  • Data source type: Select an API push data source to push data to the instance through APIs.

  1. Configure the fields and indexes in the index schema, then click Next:

    In the Field Settings section, add id (INT64, primary key, with attribute and search result display enabled and data compression set to equal) and namespace (STRING, with attribute and search result display enabled and data compression set to uniq). In the Index Settings section, configure id (PRIMARYKEY128, containing id) and test_name (STRING, containing namespace).

  2. Confirm creation. After you confirm, the system automatically creates the configured table:

    A system message appears: Once confirmed, index building starts automatically based on the selected concurrent resources. After the index is built, it is automatically enabled in the current instance. Click Confirm Creation to finish.

  3. Expand the Deploy New Data Source change process to view the status of each node, including Parameter check,Create configuration,Create message queue,Create scan plan,Create index building plan,Create cleanup plan, and Modify table status. The change details display the corresponding cluster name and data source name.

  4. When the table is in use, you can test queries on the Query Test page.

Usage notes

  • When rebuilding the index for an API data source, the system clears all previously pushed data and starts syncing real-time data from a specified timestamp. Therefore, be cautious when performing a full data import.

  • An API data source can be deleted only when it is in the Unused state.