That’s great, thanks Abhishek. Geoff
———————————————————— Gnu PGP key - http://is.gd/TTTTuI > On 8 Dec 2015, at 07:21, Abhishek Sharma <[email protected]> wrote: > > This was very useful and works. > Thanks a bunch, Geoff > > > > On Mon, Dec 7, 2015 at 8:36 AM, Geoff Macartney < > [email protected]> wrote: > >> hi Abhishek, >> >> For this scenario I think you should be able to use something like >> >> ManagementContext mgmt = this.getManagementContext(); >> Location loc = >> mgmt.getLocationRegistry().resolve("location-name-defined-in-brooklyn.properties”) >> >> (or see [2] in the test code, BlobStoreTest.java). >> >> Then you can use location.getConfig with appropriate keys to get the >> credentials and endpoint you need to create an object to manage the blob >> store. See example code as in [1] below. >> >> In general to get access to properties from the brooklyn.properties file >> you can managementContext.getConfig(). However, in general this isn’t the >> best way to access that information, e.g. particularly in the case of >> locations it’s better to let Brooklyn parse the file and build up its own >> idea of the locations - including understanding the location hierarchy, for >> example if the identity & credential is defined at top level, but you have >> some more specific prperties in your location like endpoint and container >> name. Once it has done all that work then you can use the location >> registry methods above to access and use the locations more conveniently. >> >> Hope this is of some use. >> >> Best regards >> Geoff Macartney >> >> [1] >> https://github.com/apache/incubator-brooklyn/blob/master/locations/jclouds/src/main/java/org/apache/brooklyn/core/mgmt/persist/jclouds/JcloudsBlobStoreBasedObjectStore.java#L99-L104 >> [2] >> https://github.com/apache/incubator-brooklyn/blob/master/locations/jclouds/src/test/java/org/apache/brooklyn/core/mgmt/persist/jclouds/BlobStoreTest.java#L76 >> >> >> ———————————————————— >> Gnu PGP key - http://is.gd/TTTTuI >> >> >>> On 7 Dec 2015, at 16:03, Abhishek Sharma <[email protected]> wrote: >>> >>> I am looking for scenario 2, Geoff. >>> >>> I have custom data of my own which I want to put in a Jcloud based object >>> store. After reading up on the API's I felt the same - that I should use >>> the Jclouds BlobStoreContext directly. although I want to store my >>> configuration in brooklyn.properties and read it from there. By >>> configuration I mean : configuration of my blob store and credentials. >>> >>> I was unable to understand how get hold of/access the Brooklyn.properties >>> 'properties' at runtime so I can instantiate my BlobStoreContext. >>> >>> Thanks, >>> Abhi >>> >>> On Mon, Dec 7, 2015 at 7:12 AM Geoff Macartney < >>> [email protected]> wrote: >>> >>>> hi Abhishek, >>>> >>>> Can you provide a bit more detail on what it is you are trying to do >>>> exactly? >>>> >>>> If you are wanting to use a JClouds blob store for Brooklyn’s >> persistence, >>>> I don’t think you need to do any management of a >>>> JcloudsBlobStoreBasedObjectStore yourself. It should be enough to >> follow >>>> the process at [1]. >>>> >>>> If, on the other hand, you have some custom data of your own that you >> want >>>> to put into a JCloud based object store, you might want to use the >> jclouds >>>> BlobStoreContext directly? It rather depends on what your use case is. >>>> >>>> Best regards >>>> Geoff Macartney >>>> >>>> [1] >>>> >> http://brooklyn.apache.org/v/latest/ops/persistence/#object-store-persistence >>>> >>>> >>>> ———————————————————— >>>> Gnu PGP key - http://is.gd/TTTTuI >>>> >>>> >>>>> On 5 Dec 2015, at 19:21, Abhishek Sharma <[email protected]> >> wrote: >>>>> >>>>> I am unable to understand how the jclouds brooklyn properties set in >> the >>>>> brooklyn.properties file are available at runtime in code ? I am trying >>>> to >>>>> create a java blueprint. >>>>> >>>>> I am trying to use *JcloudsBlobStoreBasedObjectStore*which required >>>>> *JcloudsLocation* in the constructor. How do I create JcloudsLocation >>>>> object from the brooklyn.properties ? >>>>> >>>>> Thanks in advance for help >>>>> Abhi >>>> >>>> >> >>
