Migrating from REST Snaps to HTTP Client Snap
Overview
This article describes the procedure for migrating your existing REST pipelines and accounts to the HTTP Client Snap and accounts. Refer to this example pipeline for migrating the REST pipeline and account.
You can use the Parent pipeline to bulk migrate the REST pipelines/accounts to HTTP Client Snap/accounts.
Prerequisites
Valid access to the Org and Project space.
Optional. Identify the number of REST pipelines and accounts to be migrated. You can use the Scan pipeline to scan the project paths where the REST pipelines are located.
Save a version of the pipelines containing the REST Snaps. You can use the automated Version creation pipeline to create a version of the given pipeline, if the Action type is
“update".If you need to update the existing pipelines, set the Action type to
updatein your migration pipeline configuration.If you need to create new pipelines and accounts, set the Action type to
createin your migration pipeline configuration.Also, create a new project and copy the assets, such as files, to the same project folder.
Understanding the migration tool
The migration tool includes the following pipelines:
Scan pipeline: This pipeline scans the specified project path for all the available REST pipelines and accounts and provides both lists.
Version creation pipeline: This pipeline automatically creates versions for all the REST pipelines in a given project. Hence, we recommend that you use this pipeline if you want to update your existing pipelines because it assists you in the migration process by creating backup versions of the affected pipelines.
Child pipelines: Includes the following pipelines for migrating REST accounts and pipelines:
Account migration: REST to HTTP Client Account migration
Pipeline migration: REST to HTTP Client Pipeline migration
Parent pipeline: This pipeline runs the child pipelines to migrate REST pipelines and accounts in bulk to the HTTP Client.
Scan pipeline
This pipeline scans the metadata information and identifies the REST pipelines/accounts and writes their path to the output.
Step 1—Use the Scan pipeline to identify the REST pipeline and account paths by scanning the specified Project path
Input
In the JSON Generator Snap, provide the Project path where the REST pipelines and accounts are located.
Pass the path value in the Pipeline parameters.
Output
The pipeline scans the project path, gets the paths of the REST pipelines and accounts, and writes them to a file in SLDB.
Version Creation pipeline
This pipeline scans all pipelines in a project, identifies those containing REST snaps, and creates new versions for them.
Step 2—Use the Version creation pipeline to automatically create a version of all the REST pipelines in a given project
For creating a version, the HTTP Client Snap (Creating version) must be configured with the Basic Authentication Account with the user who has sufficient permission to create a version for the specified pipeline.
Input
Configure the following Pipeline parameters:
path: /<org>/<project-space>/<folder>instance_url: https://cdn.elastic.snaplogic.comorhttps://cdn.emea.snaplogic.com
Output
List Pipelines: Lists all the pipelines in a project.
Filter: This excludes the pipelines which are having * in the pipeline path, as the Metadata snap fails to read that pipeline path
Fetch pipelines: Reads the pipeline metadata.
Pipeline scan: Scans through pipeline configurations to identify those containing REST Snaps.
Create version: Makes an HTTP POST request to create a new version of the pipeline, as shown below:
Download the REST to HTTP Client Version creation pipeline.
Child pipelines
Step 3—Use the REST to HTTP Client Account migration pipeline and the REST to HTTP Client Pipeline migration pipeline
The child pipelines can migrate only one account or one pipeline at a time.
Accounts migration pipeline: This pipeline identifies the REST accounts and maps them to the compatible HTTP Client accounts. Learn more about the mapping of the accounts.
Input:
Configure the following pipeline parameters:
Set the Asset path in the SnapLogic Read Snap to read the asset (account).
Output:
Using the Script (Mapping Metadata) Snap the pipeline converts the REST accounts to the compatible HTTP Client accounts in the destination folder.
Download the REST accounts migration pipeline.
REST pipeline migration pipeline: This pipeline identifies the REST Snaps in a given pipeline and maps their properties to those of the HTTP Client Snap. Learn more about mapping the Snap settings.
Input:
Configure the following pipeline parameters:
For the update action type, we recommend that you run the Version creation pipeline to create versions for all pipelines in the specified project before you begin the migration.
Set the Asset path in the SnapLogic Read Snap to read the asset (pipeline).
Output:
The pipeline converts the REST metadata to HTTP client Snaps using the Script (Update Metadata) Snap.
Based on the
createaction type, the pipeline creates a new pipeline.
Download the REST pipelines migration pipeline.
Parent pipeline
This pipeline routes to pipeline flow or account flow based on the migration type specified in the JSON Generator Snap. It scans the project path for REST pipelines and accounts and sends them to the Pipeline Execute Snap, which executes the child pipeline.
Note that this pipeline migrates the pipelines/accounts in bulk.
Step 4—Use the parent pipeline to migrate the pipelines/accounts to HTTP Client
Input:
In the JSON Generator Snap, provide the following JSON input:
Source project path: Project to migrate.
Action: create/update
Type: account/pipeline
Destination folder (is required for
createAction type).Build tag: <Snap Pack version number>
[
{
"projectPath": "/<Org>/<Project>/<folder>",
"type": "pipeline",
"descFolder": "/<Org>/<Project>/<folder>",
"action": "create",
"apisuiteBuildTag": "440patches30202"
}
]
In the Pipeline Execute Snap, the Pool size is set to 10 to migrate pipelines in parallell.
If your environment supports a larger pool size, you can increase the size to speed up the migration.
Output:
The migrated pipelines are saved in Manager, and the errors are routed to the error view, and written to a file.
The errors that occur during this migration are routed to the Error view, and those errors, in turn, are routed to a file in SLDB that can be debugged later. Refer to the Troubleshooting section for more details.
Recommendations
We highly recommend that you use the Create Action type when migrating your accounts/pipelines. Because, the Update action has a limitation. When you use the Update action, the account type still displays as REST type in the Manager despite being migrated to HTTP Client, as the Manager doesn’t fetch the account type information from the account metadata.
Limitations
The following fields are not available in the HTTP Client Snap:
Batch Size: To work with input documents in a batch using the HTTP Client, refer to this example.
Process array
Normalize URL: The HTTP Client normalizes the URL by default at the backend.
There is no property available to give the upload file Name for both single-file and multi-file uploads; the HTTP Client Snap uses the uploaded file name internally.
There is no property available for the Upload transfer request type, so by default, the HTTP Client Snap calculates content length internally.
Accounts:
As part of the migration, we are copying the active REST account token to the HTTP Client token for all the token-based accounts. As long as the token is valid and the target endpoint contains the valid redirect URI (
https://elastic.snaplogic.com/api/1/rest/admin/oauth2callback/apisuite), the accounts will work as expected.REST In-memory OAuth2 accounts will be migrated to HTTP Client OAuth2 account by considering
Header authenticated=trueandAuth endpoint=token endpoint URLto avoid validation errors.The script migrates, Dynamic OAuth2 accounts to Secure Header account in HTTP Client.
Important:
For all OAuth2 accounts, the OAuth2 app in the endpoint, such as Microsoft, must be configured with HTTP Client’s Redirect URI: (https://elastic.snaplogic.com/api/1/rest/admin/oauth2callback/apisuite)
Limitations that were fixed as part of the Migration Pipeline
The HTTP Client Snap writes an output document after evaluating Pagination Properties. Therefore, when
snap.out.totalCountis used, it is not evaluated correctly. We have addressed this limitation as part of the script, by updating thesnap.out.totalCounttosnap.out.totalCount+1for pagination properties.For multipart-related file uploads, in the REST Post snap, when an entity is not provided, the Snap constructs the JSON body based on the filename of the selected file. This is automated in the HTTP Client Snap, where the script automatically generates a new row in HTTP Client snap with entity fileName in case of multipart related.
The REST Snap outputs the response as part of the response object, but the structure of the response is different for the HTTP Client. So, this conversion is addressed in the upstream Snap.
View names between REST and HTTP Client have changed. As part of the script, we are making sure that output and error views are connected properly.
In REST Snaps, we encode the query params using
+, but in HTTP Client, by default, we use%20. As part of the script, we enabled the Use form encoding for spaces checkbox in the HTTP Client to ensure the same behavior as REST Snaps.
Things to note
When the Pagination URL is provided, the Page size is set to 0 in the HTTP Client Get request.
When single file upload and multi-file upload are selected and the Upload body type is multipart form-data, two upload requests occur as part of the REST POST snap, but after migration, only one request is sent that includes both single file upload and multi-file upload.
The header names differ between REST and HTTP Client Snaps. The REST Snap converts all header names to lowercase, whereas the HTTP Client Snap preserves the original case. As a result, after migrating from REST to HTTP Client Snap, any downstream Snaps that reference header values from the HTTP Client Snap fail because of these differences in header property formatting before and after the migration.
Troubleshooting
Error | Resolution |
|---|---|
If you encounter a Script error, for example:
| Contact customer support at support@snaplogic.com for assistance. |
Metadata error: Errors while reading the pipeline metadata. | Ensure the source pipeline is working as expected. |
Pipeline error: Error while creating the Migration pipeline. |
|
If a source pipeline/account contains an * (asterisk), the pipeline might skip migrating that pipeline, as the SnapLogic Metadata Read Snap fails to read that path. | Remove the * (asterisk) from the pipeline name and retry. |
Header properties
The header properties depend on the endpoint. However, if the upstream Snaps in your REST pipelines use the following headers, use the corresponding HTTP Client Snap header in title case, as shown in the following table:
REST Get Snap Headers | HTTP Client Snap Headers |
|---|---|
"access-control-allow-methods": | "Access-Control-Allow-Methods": |
"access-control-allow-credentials": | "Access-Control-Allow-Credentials": |
"access-control-expose-headers": | "Access-Control-Expose-Headers": |
"access-control-allow-headers" | "Access-Control-Allow-Headers": |
"access-control-max-age": | "Access-Control-Max-Age": |
"cache-control": | "Cache-Control": |
"connection": | "Connection": |
"content-security-policy": | "Content-Security-Policy": |
“content-type": | "Content-Type": |
"content-length": | "Content-Length": |
"date": | "Date": |
"expires": | "Expires": |
"pragma": | "Pragma": |
"server": | "Server": |
"strict-transport-security": | "Strict-Transport-Security": |
"x-sl-userid": | "X-SL-StatusCode": |
"x-xss-protection": | "X-XSS-Protection": |
"x-frame-options": | "X-Frame-Options": |
"x-content-type-options": | "X-Content-Type-Options": |
"x-sl-statuscode": | "X-SL-UserID": |
Example of migrating a REST pipeline to an HTTP client
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2025 SnapLogic, Inc.