[
https://issues.apache.org/jira/browse/AMBARI-18011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15532161#comment-15532161
]
Hudson commented on AMBARI-18011:
---------------------------------
SUCCESS: Integrated in Jenkins build Ambari-branch-2.5 #91 (See
[https://builds.apache.org/job/Ambari-branch-2.5/91/])
AMBARI-18011. API for bulk delete hostcomponents (ajit) (smohanty:
[http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=39557dbd86c213548f2e3085a5a5613577e20595])
* (edit)
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
* (edit)
ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
* (edit)
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
* (edit)
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
* (edit)
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
* (edit)
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
AMBARI-18104. Unit Tests Broken Due to AMBARI-18011. (mpapirkovskyy) (smohanty:
[http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=98b8d6e247229b2f0d7cf9e1044dfc36cc6421d8])
* (edit)
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java
* (edit)
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
> Add api for bulk delete host component
> --------------------------------------
>
> Key: AMBARI-18011
> URL: https://issues.apache.org/jira/browse/AMBARI-18011
> Project: Ambari
> Issue Type: Task
> Components: ambari-server
> Affects Versions: 3.0.0
> Reporter: Ajit Kumar
> Assignee: Ajit Kumar
> Fix For: 3.0.0
>
> Attachments: rb50450.patch
>
>
> This api takes in query and instead of failing fast on the first error, puts
> the best effort to delete all requested hosts. Response should be json object
> which has deleted keys and keys which failed to delete with exception.
> Sample API calls:
> Delete all host components on a set of hosts:
> {code}
> Request:
> curl -i -uadmin:admin -H 'X-Requested-By: ambari' -X DELETE
> http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/host_components -d
> '{"RequestInfo":{"query":"HostRoles/host_name.in(c6401.ambari.apache.org,c6402.ambari.apache.org)"}}'
> Response
> {
> "deleteResult" : [
> {
> "deleted" : {
> "key" : "c6401.ambari.apache.org/HIVE_METASTORE"
> }
> },
> {
> "deleted" : {
> "key" : "c6402.ambari.apache.org/MYSQL_SERVER"
> }
> },
> {
> "error" : {
> "key" : "c6402.ambari.apache.org/RESOURCEMANAGER",
> "code" : 500,
> "message" : "org.apache.ambari.server.AmbariException: Host Component
> cannot be removed, clusterName=c1, serviceName=YARN,
> componentName=RESOURCEMANAGER, hostname=c6402.ambari.apache.org, request={
> clusterName=c1, serviceName=YARN, componentName=RESOURCEMANAGER,
> hostname=c6402.ambari.apache.org, desiredState=null, state=null,
> desiredStackId=null, staleConfig=null, adminState=null}"
> }
> }
> ]
> }
> {code}
> Delete selected host components on a set of host
> {code}
> Request:
> curl -i -uadmin:admin -H 'X-Requested-By: ambari' -X DELETE
> http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/host_components -d
> '{"RequestInfo":{"query":"HostRoles/host_name.in(c6401.ambari.apache.org,c6402.ambari.apache.org)&HostRoles/component_name.in(NODEMANAGER)"}}'
> Response:
> {
> "deleteResult" : [
> {
> "deleted" : {
> "key" : "c6401.ambari.apache.org/NODEMANAGER"
> }
> },
> {
> "error" : {
> "key" : "c6402.ambari.apache.org/NODEMANAGER",
> "code" : 500,
> "message" : "org.apache.ambari.server.AmbariException: Host Component
> cannot be removed, clusterName=c1, serviceName=YARN,
> componentName=NODEMANAGER, hostname=c6402.ambari.apache.org, request={
> clusterName=c1, serviceName=YARN, componentName=NODEMANAGER,
> hostname=c6402.ambari.apache.org, desiredState=null, state=null,
> desiredStackId=null, staleConfig=null, adminState=null}"
> }
> }
> ]
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)