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.DocV1[source]
__init__()[source]
__module__ = 'services.retrieval'
methods = ['GET']
class services.retrieval.DocV2[source]
__init__()[source]
__module__ = 'services.retrieval'
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.retrieval.DocsV1[source]
__init__()[source]
__module__ = 'services.retrieval'
methods = ['GET']
class services.retrieval.DocsV2[source]
__init__()[source]
__module__ = 'services.retrieval'
methods = ['GET']
class services.retrieval.Version[source]
__module__ = 'services.retrieval'
get()[source]
methods = ['GET']
class services.update.Update[source]

Updates a specific element of an existing registration

__module__ = 'services.update'
methods = ['PUT']
put(*args, **kwargs)[source]

A REST endpoint for updating one or more nodes of an existing request.

Parameters:key (str) – A unique identifier for the dataset
Returns:JSON Response – 200 on success; 4xx if problems are encountered
class services.upgrade.Upgrade[source]

Handles upgrading of entries from v1 to v2

__module__ = 'services.upgrade'
methods = ['POST']
post(*args, **kwargs)[source]

A REST endpoint for upgrading a previous registration from v1 to v2.

Parameters:key (str) – A unique identifier for the dataset
Returns:JSON Response – 200 on success; 4xx if problems are encountered
services.upgrade.feat_upgrade(v1_request)[source]
services.upgrade.wms_upgrade(v1_request)[source]

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
services.v1.make_blueprint()[source]

Create a v1 Flask Blueprint

services.v2.make_blueprint(app)[source]

Create a v2 Flask Blueprint