You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Kishor Gollapalliwar <ki...@gmail.com> on 2020/12/03 03:32:25 UTC

Re: Review Request 73033: RANGER-2972: REST api to delete service/ repo using cluster name

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73033/
-----------------------------------------------------------

(Updated Dec. 3, 2020, 3:32 a.m.)


Review request for ranger, Dhaval Shah, Dineshkumar Yadav, Jayendra Parab, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.


Bugs: RANGER-2972
    https://issues.apache.org/jira/browse/RANGER-2972


Repository: ranger


Description
-------

Create REST api in ranger admin which will delete services/ repos associated with a cluster.


Diffs
-----

  security-admin/src/main/java/org/apache/ranger/db/XXServiceConfigMapDao.java 4217473fe 
  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 39869d385 
  security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java 1e38ef1b5 
  security-admin/src/main/resources/META-INF/jpa_named_queries.xml 1ba652905 


Diff: https://reviews.apache.org/r/73033/diff/2/


Testing
-------

Existing Functionality:
1.CREATE service via UI
2.CREATE service via CURL
3.UPDATE service via UI
4.UPDATE service via CURL
5.DELETE service via UI
6.DELETE service via CURL

New Functinality:
1.Curl command to tear down cluster, with zero associated services
2.Curl command to tear down cluster, with more than 1 associated services (single cluster)
3.Curl command to tear down cluster, with more than 1 associated services (multi cluster)

Sample Curl Commands:
1. curl -v -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/services -d '{"name":"hive2","displayName":"hive2","description":"hive2","isEnabled":true,"tagService":"","configs":{"service.user.hive":"hive","service.user.group.hadoop":"hadoop","service.user.group.public":"public","username":"admin","password":"admin","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","cluster.name":"cluster3"},"type":"hive"}'
2. curl -v -u admin:admin123 -X PUT -H "Accept:application/json" -H "Content-Type:application/json" "http://localhost:6080/service/plugins/services/12" -d '{"id":14,"guid":"43a890b3-a4c2-4ff8-95d7-1e7c3abb08c9","isEnabled":true,"createdBy":"Admin","updatedBy":"Admin","createTime":1606197964895,"updateTime":1606197964896,"version":1,"type":"hive","name":"hive2","displayName":"hive2","description":"hive2","configs":{"cluster.name":"cluster4","password":"*****","service.user.group.public":"public","service.user.hive":"hive","service.user.group.hadoop":"hadoop","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","username":"admin"},"policyVersion":1,"policyUpdateTime":1606197964897,"tagVersion":1,"tagUpdateTime":1606197964897}'
3. curl -iv -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/cluster/tear-down/cluster3


Thanks,

Kishor Gollapalliwar


Re: Review Request 73033: RANGER-2972: REST api to delete service/ repo using cluster name

Posted by Mehul Parikh <xs...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73033/#review222314
-----------------------------------------------------------


Ship it!




Ship It!

- Mehul Parikh


On Dec. 9, 2020, 5:54 a.m., Kishor Gollapalliwar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73033/
> -----------------------------------------------------------
> 
> (Updated Dec. 9, 2020, 5:54 a.m.)
> 
> 
> Review request for ranger, Dhaval Shah, Dineshkumar Yadav, Jayendra Parab, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2972
>     https://issues.apache.org/jira/browse/RANGER-2972
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Create REST api in ranger admin which will delete services/ repos associated with a cluster.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/model/ServiceDeleteResponse.java PRE-CREATION 
>   security-admin/src/main/java/org/apache/ranger/db/XXServiceConfigMapDao.java 4217473fe 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 1049d16a5 
>   security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java 1e38ef1b5 
>   security-admin/src/main/resources/META-INF/jpa_named_queries.xml 1ba652905 
> 
> 
> Diff: https://reviews.apache.org/r/73033/diff/6/
> 
> 
> Testing
> -------
> 
> Existing Functionality:
> 1.CREATE service via UI
> 2.CREATE service via CURL
> 3.UPDATE service via UI
> 4.UPDATE service via CURL
> 5.DELETE service via UI
> 6.DELETE service via CURL
> 
> New Functinality:
> 1.Curl command to tear down cluster, with zero associated services
> 2.Curl command to tear down cluster, with more than 1 associated services (single cluster)
> 3.Curl command to tear down cluster, with more than 1 associated services (multi cluster)
> 
> Sample Curl Commands:
> 1. curl -v -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/services -d '{"name":"hive2","displayName":"hive2","description":"hive2","isEnabled":true,"tagService":"","configs":{"service.user.hive":"hive","service.user.group.hadoop":"hadoop","service.user.group.public":"public","username":"admin","password":"admin","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","cluster.name":"cluster3"},"type":"hive"}'
> 2. curl -v -u admin:admin123 -X PUT -H "Accept:application/json" -H "Content-Type:application/json" "http://localhost:6080/service/plugins/services/12" -d '{"id":14,"guid":"43a890b3-a4c2-4ff8-95d7-1e7c3abb08c9","isEnabled":true,"createdBy":"Admin","updatedBy":"Admin","createTime":1606197964895,"updateTime":1606197964896,"version":1,"type":"hive","name":"hive2","displayName":"hive2","description":"hive2","configs":{"cluster.name":"cluster4","password":"*****","service.user.group.public":"public","service.user.hive":"hive","service.user.group.hadoop":"hadoop","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","username":"admin"},"policyVersion":1,"policyUpdateTime":1606197964897,"tagVersion":1,"tagUpdateTime":1606197964897}'
> 3. curl -iv -u admin:admin123 -X DELETE -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/cluster-services/cluster3
> 
> 
> Thanks,
> 
> Kishor Gollapalliwar
> 
>


