Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 724B3200B81 for ; Fri, 5 Aug 2016 21:16:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 71333160A8E; Fri, 5 Aug 2016 19:16:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CBE95160AAC for ; Fri, 5 Aug 2016 21:16:21 +0200 (CEST) Received: (qmail 14345 invoked by uid 500); 5 Aug 2016 19:16:20 -0000 Mailing-List: contact issues-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list issues@ambari.apache.org Received: (qmail 14119 invoked by uid 99); 5 Aug 2016 19:16:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Aug 2016 19:16:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id BB0DC2C0E39 for ; Fri, 5 Aug 2016 19:16:20 +0000 (UTC) Date: Fri, 5 Aug 2016 19:16:20 +0000 (UTC) From: "Ajit Kumar (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (AMBARI-18011) Add api for bulk delete host component MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 05 Aug 2016 19:16:22 -0000 [ https://issues.apache.org/jira/browse/AMBARI-18011?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ajit Kumar resolved AMBARI-18011. --------------------------------- Resolution: Fixed Submitted to trunk. > 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: 2.5.0 > Reporter: Ajit Kumar > Assignee: Ajit Kumar > Fix For: 2.5.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)