From 54963568b70e1dd9e72d5c02805dbdccf3482edd Mon Sep 17 00:00:00 2001 From: root <root@vm181> Date: Mon, 7 Oct 2013 13:37:35 +0200 Subject: [PATCH] Removed the deprecated documentation... --- README.rst => README.md | 14 +- docs/install.md | 135 ++++++++ docs/install.rst | 145 -------- docs/mra_reference.md | 3 + docs/mra_reference.rst | 722 ---------------------------------------- 5 files changed, 144 insertions(+), 875 deletions(-) rename README.rst => README.md (74%) create mode 100644 docs/install.md delete mode 100644 docs/install.rst create mode 100644 docs/mra_reference.md delete mode 100644 docs/mra_reference.rst diff --git a/README.rst b/README.md similarity index 74% rename from README.rst rename to README.md index 3107d11..7b24c6c 100644 --- a/README.rst +++ b/README.md @@ -1,19 +1,17 @@ -================== -MapServer Rest API -================== +# MapServer Rest API **MapServer REST API** is a python wrapper around MapServer which allows to manipulate a mapfile in a RESTFul way. It has been developped to match as close as possible the way the GeoServer REST API acts. -Installation -```````````` +## Installation + See the Mapserver Rest API Documentation for installation instructions. -Copying and license -``````````````````` +## Copying and license + **MapServer REST API** is copyright (c) 2011-2013 Neogeo Technologies. It is free software licensed under the GNU General Public License version 3. You should have received a copy of the GNU General Public License along with -this program. If not, see http://www.gnu.org/licenses/. \ No newline at end of file +this program. If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/). \ No newline at end of file diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 0000000..e001c37 --- /dev/null +++ b/docs/install.md @@ -0,0 +1,135 @@ +# How to install MapServer Rest API + +This document describes how to install and configure **MapServer Rest API**. + +## Prerequisites + +**MapServer Rest API** needs the following components: + +* Python with following packages: + + * **web.py** + + * **pyyaml** + + * **nosetests** (Not mandatory but required to run tests) + +* **GDAL/OGR** (>= 1.9.x with **Python** support) + +* **MapServer** (>= 6.x with **MapScript-Python** support) + + +## Download + +Get the newest source code by downloading the archive at [download](https://github.com/neogeo-technologies/mra) page. +Then extract the archive in a directory of your choice. +Or checkout the Git in some place. + +## Installation + +There is nothing to do more. + +Configure your server, e.g. with **Apache**, just create a virtual directory and the following aliases: + + WSGIPythonPath /path/to/mra/src/mra + WSGIScriptAlias /mra /path/to/mra/src/mra/server.py + Alias /static /path/to/mra/static + <Directory /home/mra/static> + Order deny,allow + Allow from all + </Directory> + AddType text/html .py .js + <Directory /home/mra/src/mra> + SetHandler wsgi-script + Options ExecCGI FollowSymlinks + Order deny,allow + Allow from all + </Directory> + +You must reload Apache to make the change take effect. +Check the alias is working: [http://localhost/mra](http://localhost/mra) + + +## Settings + +All settings are done in the `mra/src/mra/mra.yaml` file, which should be rather easy to adapt to your configuration. +If you have checked out the svn repository, just rename the `mra.yaml.sample` in `mra.yaml`. +That way, your own configuration won't be discarded by a further update. + +* **storage** + + * **root** + + All default storage paths are relative to mra's root which is described here + + `root: "/my/full/path/to/mra/root"` + + However, you can specify specific directories for any of those sub-directories. They will default to `root/sub_directory_name` + + * **services** + * **available** + * **resources** + * **styles** + * **data** + +* **mapserver** + + * **url** + + URL that should be used to access your mapserver. + + `url: "http://127.0.0.1/cgi-bin/mapserv?"` + + * **wms\_version**, **wfs\_version**, **wcs\_version** + + Default version to use for WMS, WFS and WCS. + +* **debug** + + * **web\_debug** [`True`|`False`] + + `web_debug` allows for easy debuging in the the browser, should be deactivated in production. + + * **raise\_all** [`True`|`False`] + + Exceptions are transformed into web errors. This can be prevented by setting `raise_all` to `True`. + +* **logging** + + * **format** + + Format of the debug log. Here is a typical message: + + `format: "%(asctime)s %(levelname)7s: (%(funcName)s:%(lineno)s) %(message)s"` + + * **file** + + Path to the log file, which can be located anywhere on your disk. + + `file: "./mra.log"` + + * **level** [`DEBUG`|`INFO`|`WARNING`|`ERROR`] + + Level of debugging output. + + * **web\_logs** [`True`|`False`] + + To add the logs to the generated output of the webapp. + +* **plugins** + + * **loadpaths** + + The paths in this lists will be loaded as plugins. + A plugin can be a python package, if that is the case it should define the `__all__` attribute to indicate which modules should be handled as plugins. (An example can be found in `/plugins) + + loadpaths: [ + "/my/full/path/to/plugins" + ] + +Finally check MapServer Rest API is working correctly: [http://localhost/mra](http://localhost/mra) + +## Enjoy! + +You are ready to use **MapServer Rest API**. +Please now refer to the **MapServer Rest API** Reference documentation. \ No newline at end of file diff --git a/docs/install.rst b/docs/install.rst deleted file mode 100644 index 6afc42d..0000000 --- a/docs/install.rst +++ /dev/null @@ -1,145 +0,0 @@ -================================= -How to install MapServer Rest API -================================= - -This document describes how to install and configure **MapServer Rest API**. - -Prerequisites -============= - -**MapServer Rest API** needs the following components: - -* Python with following packages: - - * web.py - - * pyyaml - - * nosetests (Not mandatory but required to run tests) - -* GDAL/OGR (>= 1.9.x with Python support) - -* MapServer (>= 6.x with MapScript-Python support) - - -Download -======== -Get the newest source code by downloading the archive at `download`_ page. -Then extract the archive in a directory of your choice. Or checkout the Git in some place. - -.. _download: https://github.com/neogeo-technologies/mra - -Installation -============ -There is nothing to do more. - -Configure your server, e.g. with Apache, just create a virtual directory and the following aliases: :: - - WSGIPythonPath /path/to/mra/src/mra - WSGIScriptAlias /mra /path/to/mra/src/mra/server.py - Alias /static /path/to/mra/static - <Directory /home/mra/static> - Order deny,allow - Allow from all - </Directory> - AddType text/html .py .js - <Directory /home/mra/src/mra> - SetHandler wsgi-script - Options ExecCGI FollowSymlinks - Order deny,allow - Allow from all - </Directory> - - -You must reload Apache to make the change take effect. -Check the alias is working: - - http://localhost/mra - - -Settings -======== -All settings are done in the ``mra/src/mra/mra.yaml`` file, which should be rather easy to adapt to your configuration. -If you have checked out the svn repository, just rename the ``mra.yaml.sample`` in ``mra.yaml``. -That way, your own configuration won't be discarded by a further update. - -* **storage** - - * **mapfiles** - - Path to the directory containing your mapfiles, which can be located anywhere on your disk. - The MapServerRestAPI will scan this directory recursively to find all the mapfiles. - - ``mapfiles: "/path/to/your/mapfiles/directory"`` - - * **resources** - - Path to the directory containing your data, which can be located anywhere on your disk. - - ``resources: "/path/to/your/data/directory"`` - -* **mapserver** - - * **url** - - URL that should be used to access your mapserver. - - ``url: "http://127.0.0.1/cgi-bin/mapserv?"`` - - * **wms_version**, **wfs_version**, **wcs_version** - - Default version to use for WMS, WFS and WCS. - -* **debug** - - * **web_debug** [True | False] - - web_debug allows for easy debuging in the the browser, should be deactivated in production. - - * **raise_all** [True | False] - - Exceptions are transformed into web errors. - This can be prevented by setting raise_all to True. - -* **logging** - - * **format** - - Format of the debug log. Here is a typical message: - - ``format: "%(asctime)s %(levelname)7s: (%(funcName)s:%(lineno)s) %(message)s"`` - - * **file** - - Path to the log file, which can be located anywhere on your disk. - - ``file: "./mra.log"`` - - * **level** [DEBUG | INFO | WARNING | ERROR] - - Level of debugging output. - - * **web_logs** [False | True] - - To add the logs to the generated output of the webapp. - -* **testing** - - * **active** [True | False] - - Additions to the API for testing, should be deactivated in production. - - * **model** - - Mapfile to use to create new test files. - -Finally check MapServer Rest API is working correctly: - - http://localhost/mra/maps - -Enjoy! -====== - -You are ready to use **MapServer Rest API**. - -Please now refer to the **MapServer Rest API** Reference documentation. \ No newline at end of file diff --git a/docs/mra_reference.md b/docs/mra_reference.md new file mode 100644 index 0000000..6adbfc2 --- /dev/null +++ b/docs/mra_reference.md @@ -0,0 +1,3 @@ +# MapServer Rest API - Rest Configuration API Reference + +It is in process of writing... \ No newline at end of file diff --git a/docs/mra_reference.rst b/docs/mra_reference.rst deleted file mode 100644 index f8b8562..0000000 --- a/docs/mra_reference.rst +++ /dev/null @@ -1,722 +0,0 @@ -===================================================== -MapServer Rest API - Rest Configuration API Reference -===================================================== - - - -Formats and representations -=========================== - -The following table defines the ``content-type`` values for each format you can use. - -+-------------+---------------------------------------------------------------+ -| Format | Content-type | -+=============+===============================================================+ -| XML | ``application/xml`` (or ``text/xml``) | -+-------------+---------------------------------------------------------------+ -| JSON | ``application/json`` | -+-------------+---------------------------------------------------------------+ -| HTML | ``text/html`` | -+-------------+---------------------------------------------------------------+ -| SLD | ``application/vnd.ogc.sld+xml`` | -+-------------+---------------------------------------------------------------+ -| MAP | ``text/plain`` | -+-------------+---------------------------------------------------------------+ - - -Status codes -============ - -The following table sets out the main ``status-code`` you can obtain. - -+-------------+---------------------------------------------------------------+ -| Status-code | Definition | -+=============+===============================================================+ -| 200 | The request was fulfilled | -+-------------+---------------------------------------------------------------+ -| 201 | The request was fulfilled and resulted in a new resource | -| | being created | -+-------------+---------------------------------------------------------------+ -| 403 | The server understood the request, but is refusing to fulfill | -| | it | -+-------------+---------------------------------------------------------------+ -| 404 | The server has not found anything matching the URI given | -+-------------+---------------------------------------------------------------+ -| 405 | The method is not allowed by the server | -+-------------+---------------------------------------------------------------+ -| 500 | The server encountered an unexpected condition which | -| | prevented it from fulfilling the request | -+-------------+---------------------------------------------------------------+ -| 501 | The server does not support the functionality required to | -| | fulfill the request. | -+-------------+---------------------------------------------------------------+ - -See `HTTP specification`_ for more information about status codes. - -.. _HTTP specification: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html - - -Maps -==== - -``Maps`` includes all mapfiles. - -The Mapfile is the heart of MapServer. -It defines the relationships between objects, points MapServer to where data are located and defines how things are to be drawn. - -See `Mapfile specification`_ for more information about the Mapfile. - -.. _Mapfile specification: http://www.mapserver.org/mapfile/ - - -Operations ----------- - -``/maps.<format>`` -^^^^^^^^^^^^^^^^^^ - -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | List all mapfiles | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | Create a new mapfile | 201 with | XML, JSON | -| | | ``location``| | -| | | header | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - - -*Exceptions:* - -* POST for a mapfile already exist: 409 Conflict - - -``/maps/<map>.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | List all mapfiles | 200 | MAP, XML, JSON, | -| | | | HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | *TODO: Modify mapfile <map>* | | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | Delete mapfile <map> | | | -+--------+---------------------------------+-------------+--------------------+ - -*Exceptions:* - -* GET for a mapfile does not exist: 404 Not Found -* *TODO: PUT that changes name of mapfile: 403 Forbidden* -* *TODO: DELETE against a mapfile that is non-empty: 403 Forbidden* - - -Workspaces -========== - -A workspace is a grouping of data stores and coverage stores. - -Operations ----------- - -``/maps/<map>/workspaces.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | List all workspaces | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | *TODO: Create a new workspace* | | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - - -``/maps/<map>/workspaces/<ws>.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -For current version of MapServer Rest API, a ``workspace`` corresponds to a mapfile. -And so, only one workspace can be available. -Thus, in order to not confuse the two concepts, the workspace is set to 'default' value. - - -``/maps/<map>/workspaces/default.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | Return default workspace | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - - -Data stores -=========== - -A ``data store`` is a source of spatial data that is vector based. -Only the case of PostGIS is currently implemented. - -Operations ----------- - -``/maps/<map>/workspaces/<ws>/datastores.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<ws>`` by the name of your workspace. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | List all data stores in | 200 | XML, JSON, HTML | -| | workspace/mapfile <ws> | | | -+--------+---------------------------------+-------------+--------------------+ -| POST | Create new data store | 201 with | XML, JSON | -| | | ``location``| | -| | | header | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exceptions:* - -* POST for a data store already exist: 409 Conflict - - -``/maps/<map>/workspaces/<ws>/datastores/<ds>.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<ws>`` by the name of your workspace. -| Replace ``<ds>`` by the name of datastore available of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | Return data store <ds> | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | Modify data store <ds> | 200 | XML, JSON | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | Delete data store <ds> | 200 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exceptions:* - -* GET for a data store does not exist: 404 Not Found -* PUT that changes name of data store: 403 Forbidden -* DELETE against a data store that contains configured feature type: 403 Forbidden - - -``/maps/<map>/workspaces/<ws>/datastores/<ds>/file[.<extension>]`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Uploads a file from a local source. The body of the request is the file itself. - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<ws>`` by the name of your workspace. -| Replace ``<ds>`` by the name of datastore available of your choice. - -The ``<extension>`` parameter specifies the type of data store. -The following extensions are supported: - -+-------------------+---------------------------------------------------------+ -| Extension | Datastore | -+===================+=========================================================+ -| shp | OGR/ESRI Shapefile | -+-------------------+---------------------------------------------------------+ - -+--------+--------------------------+-------------+-----------+---------------+ -| Method | Action | Return Code | Formats | Parameters | -+========+==========================+=============+===========+===============+ -| GET | | 405 | | | -+--------+--------------------------+-------------+-----------+---------------+ -| POST | | 405 | | | -+--------+--------------------------+-------------+-----------+---------------+ -| PUT | Uploads files to the | 200 | See notes | ``configure`` | -| | data stores <ds> | | below. | See notes | -| | | | | below. | -+--------+--------------------------+-------------+-----------+---------------+ -| DELETE | | 405 | | | -+--------+--------------------------+-------------+-----------+---------------+ - -Data stores like Shapefile must be sent as a zip archive. -When uploading a zip archive the ``Content-type`` should be set to ``application/zip`` - -The ``configure`` parameter is used to control how the data store is configured upon file upload. -It can take one of the below values : - -* ``none`` - Do not configure any feature types. This is the default value - -* *TODO: ``first`` - Only setup the first feature type available in the data store.* - -* *TODO: ``all` - Configure all feature types.* - - -Feature types -============= - -A ``feature type`` is a data set that originates from a data store. - -Operations ----------- - -``/maps/<map>/workspaces/<ws>/datastores/<ds>/featuretypes.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<ws>`` by the name of your workspace. -| Replace ``<ds>`` by the name of datastore available of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | List all feature types in | 200 | XML, JSON, HTML | -| | selected data store <ds> | | | -+--------+---------------------------------+-------------+--------------------+ -| POST | Create a new feature type | 201 with | XML, JSON | -| | | ``location``| | -| | | header | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exceptions:* - -* GET for a feature type that does not exist: 404 Not Found -* POST for a feature type already exist: 409 Conflict - - -``/maps/<map>/workspaces/<ws>/datastores/<ds>/featuretypes/<ft>.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<ws>`` by the name of your workspace. -| Replace ``<ds>`` by the name of datastore available of your choice. -| Replace ``<ft>`` by the name of feature type available of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | Return feature type <ft> | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | Modify feature type <ft> | 200 | XML, JSON | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | Delete feature type <ft> | 200 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exceptions:* - -* GET for a feature type does not exist: 404 Not Found -* PUT that changes name of feature type: 403 Forbidden -* DELETE against a feature type which is used by a layer: 403 Forbidden - - -Coverage stores -=============== - -A ``coverage store`` is a source of spatial data that is raster based. - -Operations ----------- - -``/maps/<map>/workspaces/<ws>/coveragestores.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<ws>`` by the name of your workspace. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | List all coverage stores in | 200 | XML, JSON, HTML | -| | workspace | | | -+--------+---------------------------------+-------------+--------------------+ -| POST | Create new coverage store | 201 with | XML, JSON | -| | | ``location``| | -| | | header | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exceptions:* - -* POST for a coverage store already exist: 409 Conflict - - -``/maps/<map>/workspaces/<ws>/coveragestores/<cs>.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<ws>`` by the name of your workspace. -| Replace ``<cs>`` by the name of coverage store available of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | Return coverage store <cs> | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | Modify coverage store <ds> | 200 | XML, JSON | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | Delete coverage store <ds> | 200 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exceptions:* - -* GET for a coverage store does not exist: 404 Not Found -* PUT that changes name of coverage store: 403 Forbidden -* DELETE against a coverage store that contains configured coverage: 403 Forbidden - - -Coverages -========= - -A ``coverage`` is a raster based data set which originates from a coverage store. - -Operations ----------- - -``/maps/<map>/workspaces/<ws>/coveragestores/<cs>/coverages.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<ws>`` by the name of your workspace. -| Replace ``<cs>`` by the name of coverage store available of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | List all coverages in selected | 200 | XML, JSON, HTML | -| | coverages store <cs> | | | -+--------+---------------------------------+-------------+--------------------+ -| POST | Create a new coverage | 201 With | XML, JSON | -| | | ``Location``| | -| | | header | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exceptions:* - -* POST for a coverage already exist: 409 Conflict - - -``/maps/<map>/workspaces/<ws>/coveragestores/<cs>/coverages/<c>.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<ws>`` by the name of your workspace. -| Replace ``<cs>`` by the name of coverage store available of your choice. -| Replace ``<c>`` by the name of coverage available of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | Return coverage <c> | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | Create new coverage <c> | 200 | XML, JSON | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | Delete coverage <c> | 200 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exceptions:* - -* GET for a coverage does not exist: 404 Not Found -* PUT that changes name of coverage: 403 Forbidden -* DELETE against a coverage which is used by a layer: 403 Forbidden - - -Styles -====== - -A ``style`` describes how a resource (feature type or coverage) should be symbolized or rendered by a Web Map Service. -Styles are specified with SLD and translated into the mapfile (with CLASS and STYLE blocs) to be applied. - -Operations ----------- - -``/maps/<map>/styles.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | Return all styles for map <map> | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | Create a new style for map | 201 With | SLD (see note | -| | | ``Location``| below) | -| | | header | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - -+--------+--------------------------+-------------+-----------+---------------+ -| Method | Action | Return Code | Formats | Parameters | -+========+==========================+=============+===========+===============+ -| GET | Return all styles | 200 | | | -+--------+--------------------------+-------------+-----------+---------------+ -| POST | Create a new style | 201 With | SLD (see | name (see note| -| | | ``Location``| note | below) | -| | | header | below) | | -+--------+--------------------------+-------------+-----------+---------------+ -| PUT | | 405 | | | -+--------+--------------------------+-------------+-----------+---------------+ -| DELETE | | 405 | | | -+--------+--------------------------+-------------+-----------+---------------+ - -When executing a POST request with an SLD style, the Content-type header should be set to ``application/vnd.ogc.sld+xml``. - -The ``name`` parameter specifies the name to be given to the style. - -*Exceptions:* - -* POST for a style already exist: 409 Conflict - - -``/maps/<map>/styles/<s>.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<s>`` by the name of the style for layer of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | Return style <s> | 200 | SLD, HTML, XML, | -| | | | JSON | -+--------+---------------------------------+-------------+--------------------+ -| POST | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | Modify style <s> | 200 | SLD (see note | -| | | | below) | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | Delete style <s> | 200 | | -+--------+---------------------------------+-------------+--------------------+ - -When executing a POST request with an SLD style, the Content-type header should be set to ``application/vnd.ogc.sld+xml``. - -*Exception:* - -* GET for a style does not exist: 404 Not Found -* *TODO: PUT that changes name of style: 403 Forbidden* -* *DELETE against a coverage which is used by a layer: 403 Forbidden* - - -Layers -====== - -A ``layer`` is a published resource (feature type or coverage) from a mapfile. - -Operations ----------- - -``/maps/<map>/layers.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | List all layers provided by | 200 | XML, JSON, HTML | -| | the mapfile <map> | | | -+--------+---------------------------------+-------------+--------------------+ -| POST | Create a layer | 201 With | XML, JSON | -| | | ``Location``| | -| | | header | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exception:* - -* POST for a layer already exist: 409 Conflict - - -``/maps/<map>/layers/<l>.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<l>`` by the name of the layer of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | Return layer <l> | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | Modify layer <l> | 200 | XML, JSON | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | Delete layer <l> | 200 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exception:* - -* GET for a layer does not exist: 404 Not Found -* PUT that changes name of layer: 403 Forbidden - - -``/maps/<map>/layers/<l>/styles.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<l>`` by the name of the layer of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | Return all styles for layer <l> | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | Add a new style to layer <l> | 201 With | XML, JSON | -| | | ``Location``| | -| | | header | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exception:* - -* POST for a style already exist: 409 Conflict - - -``/maps/<map>/layers/<l>/styles/<s>.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<l>`` by the name of the layer of your choice. -| Replace ``<s>`` by the name of the style of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| POST | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | Remove style <s> from layer <l> | 200 | | -+--------+---------------------------------+-------------+--------------------+ - - -Layergroups -=========== - -A ``layergroup`` is a grouping of layers and styles that can be accessed as a single layer in a WMS GetMap request. - -Operations ----------- - -``/maps/<map>/layergroups.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | List all layer groups provided | 200 | XML, JSON, HTML | -| | by the mapfile <map> | | | -+--------+---------------------------------+-------------+--------------------+ -| POST | Create a new layer group | 201 With | XML, JSON | -| | | ``Location``| | -| | | header | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | | 405 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exception:* - -* POST for a layer group already exist: 409 Conflict - - -``/maps/<map>/layergroups/<lg>.<format>`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -| Replace ``<map>`` by the name of your mapfile. -| Replace ``<lg>`` by the name of the layer group of your choice. -| Replace ``<format>`` by the format extension of your choice. - -+--------+---------------------------------+-------------+--------------------+ -| Method | Action | Return Code | Formats | -+========+=================================+=============+====================+ -| GET | Return layer group <lg> | 200 | XML, JSON, HTML | -+--------+---------------------------------+-------------+--------------------+ -| POST | | 405 | | -+--------+---------------------------------+-------------+--------------------+ -| PUT | Add layer group <lg> | 200 | XML, JSON | -+--------+---------------------------------+-------------+--------------------+ -| DELETE | Delete layer group <lg> | 200 | | -+--------+---------------------------------+-------------+--------------------+ - -*Exception:* - -* GET for a layer group does not exist: 404 Not Found -* PUT that changes name of layer group: 403 Forbidden -- GitLab