Re: [DISCUSS] REST + ambari

2017-05-09 Thread Otto Fowler
Thank you everyone. The property I needed was actually already in the configuration, but not referenced in the code, so I missed it. I have refactored to use the configuration properly. On May 8, 2017 at 10:21:14, Simon Elliston Ball (si...@simonellistonball.com) wrote: Not from an ENV variabl

Re: [DISCUSS] REST + ambari

2017-05-08 Thread Simon Elliston Ball
Not from an ENV variable per-se, but from the spring config. Hence anything in the application.yml can be pushed into a field in a REST service endpoint with the @Value annotation. Simon > On 8 May 2017, at 14:59, Otto Fowler wrote: > > So that stuff is read from the environment variable? >

Re: [DISCUSS] REST + ambari

2017-05-08 Thread Otto Fowler
Can anyone describe the configuration flow from packaging/ambari to the rest application FooConfig? If I was going to add a new ambari variable from metron_env.xml and expose it to rest? On May 8, 2017 at 09:59:10, Otto Fowler (ottobackwa...@gmail.com) wrote: So that stuff is read from the env

Re: [DISCUSS] REST + ambari

2017-05-08 Thread Otto Fowler
So that stuff is read from the environment variable? On May 8, 2017 at 09:27:48, Otto Fowler (ottobackwa...@gmail.com) wrote: OK, that is great. My works has bridged the move of rest into ambari. Mentally, I obviously haven’t caught up :) I’ll look for an example where we are reading applicatio

Re: [DISCUSS] REST + ambari

2017-05-08 Thread Otto Fowler
OK, that is great. My works has bridged the move of rest into ambari. Mentally, I obviously haven’t caught up :) I’ll look for an example where we are reading application configuration variables out in the rest service. Thanks! On May 8, 2017 at 09:08:46, Simon Elliston Ball (si...@simonellist

Re: [DISCUSS] REST + ambari

2017-05-08 Thread Ryan Merriman
It already works the way Simon describes. On Mon, May 8, 2017 at 8:08 AM, Simon Elliston Ball < si...@simonellistonball.com> wrote: > My proposal would be that the REST api use it’s application.yml for all > the parameters and have settings it needs included in that. E.g. the metron > directory y

Re: [DISCUSS] REST + ambari

2017-05-08 Thread Simon Elliston Ball
My proposal would be that the REST api use it’s application.yml for all the parameters and have settings it needs included in that. E.g. the metron directory you need is set as a property of that yml, which is then accessible through the spring config auto-wiring - @Value(“${metron.directory}”)

Re: [DISCUSS] REST + ambari

2017-05-08 Thread Otto Fowler
I’m not sure I understand.  Could you go on a bit? Right now, we have env parameters in ambari, that rest should honor.  I don’t understand how moving rest config into ambari get’s my rest service access to those parameters On May 8, 2017 at 08:56:21, Simon Elliston Ball (si...@simonellistonb

Re: [DISCUSS] REST + ambari

2017-05-08 Thread Simon Elliston Ball
Perhaps a better way of doing this would be to push the configuration of the REST api (the application.yml) into ambari control and expose parameters like that. That means the REST api doesn’t have to couple directly to Ambari, and doesn’t have to reinvent the Ambari paradigm (Ambari is not a co

Re: [DISCUSS] REST + ambari

2017-05-08 Thread Otto Fowler
The issue is that we have services that need to access the ambari rest api from inside the rest server. Technically, if someone changes the defaults for the metron directory etc, the rest won’t pick it up. I have a PR coming as a follow on to METRON-777 for installing extensions, and I write to h

Re: [DISCUSS] REST + ambari

2017-05-08 Thread Nick Allen
As opposed to using the Ambari REST API to get this information? On Mon, May 8, 2017 at 8:06 AM, Otto Fowler wrote: > I was thinking about have an ambari ‘service’ in the rest api. > The initial purpose would be to be able to retrieve ambari configuration > variables for the metron service and

[DISCUSS] REST + ambari

2017-05-08 Thread Otto Fowler
I was thinking about have an ambari ‘service’ in the rest api. The initial purpose would be to be able to retrieve ambari configuration variables for the metron service and components. The api would be PUT: login to ambari -> ambari credentials for use with ambari, session variable GET: /compone