Module elasticsearch

ballerinax/elasticsearch Ballerina library

1.0.0

Overview

This is a generated connector for Elasticsearch OpenAPI specification.

Elasticsearch API allows you to store, search, and analyze data with ease at scale.

Prerequisites

Before using this connector in your Ballerina application, complete the following:

Quickstart

To use the Elasticsearch in your Ballerina application, update the .bal file as follows:

Step 1: Import connector

First, import the ballerinax/elasticsearch module into the Ballerina project.

Copy
import ballerinax/elasticsearch;

Step 2: Create a new connector instance

Create a elasticsearch:ApiKeysConfig with the authorization key obtained, and initialize the connector with it.

Copy
elasticsearch:ApiKeysConfig apiKeysConfig = {
    authorization : "<AUTHORIZATION_TOKEN>"
};
elasticsearch:Client baseClient = check new (apiKeysConfig);

Step 3: Invoke connector operation

  1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.

    Following is an example on how to obtain information about existing Elastic Stack versions, using the connector.

    Get Elastic Stack versions.

    Copy
    public function main() returns error? {
        elasticsearch:StackVersionConfigs response = check baseClient->getVersionStacks();
        log:printInfo(response.toString());
    }
  2. Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/elasticsearch;Copy

Metadata

Released date: almost 3 years ago

Version: 1.0.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.0.0

GraalVM compatible: Yes


Pull count

Total: 9

Current verison: 0


Weekly downloads


Source repository


Keywords

Business Intelligence/Analytics

Cost/Paid


Contributors

Other versions