DLC REST API Example

DLC exposes REST services that can be invoked by a client to tell ActivePivot when to load/unload data. The description for the REST service is located at:

/services/connectors/rest/dlc/v1

To know how to load / unload data, and the related REST requests, please refer the DLC Requests page.

Request example from Postman software

NOTE: The following images do not contain the REST Version. The REST Version is required to connect with any of Data Connectors services. The correct endpoint will look like for REST Version v1:

http://localhost:9090/services/connectors/rest/dlc/v1/execute

Postman

Postman

Request example from Java

    final IDataLoadController controller = dataLoadControllerConfig.dataLoadController();
    final String[] dateTokens = {"2018-12-05","2018-12-04"};
    for (final String dateToken : dateTokens) {

        final Map<String, Object> fetchScope = new HashMap<>();
        fetchScope.put(DataLoadControllerRestService.SCOPE_KEY__COB_DATE, dateToken.replace("'", ""));

        controller.execute(
                new DataLoadControllerRequest(
                        LoadDataTxControllerTask.PLUGIN_KEY,
                        Arrays.asList(
                                DataLoadControllerConfig.TOPIC__PARAMETER_DATA),
                        parameterFetchScope));

        controller.execute(
                new DataLoadControllerRequest(
                        LoadDataTxControllerTask.PLUGIN_KEY,
                        Arrays.asList(
                                DataLoadControllerConfig.TOPIC__CONFIGURATION_DATA),
                        fetchScope));        
        }

Response format

DLC supports JSON format for responses to all requests.

Load data to a branch

NOTE: The following images do not contain the REST Version. The REST Version is required to connect with any of Data Connectors services. The correct endpoint will look like for REST Version v1:

http://localhost:9090/services/connectors/rest/dlc/v1/execute

DLC can load / unload data from a branch.

  1. Initial State - only master branch is present

    Postman

  2. Load 2018-12-05 data to a “whatif” branch

    Postman

  3. “whatif” branch loaded successfully

    Postman

  4. Unload “2018-12-05” data in “whatif” branch

    Postman

  5. No more 2018-12-05 data

    Postman