Created on 06-06-2016 01:41 PM - edited 09-16-2022 03:23 AM
Below is the command used :
[it1@sandbox root]$ curl -i --header "Accept:application/json" -H "Content-Type:application/j son" --user admin:admin -X POST http://127.0.0.1:6080/service/public/api/policy -d '{ "policy Name":"hadoopdev-testing-policy2","resourceName":"/demo/data/test","description":"Testing pol icy for /demo/data/test","repositoryName":"sandbox_hdfs","repositoryType":"HDFS","permList":[ {"userList":["mkgt1"],"permList":["Read"]},{"groupList":["IT"],"permList":["Read"]}],"isEnabl ed":true,"isRecursive":true,"isAuditEnabled":true,"version":"0.1.0","replacePerm":false}'
Created 06-06-2016 09:17 PM
Is /demo/data/test a correct path? Have you tried "./demo/data/test" or "demo/data/test" or the absolute path?
Created 06-07-2016 12:29 AM
Thanks Stanca, but tried changing the path but still get the same error. "Like....."
HTTP/1.1 404 Not Found Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=14DC40BFED4EC4D2010A87FFA6DAEBDE; Path=/; HttpOnly X-Frame-Options: DENY Content-Length: 0 Date: Tue, 07 Jun 2016 00:27:40 GMT [it1@sandbox root]$
Created 06-09-2016 03:32 AM
What HDP sandbox version do you use? I am intrigued on whether your sandbox supports HTTP 1.0 or 1.1. True, 1.0 is very old and it is unlikely the case, but you should still check. I run the following command on HDP 2.4 sandbox:
curl --head 127.0.0.1
and the result is:
HTTP/1.1 200 OK Date: Thu, 09 June 2016 03:26:25 GMT Server: gunicorn/19.1.1 ...
Created 06-09-2016 03:38 AM
Thanks @Constantin Stanca
Command works well.. However error still remains.
HTTP/1.1 200 OK Date: Thu, 09 Jun 2016 03:35:48 GMT Server: gunicorn/19.1.1 Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 Connection: close