-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43926/#review129829
-----------------------------------------------------------


Ship it!




Ship It!

- Sid Wagle


On April 20, 2016, 6:45 p.m., Ajit Kumar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43926/
> -----------------------------------------------------------
> 
> (Updated April 20, 2016, 6:45 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Zhe (Joe) Wang, Nate Cole, 
> Sumit Mohanty, Sid Wagle, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-15150
>     https://issues.apache.org/jira/browse/AMBARI-15150
> 
> 
> Repository: ambari
> 
> 
> 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.
> API response for bulk delete
> {code}
> curl -u admin:admin  -H 'X-Requested-By: ambari' -X DELETE 
> http://c6401.ambari.apache.org:8080/api/v1/clusters/a/hosts -d 
> '{"RequestInfo":{"query":"Hosts/host_name.in(c6401.ambari.apache.org,c6402.ambari.apache.org)"}}'
> {
>   "deleteResult" : [
>     {
>       "deleted" : {
>         "key" : "c6402.ambari.apache.org"
>       }
>     },
>     {
>       "error" : {
>         "key" : "c6401.ambari.apache.org",
>         "code" : 500,
>         "message" : "org.apache.ambari.server.AmbariException: Cannot remove 
> host c6401.ambari.apache.org from a.  The following roles exist, and these 
> components must be stopped if running, and then deleted: ZOOKEEPER_SERVER"
>       }
>     }
>   ]
> }
> {code}
> 
> 
> Sample code for how each resource provider can set metadata for delete 
> https://reviews.apache.org/r/43927/.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/handlers/BaseManagementHandler.java
>  c34f0d7 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/handlers/CreateHandler.java
>  691a3ee 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/handlers/DeleteHandler.java
>  8580196 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/handlers/QueryCreateHandler.java
>  534ee7b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/handlers/UpdateHandler.java
>  bb66fae 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/DeleteResultMetadata.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/Result.java 
> fabab62 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ResultImpl.java
>  adcbde1 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ResultMetadata.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/serializers/JsonSerializer.java
>  c17f162 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
>  ac9935d 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DeleteStatusMetaData.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestStatusImpl.java
>  b0fde8a 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/spi/RequestStatus.java
>  f9847a9 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/spi/RequestStatusMetaData.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/handlers/DeleteHandlerTest.java
>  fb70be6 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/services/DeleteResultMetaDataTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/services/serializers/JsonSerializerTest.java
>  d854dcf 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/DeleteStatusMetaDataTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestStatusImplTest.java
>  cd61822 
> 
> Diff: https://reviews.apache.org/r/43926/diff/
> 
> 
> Testing
> -------
> 
> manual testing
> Unit test
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>

Reply via email to