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 configuration server, it’s a configuration file manager at heart). If the relevant parameters changed in Ambari, a restart of the REST service (and consequently re-write of it’s application.yml) would be forced. The REST API itself would then just use a simple spring config expression to pick up the value.
Simon > On 8 May 2017, at 13:52, Otto Fowler <ottobackwa...@gmail.com> wrote: > > 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 hdfs, and hard coded to directory, but we allow the > configuration. > > Other rest services write to hdfs as well. > > > On May 8, 2017 at 08:45:32, Nick Allen (n...@nickallen.org) wrote: > > As opposed to using the Ambari REST API to get this information? > > On Mon, May 8, 2017 at 8:06 AM, Otto Fowler <ottobackwa...@gmail.com> 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 components. >> >> The api would be >> >> PUT: login to ambari -> ambari credentials for use with ambari, session >> variable >> GET: /component | service if login provided, returns the configuration >> GET:/component | service | property name if login provided get the >> property value for property name >> >> So, the caller would put the credentials, and after that point the caller >> or other services can use ambari service configurations, >> for example to get the configured metron hdfs root directory. >> >> This is opposed to configuring credentials in the rest configuration. >> >> Thoughts? >>