layers.yaml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. ---
  2. swagger: '2.0'
  3. info:
  4. version: 1.0.0
  5. title: GeoServer Layers
  6. description: A layer is a published resource (feature type or coverage).
  7. contact:
  8. name: GeoServer
  9. email: 'geoserver-users@osgeo.org'
  10. url: 'https://geoserver.org/comm/'
  11. host: localhost:8080
  12. basePath: /geoserver/rest
  13. paths:
  14. /layers:
  15. get:
  16. operationId: layersGet
  17. tags:
  18. - "Layers"
  19. summary: Get a list of layers
  20. description: Displays a list of all layers on the server. You must use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers.xml" for XML)
  21. produces:
  22. - text/html
  23. - application/xml
  24. - application/json
  25. responses:
  26. 200:
  27. description: OK
  28. schema:
  29. $ref: "#/definitions/Layers"
  30. examples:
  31. application/xml: |
  32. <layers>
  33. <layer>
  34. <name>tiger:giant_polygon</name>
  35. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate"
  36. href="http://localhost:8080/geoserver/rest/layers/tiger%3Agiant_polygon.xml"
  37. type="application/xml"/>
  38. </layer>
  39. <layer>
  40. <name>sf:bugsites</name>
  41. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate"
  42. href="http://localhost:8080/geoserver/rest/layers/sf%3Abugsites.xml"
  43. type="application/xml"/>
  44. </layer>
  45. </layers>
  46. application/json: |
  47. {
  48. "layers": {
  49. "layer": [
  50. {
  51. "name": "tiger:giant_polygon",
  52. "href": "http:\/\/localhost:8080\/geoserver\/rest\/layers\/tiger%3Agiant_polygon.json"
  53. },
  54. {
  55. "name": "sf:bugsites",
  56. "href": "http:\/\/localhost:8080\/geoserver\/rest\/layers\/sf%3Abugsites.json"
  57. },
  58. ]
  59. }
  60. }
  61. post:
  62. operationId: layersPost
  63. tags:
  64. - "Layers"
  65. description: Invalid. To create a new layer, instead POST to one of `/workspaces/{workspaceName}/coveragestores/{coveragestoreName}/coverages`, `/workspaces/{workspaceName}/datastores/{datastoreName}/featuretypes`, `/workspaces/{workspaceName}/wmsstores/{wmsstoreName}/wmslayers`, or `/workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers`
  66. responses:
  67. 405:
  68. description: Method not allowed.
  69. put:
  70. operationId: layersPut
  71. tags:
  72. - "Layers"
  73. description: Invalid. To edit a layer, use PUT on an individual layer instead.
  74. responses:
  75. 405:
  76. description: Method not allowed.
  77. delete:
  78. operationId: layersDelete
  79. tags:
  80. - "Layers"
  81. description: Invalid.
  82. responses:
  83. 405:
  84. description: Method not allowed.
  85. /layers/{layerName}:
  86. get:
  87. operationId: layersNameGet
  88. tags:
  89. - "Layers"
  90. summary: Retrieve a layer
  91. description: Retrieves a single layer definition. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers/{layer}.xml" for XML).
  92. produces:
  93. - application/xml
  94. - application/json
  95. - text/html
  96. parameters:
  97. - name: layerName
  98. in: path
  99. required: true
  100. description: The name of the layer to retrieve.
  101. type: string
  102. responses:
  103. 200:
  104. description: OK
  105. schema:
  106. $ref: "#/definitions/Layer"
  107. examples:
  108. application/xml: |
  109. <layer>
  110. <name>poi</name>
  111. <path>/</path>
  112. <type>VECTOR</type>
  113. <defaultStyle>
  114. <name>poi</name>
  115. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/styles/poi.xml" type="application/xml"/>
  116. </defaultStyle>
  117. <styles class="linked-hash-set">
  118. <style>
  119. <name>burg</name>
  120. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/styles/burg.xml" type="application/xml"/>
  121. </style>
  122. <style>
  123. <name>point</name>
  124. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/styles/point.xml" type="application/xml"/>
  125. </style>
  126. </styles>
  127. <resource class="featureType">
  128. <name>poi</name>
  129. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes/poi.xml" type="application/xml"/>
  130. </resource>
  131. <attribution>
  132. <logoWidth>0</logoWidth>
  133. <logoHeight>0</logoHeight>
  134. </attribution>
  135. </layer>
  136. application/json: |
  137. {
  138. "layer": {
  139. "name": "poi",
  140. "path": "/",
  141. "type": "VECTOR",
  142. "defaultStyle": {
  143. "name": "poi",
  144. "href": "http://localhost:8080/geoserver/rest/styles/poi.json"
  145. },
  146. "styles": {
  147. "@class": "linked-hash-set",
  148. "style": [
  149. {
  150. "name": "burg",
  151. "href": "http://localhost:8080/geoserver/rest/styles/burg.json"
  152. },
  153. {
  154. "name": "point",
  155. "href": "http://localhost:8080/geoserver/rest/styles/point.json"
  156. }
  157. ]
  158. },
  159. "resource": {
  160. "@class": "featureType",
  161. "name": "poi",
  162. "href": "http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes/poi.json"
  163. },
  164. "attribution": {
  165. "logoWidth": 0,
  166. "logoHeight": 0
  167. }
  168. }
  169. }
  170. post:
  171. operationId: layersNamePost
  172. tags:
  173. - "Layers"
  174. description: Invalid. To create a new layer, instead POST to one of `/workspaces/{workspaceName}/coveragestores/{coveragestoreName}/coverages`, `/workspaces/{workspaceName}/datastores/{datastoreName}/featuretypes`, `/workspaces/{workspaceName}/wmsstores/{wmsstoreName}/wmslayers`, or `/workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers`
  175. responses:
  176. 405:
  177. description: Method not allowed.
  178. put:
  179. operationId: layersNamePut
  180. tags:
  181. - "Layers"
  182. summary: Modify a layer.
  183. description: Modifies an existing layer on the server. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers/{layer}.xml" for XML).
  184. parameters:
  185. - name: layerName
  186. in: path
  187. required: true
  188. description: The name of the layer to modify.
  189. type: string
  190. - name: layerBody
  191. in: body
  192. description: The updated layer definition.
  193. required: true
  194. schema:
  195. $ref: "#/definitions/Layer"
  196. consumes:
  197. - application/xml
  198. - application/json
  199. responses:
  200. 200:
  201. description: The layer was successfully updated.
  202. delete:
  203. operationId: layersNameDelete
  204. tags:
  205. - "Layers"
  206. summary: Delete layer
  207. description: Deletes a layer from the server.
  208. parameters:
  209. - name: layerName
  210. in: path
  211. required: true
  212. description: The name of the layer to delete.
  213. type: string
  214. - name: recurse
  215. in: query
  216. description: Recursively removes the layer from all layer groups which reference it. If this results in an empty layer group, also delete the layer group. Allowed values for this parameter are true or false. The default value is false. A request with 'recurse=false' will fail if any layer groups reference the layer.
  217. required: false
  218. type: boolean
  219. default: false
  220. responses:
  221. 200:
  222. description: OK
  223. /workspaces/{workspaceName}/layers:
  224. get:
  225. operationId: layersWorkspaceGet
  226. tags:
  227. - "Layers"
  228. summary: Get a list of layers in a workspace.
  229. description: Displays a list of all layers in the provided workspace. You must use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers.xml" for XML)
  230. parameters:
  231. - name: workspaceName
  232. in: path
  233. required: true
  234. description: The name of the workspace to list layers in
  235. type: string
  236. produces:
  237. - text/html
  238. - application/xml
  239. - application/json
  240. responses:
  241. 200:
  242. description: OK
  243. schema:
  244. $ref: "#/definitions/Layers"
  245. examples:
  246. application/xml: |
  247. <layers>
  248. <layer>
  249. <name>bugsites</name>
  250. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate"
  251. href="http://localhost:8080/geoserver/rest/workspaces/sf/layers/bugsites.xml"
  252. type="application/xml"/>
  253. </layer>
  254. </layers>
  255. application/json: |
  256. {
  257. "layers": {
  258. "layer": [
  259. {
  260. "name": "bugsites",
  261. "href": "http:\/\/localhost:8080\/geoserver\/rest\/workspaces\/sf\/layers\/bugsites.json"
  262. },
  263. ]
  264. }
  265. }
  266. post:
  267. operationId: layersWorkspacePost
  268. tags:
  269. - "Layers"
  270. description: Invalid. To create a new layer, instead POST to one of `/workspaces/{workspaceName}/coveragestores/{coveragestoreName}/coverages`, `/workspaces/{workspaceName}/datastores/{datastoreName}/featuretypes`, `/workspaces/{workspaceName}/wmsstores/{wmsstoreName}/wmslayers`, or `/workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers`
  271. responses:
  272. 405:
  273. description: Method not allowed.
  274. put:
  275. operationId: layersWorkspacePut
  276. tags:
  277. - "Layers"
  278. description: Invalid. To edit a layer, use PUT on an individual layer instead.
  279. responses:
  280. 405:
  281. description: Method not allowed.
  282. delete:
  283. operationId: layersWorkspaceDelete
  284. tags:
  285. - "Layers"
  286. description: Invalid.
  287. responses:
  288. 405:
  289. description: Method not allowed.
  290. /workspaces/{workspaceName}/layers/{layerName}:
  291. get:
  292. operationId: layersNameWorkspaceGet
  293. tags:
  294. - "Layers"
  295. summary: Retrieve a layer
  296. description: Retrieves a single layer definition. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers/{layer}.xml" for XML).
  297. produces:
  298. - application/xml
  299. - application/json
  300. - text/html
  301. parameters:
  302. - name: workspaceName
  303. in: path
  304. required: true
  305. description: The name of the workspace the layer is in.
  306. type: string
  307. - name: layerName
  308. in: path
  309. required: true
  310. description: The name of the layer to retrieve.
  311. type: string
  312. responses:
  313. 200:
  314. description: OK
  315. schema:
  316. $ref: "#/definitions/Layer"
  317. examples:
  318. application/xml: |
  319. <layer>
  320. <name>poi</name>
  321. <path>/</path>
  322. <type>VECTOR</type>
  323. <defaultStyle>
  324. <name>poi</name>
  325. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/styles/poi.xml" type="application/xml"/>
  326. </defaultStyle>
  327. <styles class="linked-hash-set">
  328. <style>
  329. <name>burg</name>
  330. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/styles/burg.xml" type="application/xml"/>
  331. </style>
  332. <style>
  333. <name>point</name>
  334. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/styles/point.xml" type="application/xml"/>
  335. </style>
  336. </styles>
  337. <resource class="featureType">
  338. <name>poi</name>
  339. <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes/poi.xml" type="application/xml"/>
  340. </resource>
  341. <attribution>
  342. <logoWidth>0</logoWidth>
  343. <logoHeight>0</logoHeight>
  344. </attribution>
  345. </layer>
  346. application/json: |
  347. {
  348. "layer": {
  349. "name": "poi",
  350. "path": "/",
  351. "type": "VECTOR",
  352. "defaultStyle": {
  353. "name": "poi",
  354. "href": "http://localhost:8080/geoserver/rest/styles/poi.json"
  355. },
  356. "styles": {
  357. "@class": "linked-hash-set",
  358. "style": [
  359. {
  360. "name": "burg",
  361. "href": "http://localhost:8080/geoserver/rest/styles/burg.json"
  362. },
  363. {
  364. "name": "point",
  365. "href": "http://localhost:8080/geoserver/rest/styles/point.json"
  366. }
  367. ]
  368. },
  369. "resource": {
  370. "@class": "featureType",
  371. "name": "poi",
  372. "href": "http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes/poi.json"
  373. },
  374. "attribution": {
  375. "logoWidth": 0,
  376. "logoHeight": 0
  377. }
  378. }
  379. }
  380. post:
  381. operationId: layersNameWorkspacePost
  382. tags:
  383. - "Layers"
  384. description: Invalid. To create a new layer, instead POST to one of `/workspaces/{workspaceName}/coveragestores/{coveragestoreName}/coverages`, `/workspaces/{workspaceName}/datastores/{datastoreName}/featuretypes`, `/workspaces/{workspaceName}/wmsstores/{wmsstoreName}/wmslayers`, or `/workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers`
  385. responses:
  386. 405:
  387. description: Method not allowed.
  388. put:
  389. operationId: layersNameWorkspacePut
  390. tags:
  391. - "Layers"
  392. summary: Modify a layer.
  393. description: Modifies an existing layer on the server. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers/{layer}.xml" for XML).
  394. parameters:
  395. - name: workspaceName
  396. in: path
  397. required: true
  398. description: The name of the workspace the layer is in.
  399. - name: layerName
  400. in: path
  401. required: true
  402. description: The name of the layer to modify.
  403. type: string
  404. - name: layerBody
  405. in: body
  406. description: The updated layer definition.
  407. required: true
  408. schema:
  409. $ref: "#/definitions/Layer"
  410. consumes:
  411. - application/xml
  412. - application/json
  413. responses:
  414. 200:
  415. description: The layer was successfully updated.
  416. delete:
  417. operationId: layersNameWorkspaceDelete
  418. tags:
  419. - "Layers"
  420. summary: Delete layer
  421. description: Deletes a layer from the server.
  422. parameters:
  423. - name: workspaceName
  424. in: path
  425. required: true
  426. description: The name of the workspace the layer is in.
  427. - name: layerName
  428. in: path
  429. required: true
  430. description: The name of the layer to delete.
  431. type: string
  432. - name: recurse
  433. in: query
  434. description: Recursively removes the layer from all layer groups which reference it. If this results in an empty layer group, also delete the layer group. Allowed values for this parameter are true or false. The default value is false. A request with 'recurse=false' will fail if any layer groups reference the layer.
  435. required: false
  436. type: boolean
  437. default: false
  438. responses:
  439. 200:
  440. description: OK
  441. definitions:
  442. Layers:
  443. title: layers
  444. type: object
  445. properties:
  446. layers:
  447. $ref: "#/definitions/LayerReference"
  448. LayerReference:
  449. title: layers
  450. type: object
  451. properties:
  452. name:
  453. type: string
  454. description: Name of layer
  455. link:
  456. type: string
  457. description: URL to layer definition
  458. Layer:
  459. title: layer
  460. xml:
  461. name: layer
  462. type: object
  463. properties:
  464. name:
  465. type: string
  466. description: Name of the layer
  467. path:
  468. type: string
  469. description: Location of the layer in the WMS capabilities layer tree
  470. type:
  471. type: string
  472. enum:
  473. - VECTOR
  474. - RASTER
  475. - REMOTE
  476. - WMS
  477. - GROUP
  478. description: Type of published layer. Can be VECTOR, RASTER, REMOTE, WMS or GROUP. Must be consistent with resource definition.
  479. defaultStyle:
  480. $ref: "#/definitions/StyleReference"
  481. styles:
  482. type: object
  483. description: Avaialble styles for layer publication
  484. properties:
  485. '@class':
  486. type: string
  487. enum:
  488. - linked-hash-set
  489. description: required value linked-hash-set.
  490. style:
  491. type: array
  492. items:
  493. $ref: "#/definitions/StyleReference"
  494. resource:
  495. type: object
  496. description: Resource supplying information for layer publication
  497. properties:
  498. '@class':
  499. type: string
  500. enum:
  501. - featureType
  502. default: featureType
  503. description: required value featureType
  504. name:
  505. type: string
  506. description: Name of resource
  507. link:
  508. type: string
  509. readOnly: true
  510. description: URL to the resource definition
  511. opaque:
  512. type: boolean
  513. description: Controls layer transparency (whether the layer is opaque or transparent).
  514. metadata:
  515. type: array
  516. items:
  517. $ref: "#/definitions/MetadataEntry"
  518. attribution:
  519. type: object
  520. description: WMS attribution information to be drawn on each map
  521. properties:
  522. title:
  523. type: string
  524. description: Human-readable text describing the data provider
  525. href:
  526. type: string
  527. description: URL to data provider
  528. logoURL:
  529. type: string
  530. description: Data provider logo
  531. logoWidth:
  532. type: integer
  533. description: Data provider logo width
  534. logoHeight:
  535. type: integer
  536. description: Data provider logo height
  537. logoType:
  538. type: string
  539. description: Format of data provider logo, example "image/png"
  540. authorityURLs:
  541. type: array
  542. items:
  543. type: object
  544. title: AuthorityURL
  545. properties:
  546. name:
  547. type: string
  548. description: Authory name, describing the industry, national or international origanization responsible for data product standard.
  549. href:
  550. type: string
  551. description: URL to authority organization
  552. identifiers:
  553. type: array
  554. items:
  555. type: object
  556. title: Identifier
  557. properties:
  558. authority:
  559. type: string
  560. description: Authority cited, for details see authorityURLs
  561. identifier:
  562. type: string
  563. description: Work citied, often a data standard provided by
  564. StyleReference:
  565. type: object
  566. title: style
  567. description: Reference to style definition
  568. properties:
  569. name:
  570. type: string
  571. description: Name of style
  572. link:
  573. type: string
  574. readOnly: true
  575. description: URL to the style definition
  576. MetadataEntry:
  577. type: object
  578. title: entry
  579. properties:
  580. '@key':
  581. title: key
  582. type: string
  583. enum:
  584. - buffer
  585. description: Key used for metadata entry, additional keys are added over time
  586. '$':
  587. title: text
  588. type: string
  589. description: Text value for provided key Valid text depends on key used. Example {'@key'='buffer','$'='5'}") or <entry key="buffer">5</entry>