Forum Discussion
Hello @Rahul,
You can compare the two list by first merging them using the Join Snap. Then, using the following expression in a Mapper Snap to compare the lists:
$api_list.length == $snowflake_list.length ? ($api_list.filter(x => $snowflake_list.indexOf(x) != -1).length == $api_list.length) : false
Here is a sample pipeline:
–sl-comm-compare-lists_2023_07_08.slp (6.6 KB)
Let me know if this is of any help. 🙂
Regards,
Aleksandar.
- tlikarish7 years agoEmployee
Have you taken a look at the Rest Snap Pack?
- Rudradip7 years agoNew Contributor II
I am also facing the same issue . Is there any way out to call the curl command from the REST snaps ? I checked the documentation but could not find anything regarding that .
- robin7 years agoFormer Employee
Can you provide an example of the type of curl command(s) you wish to run?
- smudassir7 years agoEmployee
If you want to execute CURL command, you can use Script snap. You have choice to choose between JavaScript/Python/Ruby. Using Python, you can invoke CURL command via SubProcess module. subprocess — Subprocess management — Python 3.10.6 documentation
- Rudradip7 years agoNew Contributor II
This type of sample curl comand : "curl -v http://localhost:8093/query/service
-d ‘statement=SELECT text FROM tweets WHERE rating = $1 AND when > $2&args=[ 9.5, “1-1-2014”]’ " - smudassir7 years agoEmployee
First of all, I hope your service http://localhost:8093/query/service is located within the plex/node where you are executing the pipeline. If not, then its an incorrect use-case. If yes, then there are two ways to do it.
(a) Use REST POST snap. The entire body can be given in Entity property.
(b) Use Script snap with python/javascript and invoke the post call using the respective library.But, first option is the best and the easiest.
- Sowmya_Rayavara7 years agoNew Contributor III
I have used Rest post snap and it is working for me
- anivtk6 years agoNew Contributor II
Sowmya,
I saw your post for running curl command and saw that you ran it successfully using REST POST. can you please share details how to run the curl command using REST POST.
Note: I need to run the curl command like
curl -v -u abc@pqr.com -H ‘Content-Type:application/json’ --data-binary ‘{“unlock”:true}’ ‘https://elastic.snaplogic.com/api/1/rest/asset/user/xyz@pqr.com’
- Sowmya_Rayavara6 years agoNew Contributor III
Hi Anil,
Provide the URL “https://elastic.snaplogic.com/api/1/rest/asset/user/xyz@pqr.com” in service URL and mention content type as application/json
If you use username & password as authentication then use rest basic auth account for authorization
- acesario5 years agoContributor II
Does this mean that your document$ ‘$’ is the curl?
What if I want to use this?
curl -f -u “demo:ce544b6ea52a5621fb9d55f8b542d14d” \ -o result.pdf \ -F “url=http://en.wikipedia.org” \ https://api.pdfcrowd.com/convert/20.10/