Hafiz,
Is this still an issue or you were good after you corrected the json command?
You could use the following slightly modified curl command. Either it would
succeed or it’ll point you to the validation error that you are running into.
curl -H "Accept: application/json" -H "Content-Type: application/json" -u
admin:admin --data '{
"policyName":"hdt","resourceName":"/test","description":"curl","repositoryName":"hdfs-repo","repositoryType":"hdfs","permMapList":[{"userList":["mujadid"],"permList":["Read"]},{"groupList":["internal"],"permList":["Read"]}],"isEnabled":true,"isRecursive":true,"isAuditEnabled":true,"version":"1","replacePerm":false}'
http://122.129.79.69:6080/service/public/api/policy
Alok
From: Hafiz Mujadid
Reply-To:
"[email protected]<mailto:[email protected]>"
Date: Sunday, August 9, 2015 at 6:12 AM
To: "[email protected]<mailto:[email protected]>"
Subject: Re: rest api create policy giving 404 error
Hi sorry i was mistaking in json
here is my correct command
curl -i --header "Accept:application/json" -H "Content-Type:application/json"
--user admin:admin -X POST http://122.129.79.69:6080/service/public/api/policy
-d '{
"policyName":"hdt","resourceName":"/test","description":"curl","repositoryName":"hdfs-repo","repositoryType":"hdfs","permMapList":[{"userList":["mujadid"],"permList":["Read"]},{"groupList":["internal"],"permList":["Read"]}],"isEnabled":true,"isRecursive":true,"isAuditEnabled":true,"version":"1","replacePerm":false}'
On Sun, Aug 9, 2015 at 2:29 PM, Hafiz Mujadid
<[email protected]<mailto:[email protected]>> wrote:
Hi Experts!
I tried this command to create a new policy
curl -i --header "Accept:application/json" -H "Content-Type:application/json"
--user admin:admin -X POST http://122.129.79.69:6080/service/public/api/policy
-d '{
"policyName":"hdt",resourceName:"/test","description":"curl","repositoryName":"hdfs-repo","repositoryType":"hdfs","permMapList":[{"userList":["mujadid"],"permList":["Read"]},{"groupList":["internal"],"permList":["Read"]}],"isEnabled":true,isRecursive:true,"isAuditEnabled":true,"version":"1","replacePerm":false}'
But it is giving following response
HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=66399D5EE5D1859A293C467C0D300F87; Path=/; HttpOnly
Content-Length: 0
Date: Sun, 09 Aug 2015 09:11:49 GMT
--
Regards: HAFIZ MUJADID