In this article
Table of Contents | ||||
---|---|---|---|---|
|
Overview
This use case demonstrates how you can use SnapLogic Data Science to configure SnapLogic Pipelines as REST APIs to receive requests from external applications. Currently, we support the following two types of REST APIs that are called tasks in SnapLogic:
...
Triggered Task | Ultra Task | |
---|---|---|
Objective | Trigger the API using a URL | Real-time API that has a very low response time |
Latency | High | Very low |
Resource Consumption | Start a new Pipeline execution for each request | The Pipeline is active all the time |
Number of Documents | Any number of input/output documents | 1 input document for 1 output document |
This document explains how you can use the SnapLogic platform to run the Pipelines as APIs and is structured as follows:
- Data Science API Pipeline: Describes the Pipeline you must build to run as an API.
- Request format: Describes the request format to send API requests.
- Configuring and managing Ultra Tasks: Describes how to schedule and manage Ultra Tasks.
- Testing Ultra Tasks: Describes how to test the Ultra Tasks.
...
- Click Create in the Create Task dialog and click Show tasks in this project in Manager to go to the Manager page.
- Click the task name to edit the task settings.
- Click next to the task, and then click Details. The task detail popup appears, complete with the HTTP Endpoint URL.
- Click Details to see the task statistics. You can see that there are 7 API instances that have started so far.
However, only 2 API instances are running as shown in the following image from the Dashboard page. The API instance stops, and a new one is created if the Pipeline fails.
Testing Ultra Tasks
There are many tools that you can use to test your Ultra Tasks (APIs). However, if you would like to have a regression/automated test, we recommend that you build a Pipeline to do this, so you can schedule it to run on a daily/weekly basis.
Pipeline
Use the JSON Generator Snap to generate a sample request and use the REST Post Snap to send a request to the Ultra Task. You can download this Pipeline here.
...