Re: Review Request 73033: RANGER-2972: REST api to delete service/ repo using cluster name

Posted by Kishor Gollapalliwar <ki...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73033/
-----------------------------------------------------------

(Updated Dec. 9, 2020, 5:54 a.m.)


Review request for ranger, Dhaval Shah, Dineshkumar Yadav, Jayendra Parab, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.


Changes
-------

Created string literal constant and used constant instead of literal


Bugs: RANGER-2972
    https://issues.apache.org/jira/browse/RANGER-2972


Repository: ranger


Description
-------

Create REST api in ranger admin which will delete services/ repos associated with a cluster.


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/model/ServiceDeleteResponse.java PRE-CREATION 
  security-admin/src/main/java/org/apache/ranger/db/XXServiceConfigMapDao.java 4217473fe 
  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 1049d16a5 
  security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java 1e38ef1b5 
  security-admin/src/main/resources/META-INF/jpa_named_queries.xml 1ba652905 


Diff: https://reviews.apache.org/r/73033/diff/6/

Changes: https://reviews.apache.org/r/73033/diff/5-6/


Testing
-------

Existing Functionality:
1.CREATE service via UI
2.CREATE service via CURL
3.UPDATE service via UI
4.UPDATE service via CURL
5.DELETE service via UI
6.DELETE service via CURL

New Functinality:
1.Curl command to tear down cluster, with zero associated services
2.Curl command to tear down cluster, with more than 1 associated services (single cluster)
3.Curl command to tear down cluster, with more than 1 associated services (multi cluster)

Sample Curl Commands:
1. curl -v -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/services -d '{"name":"hive2","displayName":"hive2","description":"hive2","isEnabled":true,"tagService":"","configs":{"service.user.hive":"hive","service.user.group.hadoop":"hadoop","service.user.group.public":"public","username":"admin","password":"admin","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","cluster.name":"cluster3"},"type":"hive"}'
2. curl -v -u admin:admin123 -X PUT -H "Accept:application/json" -H "Content-Type:application/json" "http://localhost:6080/service/plugins/services/12" -d '{"id":14,"guid":"43a890b3-a4c2-4ff8-95d7-1e7c3abb08c9","isEnabled":true,"createdBy":"Admin","updatedBy":"Admin","createTime":1606197964895,"updateTime":1606197964896,"version":1,"type":"hive","name":"hive2","displayName":"hive2","description":"hive2","configs":{"cluster.name":"cluster4","password":"*****","service.user.group.public":"public","service.user.hive":"hive","service.user.group.hadoop":"hadoop","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","username":"admin"},"policyVersion":1,"policyUpdateTime":1606197964897,"tagVersion":1,"tagUpdateTime":1606197964897}'
3. curl -iv -u admin:admin123 -X DELETE -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/cluster-services/cluster3


Thanks,

Kishor Gollapalliwar


Re: Review Request 73033: RANGER-2972: REST api to delete service/ repo using cluster name

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73033/#review222310
-----------------------------------------------------------


Fix it, then Ship it!





security-admin/src/main/java/org/apache/ranger/db/XXServiceConfigMapDao.java
Line 95 (original), 91 (patched)
<https://reviews.apache.org/r/73033/#comment311372>

    Please consider not using string literals in the code.


