Services¶
The services package.
-
class
services.retrieval.
Doc
[source]¶ Container class for all web requests for single documents
-
__module__
= 'services.retrieval'¶
-
get
(*args, **kwargs)[source]¶ A REST endpoint for fetching a single document from the doc store.
Parameters: - lang – A two letter language code for the response
- smallkey (str) – A short key which uniquely identifies the dataset
Returns: Response – a JSON response object; None with a 404 code if the key was not matched
-
methods
= ['GET']¶
-
-
class
services.retrieval.
Docs
[source]¶ Container class for all web requests for sets of documents
-
__module__
= 'services.retrieval'¶
-
get
(*args, **kwargs)[source]¶ A REST endpoint for fetching a single document from the doc store.
Parameters: - lang (str) – A two letter language code for the response
- smallkeylist (str) – A comma separated string of short keys each of which identifies a single dataset
- sortargs (str) – ‘sort’ if returned list should be sorted based on geometry
Returns: list – an array of JSON configuration fragments
(empty error objects are added where keys do not match)
-
methods
= ['GET']¶
-
-
class
services.update.
Update
[source]¶ Updates a specific element of an existing registration
-
__module__
= 'services.update'¶
-
methods
= ['PUT']¶
-
-
class
services.upgrade.
Upgrade
[source]¶ Handles upgrading of entries from v1 to v2
-
__module__
= 'services.upgrade'¶
-
methods
= ['POST']¶
-
API utilities
-
services.utils.
jsonp
(func)[source]¶ A decorator function that wraps JSONified output for JSONP requests.
-
services.utils.
log_exception
(sender, exception)[source]¶ Detailed error logging function. Designed to attach to Flask exception events and logs a bit of extra infomration about the request that triggered the exception.
Parameters: - sender – The sender for the exception (we don’t use this and log everyhing against app right now)
- exception (Exception) – The exception that was triggered
-
class
services.v1.
Simplification
[source]¶ Handles updates to simplification factor of a feature layer
-
__module__
= 'services.v1'¶
-
methods
= ['PUT']¶
-
put
(*args, **kwargs)[source]¶ A REST endpoint for updating a simplification factor on a registered feature service.
Parameters: smallkey (str) – A unique identifier for the dataset (can be any unique string, but preferably should be short) Returns: JSON Response – 200 on success; 400 with JSON payload of an errors array on failure
-