Return-Path: X-Original-To: apmail-ambari-issues-archive@minotaur.apache.org Delivered-To: apmail-ambari-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DE3711900E for ; Wed, 13 Apr 2016 18:55:25 +0000 (UTC) Received: (qmail 94776 invoked by uid 500); 13 Apr 2016 18:55:25 -0000 Delivered-To: apmail-ambari-issues-archive@ambari.apache.org Received: (qmail 94738 invoked by uid 500); 13 Apr 2016 18:55:25 -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 94728 invoked by uid 99); 13 Apr 2016 18:55:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Apr 2016 18:55:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6C0FC2C1F4E for ; Wed, 13 Apr 2016 18:55:25 +0000 (UTC) Date: Wed, 13 Apr 2016 18:55:25 +0000 (UTC) From: "Ajit Kumar (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMBARI-15150) Support response body for DELETE API MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-15150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ajit Kumar updated AMBARI-15150: -------------------------------- Description: Currently DELETE API only returns status code and no body. This doesn't fit well in bulk delete scenario as user needs to know which keys were deleted and which one failed and why. For this, ResourceProvider needs to return metadata as part of RequestStatus object which can be translated to metadata for Result object at API layer. At API layer, for all failed keys, reason code (like 404) is required which will make scripting easy instead of just including error message as string. DELETE response json object should be {code} { "deleteResult" : [ { "deleted" : { "key" : "" } }, { "deleted" : { "key" : "" } }, ... { "error" : { "key" : "", "code" : 404, "message" : "Resource not found" } }, { "error" : { "key" : "", "code" : 404, "message" : "Resource not found" } }, ... ] } {code} was: Currently DELETE API only returns status code and no body. This doesn't fit well in bulk delete scenario as user needs to know which keys were deleted and which one failed and why. For this, ResourceProvider needs to return metadata as part of RequestStatus object which can be translated to metadata for Result object at API layer. At API layer, for all failed keys, reason code (like 404) is required which will make scripting easy instead of just including error message as string. DELETE response json object should be {code} deleteResult : [ deleted : { key : }, deleted : { key : }, ... error: { key : code: 404 message: "Resource not found" }, error: { key : code: 404 message: "Resource not found" } ... ] {code} > Support response body for DELETE API > ------------------------------------- > > Key: AMBARI-15150 > URL: https://issues.apache.org/jira/browse/AMBARI-15150 > Project: Ambari > Issue Type: Bug > Components: ambari-server > Affects Versions: 2.4.0 > Reporter: Ajit Kumar > Assignee: Ajit Kumar > Fix For: 2.4.0 > > Attachments: rb43926.patch > > > Currently DELETE API only returns status code and no body. This doesn't fit well in bulk delete scenario as user needs to know which keys were deleted and which one failed and why. For this, ResourceProvider needs to return metadata as part of RequestStatus object which can be translated to metadata for Result object at API layer. > At API layer, for all failed keys, reason code (like 404) is required which will make scripting easy instead of just including error message as string. > DELETE response json object should be > {code} > { > "deleteResult" : [ > { > "deleted" : { > "key" : "" > } > }, > { > "deleted" : { > "key" : "" > } > }, > ... > { > "error" : { > "key" : "", > "code" : 404, > "message" : "Resource not found" > } > }, > { > "error" : { > "key" : "", > "code" : 404, > "message" : "Resource not found" > } > }, > ... > ] > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)