- Abhay Kulkarni


On Dec. 8, 2020, 2:08 p.m., Kishor Gollapalliwar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73033/
> -----------------------------------------------------------
> 
> (Updated Dec. 8, 2020, 2:08 p.m.)
> 
> 
> Review request for ranger, Dhaval Shah, Dineshkumar Yadav, Jayendra Parab, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2972
>     https://issues.apache.org/jira/browse/RANGER-2972
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Create REST api in ranger admin which will delete services/ repos associated with a cluster.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/model/ServiceDeleteResponse.java PRE-CREATION 
>   security-admin/src/main/java/org/apache/ranger/db/XXServiceConfigMapDao.java 4217473fe 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 1049d16a5 
>   security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java 1e38ef1b5 
>   security-admin/src/main/resources/META-INF/jpa_named_queries.xml 1ba652905 
> 
> 
> Diff: https://reviews.apache.org/r/73033/diff/5/
> 
> 
> Testing
> -------
> 
> Existing Functionality:
> 1.CREATE service via UI
> 2.CREATE service via CURL
> 3.UPDATE service via UI
> 4.UPDATE service via CURL
> 5.DELETE service via UI
> 6.DELETE service via CURL
> 
> New Functinality:
> 1.Curl command to tear down cluster, with zero associated services
> 2.Curl command to tear down cluster, with more than 1 associated services (single cluster)
> 3.Curl command to tear down cluster, with more than 1 associated services (multi cluster)
> 
> Sample Curl Commands:
> 1. curl -v -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/services -d '{"name":"hive2","displayName":"hive2","description":"hive2","isEnabled":true,"tagService":"","configs":{"service.user.hive":"hive","service.user.group.hadoop":"hadoop","service.user.group.public":"public","username":"admin","password":"admin","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","cluster.name":"cluster3"},"type":"hive"}'
> 2. curl -v -u admin:admin123 -X PUT -H "Accept:application/json" -H "Content-Type:application/json" "http://localhost:6080/service/plugins/services/12" -d '{"id":14,"guid":"43a890b3-a4c2-4ff8-95d7-1e7c3abb08c9","isEnabled":true,"createdBy":"Admin","updatedBy":"Admin","createTime":1606197964895,"updateTime":1606197964896,"version":1,"type":"hive","name":"hive2","displayName":"hive2","description":"hive2","configs":{"cluster.name":"cluster4","password":"*****","service.user.group.public":"public","service.user.hive":"hive","service.user.group.hadoop":"hadoop","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","username":"admin"},"policyVersion":1,"policyUpdateTime":1606197964897,"tagVersion":1,"tagUpdateTime":1606197964897}'
> 3. curl -iv -u admin:admin123 -X DELETE -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/cluster-services/cluster3
> 
> 
> Thanks,
> 
> Kishor Gollapalliwar
> 
>


Re: Review Request 73033: RANGER-2972: REST api to delete service/ repo using cluster name

Posted by Kishor Gollapalliwar <ki...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73033/
-----------------------------------------------------------

(Updated Dec. 8, 2020, 2:08 p.m.)


Review request for ranger, Dhaval Shah, Dineshkumar Yadav, Jayendra Parab, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.


Changes
-------

Updated code such that, tag based services will not be deleted as part of this new API


Bugs: RANGER-2972
    https://issues.apache.org/jira/browse/RANGER-2972


Repository: ranger


Description
-------

Create REST api in ranger admin which will delete services/ repos associated with a cluster.


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/model/ServiceDeleteResponse.java PRE-CREATION 
  security-admin/src/main/java/org/apache/ranger/db/XXServiceConfigMapDao.java 4217473fe 
  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 1049d16a5 
  security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java 1e38ef1b5 
  security-admin/src/main/resources/META-INF/jpa_named_queries.xml 1ba652905 


Diff: https://reviews.apache.org/r/73033/diff/5/

Changes: https://reviews.apache.org/r/73033/diff/4-5/


Testing
-------

Existing Functionality:
1.CREATE service via UI
2.CREATE service via CURL
3.UPDATE service via UI
4.UPDATE service via CURL
5.DELETE service via UI
6.DELETE service via CURL

New Functinality:
1.Curl command to tear down cluster, with zero associated services
2.Curl command to tear down cluster, with more than 1 associated services (single cluster)
3.Curl command to tear down cluster, with more than 1 associated services (multi cluster)

