0
votes

Under Geoserver, How do we create the WMTSLayer once the WMTSStore is establish via REST API ?

Trying to follow the swagger documentation under here, https://docs.geoserver.org/latest/en/api/#1.0.0/layers.yaml

But can't find the correct url to work for it. Get 404 when I try this using curl

curl -v -u admin:geoserver -X POST  http://localhost:8085/geoserver-cloud/rest/workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers -H  "accept: application/json" -H  "content-type: application/json" -d "{\"featureType\":{\"name\":\"World_Imagery\"}}"

Also looked under here, https://docs.geoserver.org/latest/en/api/#1.0.0/wmtslayers.yaml

And tried below url for it. Get 500 when I try this using curl

curl -v -u admin:geoserver -X POST  http://localhost:8085/geoserver-cloud/rest/workspaces/{workspace}/wmtsstores/{wmtsstore}/layers -H  "accept: application/json" -H  "content-type: application/json" -d "{\"featureType\":{\"name\":\"World_Imagery\"}}"
1

1 Answers

0
votes

Found it, need to pass wmtsLayer

curl -v -u admin:geoserver -X POST  http://localhost:8085/geoserver-cloud/rest/workspaces/{workspace}/wmtsstores/{wmtsstore}/layers -H  "accept: application/json" -H  "content-type: application/json" -d "{  \"wmtsLayer\": {    \"name\": \"NatGeo_World_Map\"  } }"