Currently, if you want to add a new layer to an existing layergroup, the only way of doing that seems to be to delete the layergroup and build it again from scratch. The update_layergroup method currently only allows to update the metadata of the layergroup.
However, I think the PUT /layergroups/{layergroupName} and PUT /workspaces/{workspace}/layergroups/{layergroup} API functions do, in principle, support adding new layers to a group.
From my point of view, there are 2 options how this functionality could be integrated:
Option 1 would be to upgrade the update_layergroup method so that it also supports updating the "publishables" portion of the dict. The advantage would be staying close to the API; on the downside, you'd probably have to expect the users to build the publishables dictionary by themselves from scratch.
Option 2 would be to create a separate method like add_layer_to_layergroup(layer_name:str, layer_workspace:str, layergroup_name:str, layergroup_workspace: str/None) which I believe might be more user friendly.
Currently, if you want to add a new layer to an existing layergroup, the only way of doing that seems to be to delete the layergroup and build it again from scratch. The
update_layergroup
method currently only allows to update the metadata of the layergroup.However, I think the
PUT /layergroups/{layergroupName}
andPUT /workspaces/{workspace}/layergroups/{layergroup}
API functions do, in principle, support adding new layers to a group.From my point of view, there are 2 options how this functionality could be integrated:
add_layer_to_layergroup(layer_name:str, layer_workspace:str, layergroup_name:str, layergroup_workspace: str/None)
which I believe might be more user friendly.What do you think?