Aaron, thanks for verifying.
Also it seems error code 404 is misleading. We should be returning 400. We might need JIRAs for both error code and also possibly for documentation. Thanks Bosco From: "Stromas, Aaron" <aaron.stro...@rsa.com> Reply-To: <user@ranger.incubator.apache.org> Date: Wednesday, July 20, 2016 at 8:46 AM To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Subject: Re: Question about Ranger REST URL with service-name component Yes, that was it (should have figured out myself…:() Best regards, -Aaron — Aaron Stromas | RSA The Security Division of EMC | Practice Consultant | Identity & Fraud Protection Practice | M +1 240 271 64 58 | From: Abhay Kulkarni <akulka...@hortonworks.com> Reply-To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Date: Wednesday, July 20, 2016 at 11:43 AM To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Subject: Re: Question about Ranger REST URL with service-name component Hi Aaron, This may have to do with ‘&’ being interpreted as a special character by shell ( to put the command in background ) which resulted in only the URL up to, but not including ‘&’ being sent across. Could you please try the following (note the single-quotes enclosing the URL string) ? curl -iv -u admin:admin -X DELETE 'http://192.168.26.111:6080/service/public/v2/api/policy?servicename=Sandbox_hdfs&policyname=appaccess' Thanks, -Abhay From: "Stromas, Aaron" <aaron.stro...@rsa.com> Reply-To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Date: Wednesday, July 20, 2016 at 7:08 PM To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Subject: Re: Question about Ranger REST URL with service-name component Hi Abhay, Worked with the exception of delete policy by service-name and policy name which resulted in HTTP 400: curl -iv -u admin:admin -X DELETE http://192.168.26.111:6080/service/public/v2/api/policy?servicename=Sandbox_hdfs&policyname=appaccess [1] 26496 acm-700:~ # * About to connect() to 192.168.26.111 port 6080 (#0) * Trying 192.168.26.111... connected * Connected to 192.168.26.111 (192.168.26.111) port 6080 (#0) * Server auth using Basic with user 'admin' > DELETE /service/public/v2/api/policy?servicename=Sandbox_hdfs HTTP/1.1 > Authorization: Basic YWRtaW46YWRtaW4= > User-Agent: curl/7.19.7 (x86_64-suse-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8j > zlib/1.2.7 libidn/1.10 > Host: 192.168.26.111:6080 > Accept: */* > < HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request < Server: Apache-Coyote/1.1 Server: Apache-Coyote/1.1 < Set-Cookie: JSESSIONID=5505699EDCFA217FFE606DF8831AD73A; Path=/; HttpOnly Set-Cookie: JSESSIONID=5505699EDCFA217FFE606DF8831AD73A; Path=/; HttpOnly < X-Frame-Options: DENY X-Frame-Options: DENY < Content-Type: text/html;charset=utf-8 Content-Type: text/html;charset=utf-8 < Content-Language: en Content-Language: en < Content-Length: 990 Content-Length: 990 < Date: Wed, 20 Jul 2016 13:37:16 GMT Date: Wed, 20 Jul 2016 13:37:16 GMT < Connection: close Connection: close < * Closing connection #0 <html><head><title>Apache Tomcat/7.0.55 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - Bad Request</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Bad Request</u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.55</h3></body></html> Best regards, -Aaron — Aaron Stromas | RSA The Security Division of EMC | Practice Consultant | Identity & Fraud Protection Practice | M +1 240 271 64 58 | From: Abhay Kulkarni <akulka...@hortonworks.com> Reply-To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Date: Wednesday, July 20, 2016 at 9:14 AM To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Subject: Re: Question about Ranger REST URL with service-name component Hi Aaron, I have marked the correct URLs below in red. Could you please use these URLs and share the results? Also, it will help to open a documentation JIRA for these issues. Thanks, -Abhay From: "Stromas, Aaron" <aaron.stro...@rsa.com> Reply-To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Date: Wednesday, July 20, 2016 at 6:16 PM To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Subject: Re: Question about Ranger REST URL with service-name component Hi Bosco, I still do. My previous post was concerning the create policy object where I had an error in the JSON payload. I listed the requests that I still have problems with, namely, Get service definition by name Update policy by service-name and policy-name Delete policy by service-name and policy-name Search policies in a service I forgot to mention that I’m testing in Hortonworks 2.4 sandbox. Best regards, -Aaron — Aaron Stromas | RSA The Security Division of EMC | Practice Consultant | Identity & Fraud Protection Practice | M +1 240 271 64 58 | From: Don Bosco Durai <bo...@apache.org> Reply-To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Date: Tuesday, July 19, 2016 at 5:22 PM To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Subject: Re: Question about Ranger REST URL with service-name component Aaron, are you still having this issues? Your previous mail said that you found errors in the log file. Thanks Bosco From: "Stromas, Aaron" <aaron.stro...@rsa.com> Reply-To: <user@ranger.incubator.apache.org> Date: Tuesday, July 19, 2016 at 1:17 PM To: "user@ranger.incubator.apache.org" <user@ranger.incubator.apache.org> Subject: Question about Ranger REST URL with service-name component Greetings, None of the REST API calls using the service-name do not work for me. All of the following return HTTP 404 curl -iv -u admin:admin -X GET http://192.168.26.111:6080/service/public/v2/api/servicedef/hdfs curl -iv -u admin:admin -X GET http://192.168.26.111:6080/service/public/v2/api/servicedef/name/hdfs curl -iv -u admin:admin -H "Content-Type: application/json" -d @hdfs-update-policy-by-name.payload -X PUT http://192.168.26.111:6080/service/public/v2/api/Sandbox_hdfs/policy/appaccess curl -iv -u admin:admin -H "Content-Type: application/json" -d @hdfs-update-policy-by-name.payload -X PUT http://192.168.26.111:6080/service/public/v2/api/service/Sandbox_hdfs/policy/appaccess curl -iv -u admin:admin -X DELETE http://192.168.26.111:6080/service/public/v2/api/Sandbox_hdfs/policy/appaccess curl -iv -u admin:admin -X DELETE http://192.168.26.111:6080/service/public/v2/api/policy?servicename=Sandbox_hdfs&policyname=appaccess curl -iv -u admin:admin -X GET http://192.168.26.111:6080/service/public/v2/api/Sandbox_hdfs/policy curl -iv -u admin:admin -X GET http://192.168.26.111:6080/service/public/v2/api/service/Sandbox_hdfs/policy Service name Sandbox_hdfs and policy app access exist and the calls that use ID rather than name work, so are the URLs incorrect? What should they be? Thanks. Best regards, -Aaron — Aaron Stromas | RSA The Security Division of EMC | Practice Consultant | Identity & Fraud Protection Practice | M +1 240 271 64 58 |