[
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 : <resource-key>
},
deleted : {
key : <resource-key>
},
...
error: {
key : <resource-key>
code: 404
message: "Resource not found"
},
error: {
key : <resource-key>
code: 404
message: "Resource not found"
}
...
]
{code}
was:
DELETE API in ambari server can send only 200 OK or other response code with
empty body. Current framework doesn't support sending json response in body.
In case of bulk DELETE API, server should send a json response to communicate
keys which got deleted successfully and error message for keys which were not
deleted.
DELETE response json object should be
{code}
deleteResult : [
deleted : {
key : <resource-key>
},
deleted : {
key : <resource-key>
},
...
error: {
key : <resource-key>
code: 404
message: "Resource not found"
},
error: {
key : <resource-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
>
>
> 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 : <resource-key>
> },
> deleted : {
> key : <resource-key>
> },
> ...
> error: {
> key : <resource-key>
> code: 404
> message: "Resource not found"
> },
> error: {
> key : <resource-key>
> code: 404
> message: "Resource not found"
> }
> ...
> ]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)