Also, to delete a region, you can send a DELETE request to http://locator-host:port/gemfire/v1/regions/regionName
On Fri, Apr 8, 2016 at 11:25 AM, Swapnil Bawaskar <[email protected]> wrote: > If all you want is the ability to create regions via REST API, I would > just enable management over rest while starting the locator, like so: > > gfsh>start locator --name=locator1 --J=-Dgemfire.jmx-manager=true \ > --J=-Dgemfire.jmx-manager-start=true -J=-Dgemfire.http-service-port=8080 \ > --J=-Dgemfire.http-service-bind-address=localhost > > and then make a POST request to http://localhost:8080/gemfire/v1/regions > e.g. > $ curl -v --data "name=myRegion&type=PARTITION" > http://localhost:8080/gemfire/v1/regions > > You can find more parameters here: > > https://github.com/apache/incubator-geode/blob/develop/geode-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/RegionCommandsController.java#L133 > > On Fri, Apr 8, 2016 at 8:43 AM, Olivier Mallassi < > [email protected]> wrote: > >> Hi Mike, >> >> Thank you for the clarification, that was my guess. >> Regarding the destruction of the region, I was thinking about removing >> the key in metadataRegion and delete the region in the callback (to be >> tested). >> >> Cheers. >> >> On Fri, Apr 8, 2016 at 4:55 PM, Michael Stolz <[email protected]> wrote: >> >>> The reason you need the RegionAttributesMetadataRegion is so that if a >>> server goes away and comes back, or a new server joins, it knows to >>> recreate the regions that were dynamically created as defined in the >>> RegionAttributesMetadataRegion. >>> >>> If you are going to destroy regions you will also need to remove their >>> definitions from the RegionAttributesMetadataRegion. >>> >>> I believe <dynamic-region-factory> won't work for Partitioned Regions. >>> >>> >>> >>> -- >>> Mike Stolz >>> Principal Engineer, GemFire Product Manager >>> Mobile: 631-835-4771 >>> >>> On Fri, Apr 8, 2016 at 6:28 AM, Olivier Mallassi < >>> [email protected]> wrote: >>> >>>> Hello everybody, >>>> >>>> my apologies if the question has already been asked on the ML (I cannot >>>> find the answer in the archive). >>>> >>>> I have a need to programmatically create / delete region. I am not >>>> talking about creating / deleting regions every second or minutes. the need >>>> is a pure administration need (being able to create regions via an REST >>>> API). >>>> >>>> I have found the sample code in the documentation ( >>>> http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html) >>>> and was wondering if you can help with the following questions >>>> - why are we using this "metadataregion"? is it to support elasticity >>>> (add / remove nodes)? other reasons? >>>> - Can we delete the regions using the same principle (with another >>>> callback)? >>>> - is it better to use the <dynamic-region-factory> knowing I need >>>> partition_redundant regions? it looks not to be a valid option. >>>> >>>> Many thanks for your help. >>>> >>>> oliv/ >>>> >>> >>> >> >
