Thanks for the hint!
The curl that actually did the job:
curl -v -u user:pwd -XPOST -H 'Content-type: text/xml' -d
"<layerGroup><name>2008</name><mode>CONTAINER</mode><title>2008</title><workspace><name>icecap</name></workspace><publishables><published
type='layerGroup'><name>icecap:200801</name></published></publishables><bounds><minx>-4000000</minx><maxx>4000000</maxx><miny>-4000000</miny><maxy>4000000</maxy><crs
class='projected'>EPSG:3411</crs></bounds></layerGroup>"
http://localhost:8080/geoserver/rest/layergroups
Strange enough (for me) that this is completely different from the "normal"
not-nested-layergroup creation.
Thanks again,
Csaba
On 23 April 2013 09:07, Andrea Aime <[email protected]> wrote:
> On Mon, Apr 22, 2013 at 4:44 PM, Sandor Csaba <[email protected]>wrote:
>
>> Hi List,
>>
>> Being new to using the REST API I would like to ask you how to create a
>> nested layergroup through the REST API?
>>
>> My curl is:
>> curl -v -u user:pwd -XPOST -H 'Content-type: text/xml' -d
>> "<layerGroup><name>2013</name><title>2013</title><mode>CONTAINER</mode><layers><layer>201304</layer></layers></layerGroup>"
>> http://localhost:8080/geoserver/rest/workspaces/myworkspace/layergroups
>>
>> Where "2013" is the new layerGroup and "201304" is an existing layerGroup.
>>
>> I could successfully create a layerGroup consisting of plain layers.
>>
>
> The general advice when you are looking at some REST construct that lacks
> documentation is
> simple, and always the same:
> - configure what you need in the GUI
> - use GET requests to gather the resources you modified and look at their
> structure
> - repeat it with your REST api calls
>
> Cheers
> Andrea
>
>
> --
> ==
> GeoServer training in Milan, 6th & 7th June 2013! Visit
> http://geoserver.geo-solutions.it for more information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054 Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39 339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> -------------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
Sándor Csaba
szolgáltatási vezető
ViaMap Kft.
Székhely/postacím: 2176 Erdőkürt, Téglaház utca 4.
Iroda:
1076 Budapest, Garay u. 29-31. I. 1.
(EMLA Környezeti Management és Jog Egyesület)
Tel: +3630/9605853
Fax: +3617002542
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users