How do we execute export command through curl command?
How do we execute export command through curl command?
Below is the curl command for export,
-curl -o exportFileName “http://172.40.9.120:9700/diyotta-rest/export?project=qa_testing&layer=layer_17&objecttype=datapoint&dbtype=Hive&object=hdp_132” -H “Authorization: E82MooZ9umI/VdgWPFC2YWTL8Ce8mra7FsvEOi5gmTQ=”
here, we won’t get any error when we execute. just it will create a dummy file without any data when we don’t give correct details in curl command for export.
Question:
How do we execute Import command through curl command?
Answer:
Below is the curl command for import,
-curl -X POST -H “Content-Type: multipart/form-data” -F “file=exportJF_5231” “http://172.40.9.120:9700/diyotta-rest/import?project=qa_testing”
-H “Authorization: xCw0WKSzOqHXvrMs7exqEnLFXQv45bUBhZzwRtjDWrk=”
when we gave wrong project name in the URL the below are the error will show when we execute the command,
– {“code”:”400″,”Message”:”Import Request Failed: ESM00013: Invalid Object: qa_testing does not Exists.”} [cqabuild@lpcibm1 ~] $
If we did not give authorization i.e., in command then below are the error will appear when we execute.
-{“code”:”400″,”Message”:”ESM00079″}
If we have not gave http URL path, then below are the error will appear
-curl: no URL specified!
If we have not gave correct format of URL then below are the error will appear.
-HTTP Status 404 – Not Found.