[ 
https://issues.apache.org/jira/browse/AMBARI-25449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16996807#comment-16996807
 ] 

Praveen Kumar K J V S edited comment on AMBARI-25449 at 12/15/19 5:28 PM:
--------------------------------------------------------------------------

In DeleteHandler.java, there is a as below 
{code:java}
// code placeholder
if (requestStatusMetaData.getClass() != DeleteStatusMetaData.class) {
     throw new IllegalArgumentException("RequestStatusDetails is not of type 
DeleteStatusDetails");
{code}
 

This above check fails because the requestStatusMetaData is of type 
DeleteHostComponentStatusMetaData.java which is a sub-class of 
DeleteStatusMetaData.class

 

Also the patch fixes the "key" in the returned json for a successful host 
component delete. Earlier it was of the format 

 
{noformat}
*no* further _formatting_ is done here
{
  "deleteResult" : [
     {
        "deleted" : {
            "key" : "<DELETED_COMPONENT_NAME>/<HOST_NAME>"
      }
    }
  ]
}{noformat}
 

 

It should have been

 
{noformat}
*no* further _formatting_ is done here

{ "deleteResult" : [
 { "deleted" : { "key" : "<HOST_NAME>/<DELETED_COMPONENT_NAME>" } }
 ]
}{noformat}
 


was (Author: praveenkjvs):
In DeleteHandler.java, there is a as below 
{code:java}
// code placeholder
if (requestStatusMetaData.getClass() != DeleteStatusMetaData.class) {
     throw new IllegalArgumentException("RequestStatusDetails is not of type 
DeleteStatusDetails");
{code}
 

This above check fails because the requestStatusMetaData is of type 
DeleteHostComponentStatusMetaData.java which is a sub-class of 
DeleteStatusMetaData.class

 

Also the patch fixes the "key" in the returned json for a successful host 
component delete. Earlier it was of the format 

 
{noformat}
*no* further _formatting_ is done here
{
  "deleteResult" : [
     {
        "deleted" : {
            "key" : "<DELETED_COMPONENT_NAME>/<HOST_NAME>"
      }
    }
  ]
}{noformat}
 

 

It should have been

{
 "deleted" :

{ "key" : "<HOST_NAME>/<DELETED_COMPONENT_NAME>" }

}

 

 

 

 

> Bulk DELETE API is broken
> -------------------------
>
>                 Key: AMBARI-25449
>                 URL: https://issues.apache.org/jira/browse/AMBARI-25449
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 2.7.3
>            Reporter: Praveen Kumar K J V S
>            Priority: Critical
>              Labels: patch-available
>             Fix For: 2.7.3
>
>         Attachments: bulk_delete_api.patch
>
>
> When calling the bulk delete API, for example 
>  
>  {{curl -k -u admin:admin -H }}{{"X-Requested-By: ambari"}} {{-X DELETE}}
>  
> {{"$HTTP_PROTOCOL://$CONSOLE_NODE:$PORT/api/v1/clusters/$CLUSTER/hosts/$hostName/host_components/"}}
> {{the response we get is:}}
> { "status" : 400, "message" : "Invalid Request: RequestStatusDetails is not 
> of type DeleteStatusDetails" }
> {{The expected result is something like described at }}
>  
> {{[https://cwiki.apache.org/confluence/display/AMBARI/Bulk+delete+components+on+multiple+hosts]}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to