jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds] [Softlayer] Implements setting and retrieving the notes property (#756)
Date Fri, 05 Jun 2015 12:48:28 GMT
> @@ -149,4 +152,34 @@
>     @Produces(MediaType.APPLICATION_JSON)
>     @Fallback(Fallbacks.FalseOnNotFoundOr404.class)
>     boolean setTags(@PathParam("id") long id, @BinderParam(TagToJson.class) Set<String>
tags);
> +
> +   /**
> +    * Set notes (visible in UI)
> +    *
> +    * @param id
> +    *           id of the virtual guest
> +    */
> +   @Named("VirtualGuest:setNotes")
> +   @POST
> +   @Path("/SoftLayer_Virtual_Guest/{id}/editObject")
> +   @Produces(MediaType.APPLICATION_JSON)
> +   @Fallback(Fallbacks.FalseOnNotFoundOr404.class)

Not in POST/PUT operations. What the user will perceive is a method returning `null` instead
of failing. That seems correct when reading or deleting and the reference resource does not
exist, but when writing, we should assume it exists, otherwise, what does a `null` return
value mean in that case? The operation failed? You don't know. Did it succeed but there was
no response body? You don't know. Fallbacks to null on 404 reponses make sense for read/delete
operations, but should be removed from all POST/PUT ones.



---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/756/files#r31809111
Mime
View raw message