ClientRequest clientRequest = newRequest(baseURI + "/containers/" + id);
response = clientRequest.body(mediaType, payload).post(new GenericType<ServiceResponse<String>>(){});
if( response.getStatus() == Response.Status.OK.getStatusCode() ) {
return response.getEntity();
}
throw new ClientResponseFailure("Unexpected response code: "+response.getStatus(), response );
} catch (ClientResponseFailure e) {
throw e;
} catch (Exception e) {
throw new ClientResponseFailure("Unexpected exception executing commands on container "+id, e, response );
}
}