How to get H2O automl working from command line using CURL? - h2o

I am trying to launch H2O AutoML from command line with CURL and could not get it working..
The base command is something as below:
curl -X POST -H 'application/x-www-form-urlencoded; charset=UTF-8' -d 'training_frame=12cfbae9-af66-42fd-835f-13ccc5a508ab' "http://localhost:54321/99/AutoMLBuilder"
I tried with various parameters with but I always get error as unknown parameter.

I had the use the CURL command as below to make it work:
curl -X POST -H 'Content-Type: application/json' -d '{"input_spec":{"training_frame":"1acfbae9-af66-42fd-835f-13ccc5a508cb","response_column":"mpg","ignored_columns":[],"sort_metric":null},"build_models":{"exclude_algos":[]},"build_control":{"nfolds":5,"keep_cross_validation_predictions":true,"keep_cross_validation_models":true,"balance_classes":false,"class_sampling_factors":[],"max_after_balance_size":5,"stopping_criteria":{"seed":-1,"max_models":0,"max_runtime_secs":30,"stopping_rounds":3,"stopping_tolerance":-1},"project_name":"automl-mpg"}}' http://localhost:54321/99/AutoMLBuilder
Above 1acfbae9-af66-42fd-835f-13ccc5a508cb is the training frame id.

Related

Generating a Session Key in Windows 10

I am a noob at all this and I am trying to run a Linux curl command in Windows 10 to generate session key. The following is the command in Linux.
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys"}' http://localhost:9933/
When I run the command at the Windows command prompt I am receiving the following error.
E:\>curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys"}' http://localhost:9933/
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 18:
author_rotateKeys}'
^
E:\>
Any idea how would I covert the command to work with Windows 10? I just need to generate a key for a node I need to connect to from a Windows box.
If you don't have WSL2 setup (useful if you ever need other *nix tools) where that command will just work as is, or don't want to use PowerShell where
curl.exe -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys"}' http://localhost:9933/
works (notice the curl is replaced with curl.exe, because in PowerShell 5.1 curl is just an alias for Invoke-WebRequest, it's removed in PowerShell 6 and later, but they're not built-in and won't replace PowerShell 5.1 when installed), then on Command Prompt replace single quote with double quote, and for double quote inside them, escape it (replace it with \")
curl -H "Content-Type: application/json" -d "{\"id\":1, \"jsonrpc\":\"2.0\", \"method\": \"author_rotateKeys\"}" http://localhost:9933/

elastic search curl command error for bulk import json file "url not specified"

i am new to elastic search trying to bulk import accounts.json file with curl command. but every time got error URL not specified.
elasticsearch and kibana folder are on desktop and also accounts.json file also on desktop.
here is the curl command with error
desktop user$ curl -H 'Content-Type: application/json' -XPOST'localhost:9200/bank/_bulk?pretty&refresh' --data-binary '#accounts.json'
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
please help
You need to use this command to bulk import data:
curl -H 'Content-Type: application/json' -XPOST 'localhost:9200/index-name/_bulk?pretty' --data-binary #my_newline_json.json
Make sure that you have correctly specified the path of your json file in the curl command
Refer to this answer, to know more about this.

Jira API GET all users from Jira project with specific status

In my Ruby app I'm trying to get all agent users from my service desk board. It means all users with status: 'ServiceDesk'. Is it possible using only base auth?
In curl I was trying something like:
curl -D -u USERNAME:PASSWORD -X GET -H "Content-Type: application/json" https://company_name.atlassian.net/rest/api/2/user/assignable/search?project=SERVICEDESK
But all what I get is an error:
Warning: The file name argument '-u' looks like a flag.
curl: (3) URL using bad/illegal format or missing URL
{"errorMessages":["Internal server error"],"errors":{}}%
Is there any way to get those data with basic auth?
I think there's an issue with the curl command, try this
curl -D- -u USERNAME:PASSWORD https://company_name.atlassian.net/rest/api/2/user/assignable/search?project=SERVICEDESK

Rasa nlu server problem with the error 500 and parsing

I started the nlu server by typing this command in cmd:
rasa run --enable-api -m models/(name of my package).tar
and then in other cmd window typed:
curl localhost:5005/model/parse -d ‘{“text”:“hello”}’
after that I got an error:
{“version”:“1.2.3”,“status”:“failure”,“message”:“An unexpected error
occurred. Error: Failed when parsing body as
json”,“reason”:“ParsingError”,“details”:{},“help”:null,“code”:500}
What is the reason for it? what should I change to get the normal(200) output?
can you please try this and see whether it works.
rasa run -m models --enable-api --cors ‘*’ --debug
CURL POST Request (Mac and Ubuntu):
curl -H "Content-Type: application/json" -X POST -d '{"sender":"y1mLd","message":"hi"}' http://localhost:5005/webhooks/rest/webhook
Note : for windows you need to remove the quotes
curl -H "Content-Type: application/json" -X POST -d {"sender":"y1mLd","message":"hi"} http://localhost:5005/webhooks/rest/webhook
Output
[{"recipient_id":"y1mLd","text":"Welcome, Please let me know how I could be a help today!"}]

bat file for deleting index in solr

I want to use a bat file to clear my index in solr. I found the following solution:
https://superuser.com/questions/134685/run-curl-commands-from-windows-console
I downloaded cURL and a copied to my system32 folder. then I openend my windows commandline and typed
curl www.google.com
and it seems to work fine.
then I tried to add the following command:
curl http://berserkerpc:444/solr/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'
here the how to from solr:
http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
I got the message back that there is a a syntactic issue with '<' while processing.
here is the complete bat file I want to create:
curl http://berserkerpc:444/solr/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'
curl http://berserkerpc:444/solr/update --data '<commit/>' -H 'Content-type:text/xml; charset=utf-8'
any suggestion how to solve this???
With Curl try calling -
curl -H 'Content-Type: text/xml' http://localhost:8983/solr/update --data-binary '<delete><query>*:*</query></delete>'
Be sure to use commit=true to reflect these changes.
OR Directly from from Browser -
http://localhost:8983/solr/update?stream.body=<delete><query>*:*</query></delete>&commit=true

Resources