Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Tasks are a way to execute your pipelines using a fixed schedule or by accessing a URL. The URL method of execution can also feed data into a pipeline and receive the output of the pipeline. From the Tasks page, you can view what tasks are already available and create new ones. Since the pipelines executed by tasks will be run in an unattended mode, you can receive notifications of activity by specifying a comma-separated list of email addresses.

...


Hover over the task name to get access to the context menu. From there, you have access to view the task's activity log to see when it was created or modified.

...

This section covers some examples of using the cURL command-line tool to access task URLs.  Note that these are only examples of the syntax and are not functioning URLs.
 
To execute a pipeline that takes no input and has an unlinked output view that will write documents:
 

$ curl -u 'user@example.com:mypassword' https://elastic.Snaplogic.com/api/1/rest/slsched/feed/example/jobs/test-reader
{ "msg" : "Hello, World!" }
 


To execute a pipeline that takes a parameter and has an unlinked output view that writes a document:
 

$ curl -u 'user@example.com:mypassword' https://elastic.Snaplogic.com/api/1/rest/slsched/feed/example/jobs/test-hello?Name=John
{ "msg" : "Hello, John!" }


 To execute a pipeline that accepts a JSON document and transforms it:

 
$ curl -u 'user@example.com:mypassword' --data-binary '{ "name" : "Bob" }' --header "Content-Type:application/json" https://elastic.Snaplogic.com/api/1/rest/slsched/feed/example/jobs/test-transformer
{ "msg" : "Hello, Bob!" }

Debugging Mode

To make it easier to debug triggered executions of pipelines, you can check the Debug option in the task configuration dialog to record the next five invocations of the task. When enabled, the headers and content from the HTTP request and response will be saved in files on SLFS for each invocation. For example, when using a triggered task as a callback URL for another cloud service, enabling debugging will allow you to view the response that is being sent to the other cloud service. You can view the trace files in the Task Details page. The Open Trace Directory link will open the directory containing all of the trace files for this task.  You can also search for the files for a particular invocation by clicking the View Trace Files link in the details for that invocation in the execution history.

...

When you trigger the task, for example from a browser, you will get the following response on completion.
 

{ http_status_code: 200 }

 

 

It will wait until the pipeline has completed before displaying this message, which may take some time.

...

Now when you trigger the pipeline, the output from the response generator Snap (in this case, a JSON Generator responds with the message shown) will be provided almost as soon as the pipeline executions starts:

 

{ msg: "Started Ok", http_status_code: 200 }

 

The net effect of which is that the pipeline execution becomes "pseudo-asynchronous".

...