Sample Curl Commands:
1. curl -v -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/services -d '{"name":"hive2","displayName":"hive2","description":"hive2","isEnabled":true,"tagService":"","configs":{"service.user.hive":"hive","service.user.group.hadoop":"hadoop","service.user.group.public":"public","username":"admin","password":"admin","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","cluster.name":"cluster3"},"type":"hive"}'
2. curl -v -u admin:admin123 -X PUT -H "Accept:application/json" -H "Content-Type:application/json" "http://localhost:6080/service/plugins/services/12" -d '{"id":14,"guid":"43a890b3-a4c2-4ff8-95d7-1e7c3abb08c9","isEnabled":true,"createdBy":"Admin","updatedBy":"Admin","createTime":1606197964895,"updateTime":1606197964896,"version":1,"type":"hive","name":"hive2","displayName":"hive2","description":"hive2","configs":{"cluster.name":"cluster4","password":"*****","service.user.group.public":"public","service.user.hive":"hive","service.user.group.hadoop":"hadoop","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","username":"admin"},"policyVersion":1,"policyUpdateTime":1606197964897,"tagVersion":1,"tagUpdateTime":1606197964897}'
3. curl -iv -u admin:admin123 -X DELETE -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/cluster-services/cluster3


Thanks,

Kishor Gollapalliwar


Re: Review Request 73033: RANGER-2972: REST api to delete service/ repo using cluster name

Posted by Kishor Gollapalliwar <ki...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73033/
-----------------------------------------------------------

(Updated Dec. 7, 2020, 5:40 a.m.)


Review request for ranger, Dhaval Shah, Dineshkumar Yadav, Jayendra Parab, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.


Changes
-------

Update RR with review comment changes suggested by Abhay


Bugs: RANGER-2972
    https://issues.apache.org/jira/browse/RANGER-2972


Repository: ranger


Description
-------

Create REST api in ranger admin which will delete services/ repos associated with a cluster.


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/model/ServiceDeleteResponse.java PRE-CREATION 
  security-admin/src/main/java/org/apache/ranger/db/XXServiceConfigMapDao.java 4217473fe 
  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 1049d16a5 
  security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java 1e38ef1b5 
  security-admin/src/main/resources/META-INF/jpa_named_queries.xml 1ba652905 


Diff: https://reviews.apache.org/r/73033/diff/4/

Changes: https://reviews.apache.org/r/73033/diff/3-4/


Testing
-------

Existing Functionality:
1.CREATE service via UI
2.CREATE service via CURL
3.UPDATE service via UI
4.UPDATE service via CURL
5.DELETE service via UI
6.DELETE service via CURL

New Functinality:
1.Curl command to tear down cluster, with zero associated services
2.Curl command to tear down cluster, with more than 1 associated services (single cluster)
3.Curl command to tear down cluster, with more than 1 associated services (multi cluster)

Sample Curl Commands:
1. curl -v -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/services -d '{"name":"hive2","displayName":"hive2","description":"hive2","isEnabled":true,"tagService":"","configs":{"service.user.hive":"hive","service.user.group.hadoop":"hadoop","service.user.group.public":"public","username":"admin","password":"admin","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","cluster.name":"cluster3"},"type":"hive"}'
2. curl -v -u admin:admin123 -X PUT -H "Accept:application/json" -H "Content-Type:application/json" "http://localhost:6080/service/plugins/services/12" -d '{"id":14,"guid":"43a890b3-a4c2-4ff8-95d7-1e7c3abb08c9","isEnabled":true,"createdBy":"Admin","updatedBy":"Admin","createTime":1606197964895,"updateTime":1606197964896,"version":1,"type":"hive","name":"hive2","displayName":"hive2","description":"hive2","configs":{"cluster.name":"cluster4","password":"*****","service.user.group.public":"public","service.user.hive":"hive","service.user.group.hadoop":"hadoop","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","username":"admin"},"policyVersion":1,"policyUpdateTime":1606197964897,"tagVersion":1,"tagUpdateTime":1606197964897}'
3. curl -iv -u admin:admin123 -X DELETE -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/cluster-services/cluster3


Thanks,

Kishor Gollapalliwar


Re: Review Request 73033: RANGER-2972: REST api to delete service/ repo using cluster name

Posted by Kishor Gollapalliwar <ki...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73033/
-----------------------------------------------------------

