[ 
https://issues.apache.org/jira/browse/BROOKLYN-353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15532486#comment-15532486
 ] 

Svetoslav Neykov edited comment on BROOKLYN-353 at 9/29/16 11:10 AM:
---------------------------------------------------------------------

Removing, double post.


was (Author: svet):
> Do you have any directions to do this?
If you can make the war file approach outlined below by [~rdowner] and 
[~andreaturli] work then you'll be better off going this way. Note that the 
rest resources are not contained in the war file so you can't add to them. 
Still you can create your own servlets which process the request and have 
access to Brooklyn's internals.

Just in case though - to override the BrooklynRestApi file:
  * create a normal java maven project
  * add a dependency on brooklyn-rest-resources
  * create a new java class "org.apache.brooklyn.rest.BrooklynRestApi", copying 
& pasting the content of the original one
  * add your classes
  * build the project and put the jar in the patches folder

> Is there any way we can make a Maven project which actually depends on 
> Brooklyn, instead? 
Yes, the clocker project is a good example of how to do it - 
https://github.com/brooklyncentral/clocker.
The steps are to:
  * create a java project which contains your classes.
  * create a maven project which generates a brooklyn distribution (using 
assembly maven plugin) with your changes in (depends on the above one). 

These two are combined in a single project in 
https://github.com/brooklyncentral/clocker/tree/master/dist.

The project also has an example of how to generate patches in 
https://github.com/brooklyncentral/clocker/tree/master/patches.

Also you can come to our IRC channel #brooklyncentral on Freenode to ask any 
questions.



> Best-practice for adding endpoints to the REST interface?
> ---------------------------------------------------------
>
>                 Key: BROOKLYN-353
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-353
>             Project: Brooklyn
>          Issue Type: Question
>    Affects Versions: 0.9.0
>            Reporter: Francesco Chicchiriccò
>
> At the [CHOReVOLUTION|http://www.chorevolution.eu] project we are using 
> Apache Brooklyn to manage the whole deployment.
> As we need to add some endpoints to the REST interface, is there any best 
> practice around? At the moment we are just adding our classes to the Brooklyn 
> codebase - which does not look particularly fancy.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to