08-04-2021 11:21 PM
Is there a way we can programmatically update the Service URL and HTTP header in the Rest Post snap, after copying a pipeline, which has a Rest Post Snap, from one project folder to another?
08-10-2021 03:03 PM
Hi @PulseAmit :
There are a couple of ways to achieve this. One way would be to define the Service URL and HTTP header(s) as pipeline parameters, and then expression enable those fields in the REST snap referencing those parameters (ex: _serviceurl for serviceurl pipeline parameter). You would then update the pipeline parameters of the pipeline you copied to the other project.
Another way, albeit a bit brute force, would be to export the pipeline, modify the field values in the exported json, and then import the modified pipeline into the other project folder.
Let me know if you want more details on either. Others may have craftier solutions.
08-11-2021 09:16 PM
Hi @mbowen ,
Thank You for the response.
Just wanted to give you an overview of the issue that arises due to the Service URL and HTTP header in the Rest Post snap.
When we copy any Pipeline from a PROD environment to a Non-PROD environment there is a wizard which asks for accounts. But It’ll not ask for any details regarding Rest Post Snap. So, we have to manually add the account and other details manually to the rest post-snap.
After adding an account on rest post-snap we also need to add Service URL and X API Key on the same snap and that is a manual process.
Service URL and Keys are Environment specific.
Is there any way where we automate this thing in Snaplogic?
Please Provide any possible solution around it to reduce manual intervention.
You can also refer to a ticket that is already open with Snaplogic Support.
Link: https://snaplogic.zendesk.com/hc/en-us/requests/42642
Just to let you know,
The other community post asking for The Migration of assets from one environment to another in Snaplogic is also address the same issue,
Link: The Migration of assets from one environment to other in Snaplogic
Let me know if you need more clarity on this.
Thank you,
Amit A.
08-17-2021 04:40 AM
Have you got a chance to review my response?
Let me know if you need anything else on this from my end.
waiting for a response from your side.
Thank You,
Amit A.
08-17-2021 01:24 PM
The account is optional for the REST POST snap which is probably why the wizard doesn’t prompt for it.
An expression library may help us here. The thinking is that we’ll define the REST account, Service URL, X API key, and whatever other common properties in this library (ex: env.expr)
You’ll see an Expression Library section in the pipeline parameters dialog. That’s where we’ll attach the expression lib.
We can then reference these expressions in the snap. Specifically, we can update the REST POST snap Service URL, HTTP Header, and Account reference to refer to these expressions.
As long as the relative path-ing to the expression library is the same across environments (orgs), I think this will work.
This is new to me too, so others who have deep kung-fu with this, please don’t hesitate to chime in. Here’s a link to our documentation of this:
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438110/Expression+Libraries
Thank you for creating a Support ticket for this. That actually will ensure more support cycles are devoted to this issue. Community has a weaker SLA.
I should be able to prepare an example later today, tomorrow for sure (Wed, 8/18).