(Updated Dec. 7, 2020, 5:32 a.m.)


Review request for ranger, Dhaval Shah, Dineshkumar Yadav, Jayendra Parab, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.


Changes
-------

Updated curl command to be in sync with latest changes in API


Bugs: RANGER-2972
    https://issues.apache.org/jira/browse/RANGER-2972


Repository: ranger


Description
-------

Create REST api in ranger admin which will delete services/ repos associated with a cluster.


Diffs
-----

  agents-common/src/main/java/org/apache/ranger/plugin/model/ServiceDeleteResponse.java PRE-CREATION 
  security-admin/src/main/java/org/apache/ranger/db/XXServiceConfigMapDao.java 4217473fe 
  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 1049d16a5 
  security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java 1e38ef1b5 
  security-admin/src/main/resources/META-INF/jpa_named_queries.xml 1ba652905 


Diff: https://reviews.apache.org/r/73033/diff/3/


Testing (updated)
-------

Existing Functionality:
1.CREATE service via UI
2.CREATE service via CURL
3.UPDATE service via UI
4.UPDATE service via CURL
5.DELETE service via UI
6.DELETE service via CURL

New Functinality:
1.Curl command to tear down cluster, with zero associated services
2.Curl command to tear down cluster, with more than 1 associated services (single cluster)
3.Curl command to tear down cluster, with more than 1 associated services (multi cluster)

Sample Curl Commands:
1. curl -v -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/services -d '{"name":"hive2","displayName":"hive2","description":"hive2","isEnabled":true,"tagService":"","configs":{"service.user.hive":"hive","service.user.group.hadoop":"hadoop","service.user.group.public":"public","username":"admin","password":"admin","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","cluster.name":"cluster3"},"type":"hive"}'
2. curl -v -u admin:admin123 -X PUT -H "Accept:application/json" -H "Content-Type:application/json" "http://localhost:6080/service/plugins/services/12" -d '{"id":14,"guid":"43a890b3-a4c2-4ff8-95d7-1e7c3abb08c9","isEnabled":true,"createdBy":"Admin","updatedBy":"Admin","createTime":1606197964895,"updateTime":1606197964896,"version":1,"type":"hive","name":"hive2","displayName":"hive2","description":"hive2","configs":{"cluster.name":"cluster4","password":"*****","service.user.group.public":"public","service.user.hive":"hive","service.user.group.hadoop":"hadoop","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","username":"admin"},"policyVersion":1,"policyUpdateTime":1606197964897,"tagVersion":1,"tagUpdateTime":1606197964897}'
3. curl -iv -u admin:admin123 -X DELETE -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/cluster-services/cluster3


Thanks,

Kishor Gollapalliwar


Re: Review Request 73033: RANGER-2972: REST api to delete service/ repo using cluster name

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73033/#review222294
-----------------------------------------------------------


Fix it, then Ship it!





security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
Lines 4471 (patched)
<https://reviews.apache.org/r/73033/#comment311362>

    LOG.debug("<== ServiceREST.deleteServiceById() - deletedServiceName="+deletedServiceName);


- Abhay Kulkarni


