Skip to content
Java client for the SentinelDB API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.swagger-codegen
docs
gradle/wrapper
src
.gitignore
.swagger-codegen-ignore
.travis.yml
LICENSE
README.md
build.gradle
build.sbt
git_push.sh
gradle.properties
gradlew
gradlew.bat
pom.xml
release.md
settings.gradle
swagger-codegen.json

README.md

sentineldb-java-client

Requirements

Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:

mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>com.logsentinel.sentineldb</groupId>
    <artifactId>sentineldb-java-client</artifactId>
    <version>0.0.6</version>
    <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.logsentinel.sentineldb:sentineldb-java-client:0.0.6"

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

  • target/sentineldb-java-client-1.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.logsentinel.sentineldb.*;
import com.logsentinel.sentineldb.auth.*;
import com.logsentinel.sentineldb.model.*;
import com.logsentinel.sentineldb.api.DatastoreApi;

import java.io.File;
import java.util.*;

public class DatastoreApiExample {

    public static void main(String[] args) {
        SentinelDBClient client = SentinelDBClientBuilder.create(orgId, secret).build();

        DatastoreApi apiInstance = client.getDatastoreActions();
        String datastoreId = "datastoreId_example"; // String | datastoreId
        String actor = "actor_example"; // String | actor
        Integer pageNumber = 0; // Integer | pageNumber
        Integer pageSize = 20; // Integer | pageSize
        try {
            List<Record> result = apiInstance.getRecordsByDatastore(datastoreId, actor, pageNumber, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DatastoreApi#getRecordsByDatastore");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://localhost:8090

Class Method HTTP request Description
DatastoreApi getRecordsByDatastore GET /api/datastore/{datastoreId}/records Gets records by datastore with pagination
DatastoreApi getUsersByDatastore GET /api/datastore/{datastoreId}/users Gets users by datastore with pagination
DatastoreApi listDatastores GET /api/datastore/list Gets a list of datastores
RecordsApi createRecord POST /api/record/datastore/{datastoreId} Creates a record
RecordsApi deleteRecord DELETE /api/record/{recordId} Deletes an existing record
RecordsApi getRecord GET /api/record/{recordId} Gets record by id
RecordsApi getRecordVersion GET /api/record/{recordId}/versions/{version} Gets concrete record version
RecordsApi getRecordVersions GET /api/record/{recordId}/versions Gets all record versions by id
RecordsApi updateRecord PUT /api/record/{recordId} Updates record
RecordsApi updateRecordOwner PUT /api/record/{recordId}/owner/{ownerId} Updates a record's owner
SearchApi searchRecords POST /api/search/records/{type}/datastore/{datastoreId} Search records
SearchApi searchUsers POST /api/search/users/datastore/{datastoreId} Search users
UserApi createUser POST /api/user/{datastoreId} Creates a user
UserApi deleteUser DELETE /api/user/{userId} Deletes an existing user
UserApi forgetUser PUT /api/user/forget/{userId} Forgets user
UserApi getUser GET /api/user/{userId} Gets user by id
UserApi getUserVersion GET /api/user/{userId}/versions/{version} Gets concrete user version
UserApi getUserVersions GET /api/user/{userId}/versions Gets all record versions by id
UserApi updateUser PUT /api/user/{userId} Updates user

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

You can’t perform that action at this time.