Your memory did serve you well and you are correct new keywords are added and existing ones are deleted when omitted.
Thanks for your help.
···
Van: Nuno Oliveira [mailto:nuno.oliveira@…1107…]
Verzonden: maandag 3 juni 2019 16:00
Aan: Bar-On, Itay; geoserver-users@lists.sourceforge.net
Onderwerp: Re: [Geoserver-users] Update layer keywords programmatically
Hi,
If my memory serves me well, you need to put there the keyword you want to have, so new ones will be added and missing existing ones will be deleted.
You should give it a try, this is an easy check.
Regards,
On Mon, 2019-06-03 at 13:44 +0000, Bar-On, Itay wrote:
Hi,
Thanks for sharing this, I will try it out but first let me see if I understand it correctly:
To add new keywords I just add a new tag with the corresponding value e.i. newKeyword, in the upload body, do I need to mention the existing keywords? And if I omit them will they be deleted (what I actually also need)?
Regards,
Itay
Van: Nuno Oliveira [mailto:nuno.oliveira@…1107…]
Verzonden: maandag 3 juni 2019 15:14
Aan: Bar-On, Itay; geoserver-users@lists.sourceforge.net
Onderwerp: Re: [Geoserver-users] Update layer keywords programmatically
Hi,
Yes you can from the featureTypes end point (https://docs.geoserver.org/latest/en/api/#/latest/en/api/1.0.0/featuretypes.yaml):
geoserver/rest/workspaces/{workspace}/datastores/{dataStore}/featuretypes/{featureType}.xml
The POST content should look like this (for updating keywords only):
features
facility
newKeyword
Best regards,
Nuno Oliveira
On Mon, 2019-06-03 at 10:59 +0000, Bar-On, Itay wrote:
Hi there,
I am currently searchning for a way to update ca. 280 layers with new keywords. The reason I would like to do this is to be able to harvest the getcapabilities documents of the services and set up a services catalog.
After googling it for a while and searching the users group the only post that comes anywhere near is from 2011:
http://osgeo-org.1560.x6.nabble.com/automating-layer-metadata-update-td3790274.html
Naturally the obvious choice would be to use the REST API to update the layer using the /layers/{layerName} endpoint with a POST, but I am not sure if this is possible for keywords.
Does anybody have any experiance with this endpoint ? and can share some wisdom on how to update layers keywords via the REST API (if at all possible…)
If the REST API endpoint is not a possibility is there maybe another way I can do it programmatically?
Thanks in advance
Met vriendelijke groet,
Itay Bar-On
Geo Informatie Specialist
![Gemeente Vlaardingen]()
Informatie en Facilitaire Voorzieningen
Westnieuwland 6, 3131VX Vlaardingen, Nederland
T 06 10173309
E Itay.BarOn@…9729…
W www.vlaardingen.nl
De gemeente Vlaardingen stuurt privacygevoelige e-mail berichten via een beveiligde verbinding van KPN Zorg Messenger. Meer informatie vindt u op www.vlaardingen.nl/veiligmailen.
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: [http://www.ianturton.com/talks/foss4g.html#/](http://www.ianturton.com/talks/foss4g.html#/)
- The GeoServer user list posting guidelines: [http://geoserver.org/comm/userlist-guidelines.html](http://geoserver.org/comm/userlist-guidelines.html)
If you want to request a feature or an improvement, also see this: [https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer](https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer)
[Geoserver-users@lists.sourceforge.net](mailto:Geoserver-users@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-users](https://lists.sourceforge.net/lists/listinfo/geoserver-users)
--
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the
experts!
Visit http://goo.gl/it488V for more information.
==
Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
Con riferimento alla normativa sul trattamento dei dati
personali (Reg. UE 2016/679 - Regolamento generale sulla
protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto,
gli eventuali allegati, etc.) è un dato la cui conoscenza
è riservata al/i solo/i destinatario/i indicati dallo
scrivente. Se il messaggio Le è giunto per errore, è
tenuta/o a cancellarlo, ogni altra operazione è illecita.
Le sarei comunque grato se potesse darmene notizia.
This email is intended only for the person or entity to
which it is addressed and may contain information that
is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European
Regulation 2016/679 “GDPR” - copying, dissemination or
use of this e-mail or the information herein by anyone
other than the intended recipient is prohibited. If you
have received this email by mistake, please notify
us immediately by telephone or e-mail.
--
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the
experts!
Visit http://goo.gl/it488V for more information.
==
Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
Con riferimento alla normativa sul trattamento dei dati
personali (Reg. UE 2016/679 - Regolamento generale sulla
protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto,
gli eventuali allegati, etc.) è un dato la cui conoscenza
è riservata al/i solo/i destinatario/i indicati dallo
scrivente. Se il messaggio Le è giunto per errore, è
tenuta/o a cancellarlo, ogni altra operazione è illecita.
Le sarei comunque grato se potesse darmene notizia.
This email is intended only for the person or entity to
which it is addressed and may contain information that
is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European
Regulation 2016/679 “GDPR” - copying, dissemination or
use of this e-mail or the information herein by anyone
other than the intended recipient is prohibited. If you
have received this email by mistake, please notify
us immediately by telephone or e-mail.