On Dec. 3, 2020, 11:51 a.m., Kishor Gollapalliwar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73033/
> -----------------------------------------------------------
> 
> (Updated Dec. 3, 2020, 11:51 a.m.)
> 
> 
> Review request for ranger, Dhaval Shah, Dineshkumar Yadav, Jayendra Parab, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2972
>     https://issues.apache.org/jira/browse/RANGER-2972
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Create REST api in ranger admin which will delete services/ repos associated with a cluster.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/model/ServiceDeleteResponse.java PRE-CREATION 
>   security-admin/src/main/java/org/apache/ranger/db/XXServiceConfigMapDao.java 4217473fe 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 1049d16a5 
>   security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java 1e38ef1b5 
>   security-admin/src/main/resources/META-INF/jpa_named_queries.xml 1ba652905 
> 
> 
> Diff: https://reviews.apache.org/r/73033/diff/3/
> 
> 
> Testing
> -------
> 
> Existing Functionality:
> 1.CREATE service via UI
> 2.CREATE service via CURL
> 3.UPDATE service via UI
> 4.UPDATE service via CURL
> 5.DELETE service via UI
> 6.DELETE service via CURL
> 
> New Functinality:
> 1.Curl command to tear down cluster, with zero associated services
> 2.Curl command to tear down cluster, with more than 1 associated services (single cluster)
> 3.Curl command to tear down cluster, with more than 1 associated services (multi cluster)
> 
> Sample Curl Commands:
> 1. curl -v -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/services -d '{"name":"hive2","displayName":"hive2","description":"hive2","isEnabled":true,"tagService":"","configs":{"service.user.hive":"hive","service.user.group.hadoop":"hadoop","service.user.group.public":"public","username":"admin","password":"admin","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","cluster.name":"cluster3"},"type":"hive"}'
> 2. curl -v -u admin:admin123 -X PUT -H "Accept:application/json" -H "Content-Type:application/json" "http://localhost:6080/service/plugins/services/12" -d '{"id":14,"guid":"43a890b3-a4c2-4ff8-95d7-1e7c3abb08c9","isEnabled":true,"createdBy":"Admin","updatedBy":"Admin","createTime":1606197964895,"updateTime":1606197964896,"version":1,"type":"hive","name":"hive2","displayName":"hive2","description":"hive2","configs":{"cluster.name":"cluster4","password":"*****","service.user.group.public":"public","service.user.hive":"hive","service.user.group.hadoop":"hadoop","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","username":"admin"},"policyVersion":1,"policyUpdateTime":1606197964897,"tagVersion":1,"tagUpdateTime":1606197964897}'
> 3. curl -iv -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/cluster/tear-down/cluster3
> 
> 
> Thanks,
> 
> Kishor Gollapalliwar
> 
>


Re: Review Request 73033: RANGER-2972: REST api to delete service/ repo using cluster name

Posted by Kishor Gollapalliwar <ki...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73033/
-----------------------------------------------------------

(Updated Dec. 3, 2020, 11:51 a.m.)


Review request for ranger, Dhaval Shah, Dineshkumar Yadav, Jayendra Parab, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Vishal Suvagia, and Velmurugan Periasamy.


Changes
-------

Update code to handle review comments by Abhay


Bugs: RANGER-2972
    https://issues.apache.org/jira/browse/RANGER-2972


Repository: ranger


Description
-------

Create REST api in ranger admin which will delete services/ repos associated with a cluster.


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/model/ServiceDeleteResponse.java PRE-CREATION 
  security-admin/src/main/java/org/apache/ranger/db/XXServiceConfigMapDao.java 4217473fe 
  security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 1049d16a5 
  security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java 1e38ef1b5 
  security-admin/src/main/resources/META-INF/jpa_named_queries.xml 1ba652905 


Diff: https://reviews.apache.org/r/73033/diff/3/

Changes: https://reviews.apache.org/r/73033/diff/2-3/


Testing
-------

Existing Functionality:
1.CREATE service via UI
2.CREATE service via CURL
3.UPDATE service via UI
4.UPDATE service via CURL
5.DELETE service via UI
6.DELETE service via CURL

New Functinality:
1.Curl command to tear down cluster, with zero associated services
2.Curl command to tear down cluster, with more than 1 associated services (single cluster)
3.Curl command to tear down cluster, with more than 1 associated services (multi cluster)

Sample Curl Commands:
1. curl -v -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/services -d '{"name":"hive2","displayName":"hive2","description":"hive2","isEnabled":true,"tagService":"","configs":{"service.user.hive":"hive","service.user.group.hadoop":"hadoop","service.user.group.public":"public","username":"admin","password":"admin","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","cluster.name":"cluster3"},"type":"hive"}'
2. curl -v -u admin:admin123 -X PUT -H "Accept:application/json" -H "Content-Type:application/json" "http://localhost:6080/service/plugins/services/12" -d '{"id":14,"guid":"43a890b3-a4c2-4ff8-95d7-1e7c3abb08c9","isEnabled":true,"createdBy":"Admin","updatedBy":"Admin","createTime":1606197964895,"updateTime":1606197964896,"version":1,"type":"hive","name":"hive2","displayName":"hive2","description":"hive2","configs":{"cluster.name":"cluster4","password":"*****","service.user.group.public":"public","service.user.hive":"hive","service.user.group.hadoop":"hadoop","jdbc.driverClassName":"org.apache.hive.jdbc.HiveDriver","jdbc.url":"jdbc://localhost:9083","username":"admin"},"policyVersion":1,"policyUpdateTime":1606197964897,"tagVersion":1,"tagUpdateTime":1606197964897}'
3. curl -iv -u admin:admin123 -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:6080/service/plugins/cluster/tear-down/cluster3


Thanks,

Kishor Gollapalliwar