Start a new topic
Answered

How to access continuous load data using REST API

Hi community,


I am having trouble finding the appropriate REST API to access the data that I have just posted to a continuous load manipulating only basic entities. It seems that the {entity}/SA and {entity}/SA4L({loadId}) will only display the data once the continuous load is actually triggered.  


Did I miss something ?


Thanks for the help.


Background info

I have a continuous load PerformChanges (32) that runs every 10 seconds and uses a job that contains a single entity: Person.


1. Send request to the continuous load:

  

Endpoint = 'http://localhost:8088/semarchy/api/rest/loads/MyDataLoc/PerformChanges'

Payload= {
    "action": "PERSIST_DATA",
    "persistOptions": {
        "responsePayload": "SUMMARY_AND_RECORDS",
        "persistMode": "ALWAYS",
        "optionsPerEntity": {
            "Person": {}
        },
        "missingIdBehavior": "GENERATE"
    },
    "persistRecords": {
        "Person": [
            {
                "ID": "5d2adaee-fadd-11ed-a923-637a445a8654",
                "FirstName": "Salah",
            }
        ]
    }
}

 2. Accessing either  http://localhost:8088/semarchy/api/rest/query/MyDataLoc/Person/SA?$f=LoadID=32 or http://localhost:8088/semarchy/api/rest/query/MyDataLoc/Person/SA4L(32) does not show the record I have just posted.

 


Best Answer

Hey Slah !


If the purpose is to query the data in a second Rest API call, this is not supported for continuous loads. Please see the documentation 

image

Stéphanie.


Hi Salah,

Just to understand, why do you want access the data submitted ?

I think you can not use this API on Continuous Load because the records are assigned to a new load_id  by the Continuous Load.
You push data on load id 32 but the CL (or engine) assigns data another (next) load id.

If necessary to access the data submitted, you can maybe use an action "CREATE_LOAD_AND_SUBMIT" instead of a continuous load :

 

"action": "CREATE_LOAD_AND_SUBMIT",

And the response contains the load id 

 

"loadId" : 25508,


Regards,

Romain.

 


1 person likes this

Hi guys,


I am still struggling with this problem. Is there any way I can access the data submitted to a continuous load before this load is processed out of the queue ?


Any creative workaround (other than write you own SQL) is welcome.


Thanks again!

-Salah

Answer

Hey Slah !


If the purpose is to query the data in a second Rest API call, this is not supported for continuous loads. Please see the documentation 

image

Stéphanie.

Hi there,

Using a rest api call to integrate data in a continuous load, you need to set the value of the continuous load in the endpoint url : 


http://localhost:8088/semarchy/api/rest/loads/MyDataLoc/PerformChanges/{load-id-or-load-name}



Hope is clear and don't hesitate if need more explanation.

Take care.

Login to post a comment