Bhanu
Bhanu

Reputation: 419

MarkLogic - Invoke custom API through gradle

MarkLogic version - 9.0-6.2

I have a custom javascript code deployed into data-hub-MODULES database (plugins\entities\testentity\harmonize\REST\services\test.sjs). I am able to invoke this code using custom REST end point. However, I am trying to invoke this code through a batch script (.sh) so that I can schedule the run through our enterprise scheduler (Control-M).

Can I use gradle tasks to run my javascript module? Are there any other options available?

One option I have is to use informatica to make REST API call to run my module, but I am looking for simpler options. Scheduling directly in MarkLogic admin console is not an option for me as we need to schedule jobs only through enterprise scheduler (Control-M)

Thanks in advance!

Upvotes: 1

Views: 133

Answers (1)

rjrudin
rjrudin

Reputation: 2236

Note you can always use /v1/eval to invoke custom code - http://docs.marklogic.com/REST/POST/v1/eval

ml-gradle then provides a few options for either hitting /v1/eval or a custom REST extension - https://github.com/marklogic-community/ml-gradle/wiki/Writing-your-own-task#custom-tasks-that-talk-to-the-client-rest-api

One advantage to doing this via Gradle is that you have all of your host/port/authentication information likely already defined in gradle.properties, and thus you don't need to duplicate it in a bash script.

Upvotes: 1

Related Questions