walib Package

walib Web Admin core library module

walib utilities

walib.utils

walib.utils.encodeobject(obj, encoding='utf-8')
walib.utils.getFoiNamesList(pgdb, service, offering=None)

Return the list of observed properties

@param pgdb: service connection @type pgdb: L{wa.databaseManager.PgDB} object @param service: service name @type service: L{string} @param offering: filter procedures by this offering name @type offering: C{string} or C{None} @return: C{list} of C{dict} with observed property C{id} and C{name} keys

>>> Return example:
    [
        { "id":1,"name":"urn:ogc:def:parameter:x-istsos:1.0:lake:water:height"},
        { "id":2,"name":"urn:ogc:def:parameter:x-istsos:1.0:meteo:air:rainfall"}
    ]
walib.utils.getGeoJSONFromProcedure(pgdb, service, procedure, epsg)
>>> Return example:
    {"type":"Point","coordinates":[8.961270000000001,46.027230000000003,344.100000000000023]}    
walib.utils.getObsPropNamesList(pgdb, service, offering=None)

Return the list of observed properties

@param pgdb: service connection @type pgdb: L{wa.databaseManager.PgDB} object @param service: service name @type service: L{string} @param offering: filter procedures by this offering name @type offering: C{string} or C{None} @return: C{list} of C{dict} with observed property C{id} and C{name} keys

>>> Return example:
    [
        { "id":1,"name":"urn:ogc:def:parameter:x-istsos:1.0:lake:water:height"},
        { "id":2,"name":"urn:ogc:def:parameter:x-istsos:1.0:meteo:air:rainfall"}
    ]
walib.utils.getObservationPeriod(pgdb, service, procedures)

Return the list of procedures with observation periods

@param pgdb: service connection @type pgdb: L{wa.databaseManager.PgDB} object @param service: service name @type service: L{string} @param procedures: procedures @type procedure: C{list} of C{string} @return: C{list} of C{dict} with procedure, stime (start time) and etime (end time) keys

>>> Return example:
    [
        { "procedure":"P_TRE","stime":"2000-12-31T23:00:00Z", "etime":"2012-12-31T23:00:00Z"},
        { "procedure":"P_ BOD","stime":"1986-12-31T23:00:00Z", "etime":"2012-12-31T23:00:00Z"}
    ]
walib.utils.getObservedPropertiesFromProcedure(pgdb, service, procedure)

Return the list of observed properties related to the given procedure

@param pgdb: service connection @type pgdb: L{wa.databaseManager.PgDB} object @param service: service name @type service: L{string} @param procedureID: filter procedure id @type procedure: C{string} or C{None} @return: C{list} of C{dict} with observed property C{id} and C{name} keys

>>> Return example:
    [
        { "id":1,"def":"urn:ogc:def:parameter:x-istsos:1.0:lake:water:height", "name":"lake-water-height"},
        { "id":2,"def":"urn:ogc:def:parameter:x-istsos:1.0:meteo:air:rainfall", "name":"lake-air-rainfall"}
    ]
walib.utils.getOfferingDetailsList(pgdb, service)

Return the list of offerings details for a given istsos service connection

@param pgdb: service connection @type pgdb: L{wa.databaseManager.PgDB} object @param service: service name @type service: L{string} @return: C{list} of C{dict} with offering C{id} and C{name} keys

>>> Return example:
    [
        {"name": "temperature","description": "descrizione 3","procedures": 12,"expiration": "22.12.2012","active": true},
        {"name": "water","description": "descrizione 3","procedures": 22,"expiration": "22.12.2012","active": true},
        {"name": "air","description": "descrizione 3","procedures": 3,"expiration": "22.12.2012","active": true}
    ]
walib.utils.getOfferingNamesList(pgdb, service)

Return the list of offerings for a give istsos service connection

@param pgdb: service connection @type pgdb: L{wa.databaseManager.PgDB} object @param service: service name @type service: L{string} @return: C{list} of C{dict} with offering C{id} and C{name} keys

>>> Return example:
    [
        { "id":1,"name":"temporary"},
        { "id":2,"name":"water"},
        { "id":3,"name":"air"}
    ]
walib.utils.getOfferingsFromProcedure(pgdb, service, procedure)

Return the list of offerings related to the given procedure

@param pgdb: service connection @type pgdb: L{wa.databaseManager.PgDB} object @param service: service name @type service: L{string} @param procedureID: filter procedure id @type procedure: C{string} or C{None} @return: C{list} of C{dict} with observed property C{id} and C{name} keys

>>> Return example:
    [
        { "id":1,"name":"urn:ogc:def:parameter:x-istsos:1.0:lake:water:height"},
        { "id":2,"name":"urn:ogc:def:parameter:x-istsos:1.0:meteo:air:rainfall"}
    ]
walib.utils.getProcedureNamesList(pgdb, service, offering=None, observationType=None)

Return the list of procedures:

The list can be filtered by offering and/or observationType

@param pgdb: service connection @type pgdb: L{wa.databaseManager.PgDB} object @param service: service name @type service: L{string} @param offering: filter procedures by this offering name @type offering: C{string} or C{None} @type observationType: C{string} or C{None} @return: C{list} of C{dict} with procedure C{id} and C{name} keys

>>> Return example:
    [
        { "id":1,"name":"Chiasso", "description": "", "assignedid": "1234"},
        { "id":2,"name":"Bellinzona", "description": "", "assignedid": "1235"},
        { "id":3,"name":"Lugano", "description": "", "assignedid": "1236"}
    ]
walib.utils.getServiceList(servicepath, listonly=False)

Return the list of istsos services

@param servicepath: path to service folder @param listonly: define if only service list is requested (optional - default L{False}) @param type: L{boolean} @return: return a list of services

>>> Return example with listonly==True :
    [name1,name2,...]
>>> Return example with listonly==False:
    [
        {"service":name1,"path":path1},
        {"service":name1,"path":path1},
        ...
    ]
walib.utils.preventInjection(sql)

Parse given sql with regex for possible malicious sql ignection

@param sql: text to parse @param type: L{string} @return: L{True} if no malicious sql ingnection was detected

walib.utils.to_unicode_or_bust(obj, encoding='utf-8')
walib.utils.valid_NCName(name)
walib.utils.validateJsonConstraint(constraint)
Permitted conigurations:
{“role”:”urn:ogc:def:classifiers:x-istsos:1.0:qualityIndexCheck:level0”,”min”:”10”} {“role”:”urn:ogc:def:classifiers:x-istsos:1.0:qualityIndexCheck:level0”,”max”:”10”} {“role”:”urn:ogc:def:classifiers:x-istsos:1.0:qualityIndexCheck:level0”,”interval”:[“-10”,”10”]} {“role”:”urn:ogc:def:classifiers:x-istsos:1.0:qualityIndexCheck:level0”,”valueList”:[“1”,”2”,”3”,”4”,”5”,”6”]}
walib.utils.validatedb(user, password, dbname, host, port=5432, service=None)

Validate a service db connection parameters

@param user: user name used to authenticate @param password: password used to authenticate @param dbname: the database name (only in dsn string) @param host: database host address @param port: onnection port number (optional - defaults to 5432) @param service: service name that correspond with associated database schema (optional) @return: L{True} if connection could be estabished and the schema found (only if schema is provided)

walib.utils.verifyxmlservice(url)

databaseManager

class walib.databaseManager.Database

Connect to a database

closeConnection()

Close a database connection

dbName = None
getConnection()

Return a database connection

host = None
password = None
port = None
user = None
class walib.databaseManager.PgDB(user, password, dbName, host='localhost', port='5433')

Bases: walib.databaseManager.Database

Connect to a PostgreSQL database

commitTransaction()

Commit current transaction

execute(sql, par=None)

Execute an sql statement

executeInTransaction(sql, par=None)

Execute an sql statement in an open session

host = None
insertMany(sql, dict)

Insert many values at once

mogrify(sql, par=None)

Mogrify an sql statement (print >> sys.stderr, the actual sql query that will be executed)

rollbackTransaction()

Rollback current transaction

select(sql, par=None)

Execute a select statement

configManager

class walib.configManager.waServiceConfig(defaultcfgpath, servicecfgpath=None)

base service configuration object to handle configuration files

>>> Class structure:
    self.defaultcfgpath --> path of the default configuration file
    self.servicecfgpath --> path of the service configuration file
    self.sections = --> list of available sections
    self.* = {} --> dictionary of the options for the * section

@note: Each section is an attribute of the waServiceConfig object and is a dictionary of option names (key) and value. Additionally each section dictionary has a special key “default” that is a boolean variable indicating if the section is set in the default or specific service configuration file.

>>> Example of section attribute
    myconfig = waServiceConfig("/services","/services/myservice")
    print myconfig.serviceurl
    {'default': True, 'post': 'http://localhost:8099', 'get': 'http://localhost:8099'}
delete(section)

returns the requested section as a dictionary

@param section: configuration section @type section: C{string}

get(section)

returns the requested section as a dictionary

@param section: configuration section @type section: C{string}

put(section, option, value)

put new value to given option in given section

@param section: configuration section @type section: C{string} @param option: configuration option @type option: C{string} @param value: configuration value @type section: C{value}

save()

save current configuration to appropriate files

wa_version

resource

class walib.resource.waResource(waEnviron, loadjson=True)

Bases: object

Base class for istSOS Web Admin REST operations

executeDelete()

base method to execute DELETE request

executeGet()

base method to execute GET request

executePost()

base method to execute POST request

executePut()

base method to execute PUT request

getResponse()
setData(data)

Set data in response

setException(msg)

Set exception message in response

setLog(log)

set message in log

setMessage(msg)

Set message in response

validateDelete()

base method to validate DELETE request

validateGet()

base method to validate GET request

validatePost()

base method to validate POST request

validatePut()

base method to validate PUT request

class walib.resource.waResourceAdmin(waEnviron, loadjson=True)

Bases: walib.resource.waResource

Extension class of istSOS Web Admin REST operations that manages Wab Admin Configuration

class walib.resource.waResourceConfigurator(waEnviron, loadjson=True)

Bases: walib.resource.waResourceService

executeDelete()

Execute operation DELETE for on service configuration sections

@note: it does not work on default service

executeGet()

Execute operation GET for on service configuration sections

executePut(json=None)

Execute operation PUT for on service configuration sections and return new values

validate()
class walib.resource.waResourceService(waEnviron, service=None, loadjson=True)

Bases: walib.resource.waResourceAdmin

sqlschema

resourceFactory

walib.resourceFactory.initResource(waEnviron)

procedure

class walib.procedure.Procedure(serviceconf=None)
loadDICT(describeSensorObj)

Create the the self.data object representing the istSOS SensorML from a json elemet

@param json: a json describeSensor object

loadJSON(describeSensorObj)

Create the the self.data object representing the istSOS SensorML from a json elemet

@param json: a json describeSensor object

loadXML(xml)

Create the the self.data object representing the istSOS SensorML from an XML elemet

@param json: a json describeSensor object (xml string or xml file full path)

toJSON()

Return the Json that represent the self.data object as L{string}

toRegisterSensor(indent=False)

Create a SOS register sensor request String from self.procedure object

toRegisterSensorDom(indent=False)

Create a SOS register sensor request DOM element from self.procedure object

toXML(indent=False)

Return the SensorML that represent the self.data object as L{string}

walib.procedure.parse_and_get_ns(file)

walib admin config

paths

class walib.admin.configsections.paths.waPaths(waEnviron, loadjson=True)

Bases: walib.resource.waResourceAdmin

executeGet()
executePost()
executePut()

configsections

walib istsos config

istsos

procedures

class walib.istsos.services.procedures.procedures.waGetGeoJson(waEnviron)

Bases: walib.resource.waResourceService

Class to execute istsos/services/{serviceName}/procedures/operations/geojson/{epsg}

executeGet()
setData(data)

Set data in response

class walib.istsos.services.procedures.procedures.waGetlist(waEnviron)

Bases: walib.resource.waResourceService

Class to execute istsos/services/{serviceName}/procedures/operations/getlist

executeGet()
class walib.istsos.services.procedures.procedures.waProcedures(waEnviron)

Bases: walib.resource.waResourceService

class to handle SOS service objects, support GET and POST method

executeDelete()

Method for executing a DELETE requests that erase a SOS procedure

@note: This method delete:
  1. the given procedure
executeGet()

Method for executing a GET requests that rename a SOS service

{

“message”: “Sensor Description secessfully loaded”, “total”: 1, “data”: {

“inputs”: [], “description”: “”, “classification”: [

{
“definition”: “urn:ogc:def:classifier:x-istsos:1.0:systemType”, “name”: “System Type”, “value”: “insitu-fixed-point”

}, {

“definition”: “urn:ogc:def:classifier:x-istsos:1.0:sensorType”, “name”: “Sensor Type”, “value”: “temperature”

}

], “characteristics”: “”, “interfaces”: “”, “keywords”: “”, “contacts”: [], “assignedSensorId”: “ec08e1f51ab879f4e1796f3c187daff6”, “documentation”: [], “system”: “DEMO_1”, “capabilities”: [], “identification”: [], “location”: {

“geometry”: {

“type”: “Point”, “coordinates”: [

“8.88”, “45.45”

]

}, “crs”: {

“type”: “name”, “properties”: {

“name”: “4326”

}

}, “type”: “Feature”, “properties”: {

“name”: “lugano”

}

}, “outputs”: [

{

“definition”: “urn:ogc:def:parameter:x-istsos::time:iso8601”, “constraint”: {

“max”: “”, “interval”: [

“2007-11-03T14:00:00+01:00”, “2011-12-07T18:00:00+01:00”

], “role”: “”, “valuelist”: “”, “min”: “”

}, “name”: “Time”, “uom”: “”, “description”: “”

}, {

“definition”: “urn:ogc:def:parameter:x-istsos::meteo:air:temperature”, “constraint”: {

“max”: “”, “interval”: “”, “role”: “”, “valuelist”: “”, “min”: “”

}, “name”: “meteo-air-temperature”, “uom”: “deg”, “description”: “”

}

], “system_id”: “DEMO_1”, “history”: []

}, “success”: true

}

executePost(db=True)

Method for executing a POST requests that create a new SOS procedure

@note: This method creates:
  1. Create a new procedure sending an XML to the istsos service

The POST must be in Json format:

>>> {
        "system_id": "P_TRE",
        "system": "P_TRE",
        "description": "ciao",
        "keywords": "uno,due,tre",
        "identification": [
            {
                "definition":"urn:ogc:def:identifier:OGC:P_TRE",
                "name":"uniqueID",
                "value":"urn:ogc:def:procedure:x-istsos:1.0:test"
            }
        ],
        "classification": [
            {
                "name": "System Type",
                "definition": "urn:ogc:def:classifier:x-istsos:1.0:systemType",
                "value": "insitu-fixed-point"
            },
            {
                "name": "Sensor Type",
                "definition": "urn:ogc:def:classifier:x-istsos:1.0:sensorType",
                "value": "bukket"
            }
        ],
        "characteristics": "",
        "contacts": [],
        "documentation": [],
        "location": {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": ["123","456"]
            },
            "crs": {
                "type": "name",
                "properties": {"name": "EPSG:21781"}
            },
            "properties": {"name": "LUGANO"}
        },
        "interfaces": "",
        "inputs": [],
        "history": [],
        "capabilities": [
            {
                "name": "Memory Capacity",
                "description": "",
                "definition": "urn:ogc:def:classifier:x-istsos:1.0:memoryCapacity",
                "uom": "Byte",
                "value": "131"
            },
            {
                "name": "Sampling time resolution",
                "definition": "urn:ogc:def:classifier:x-istsos:1.0:samplingTimeResolution",
                "uom": "iso8601",
                "value": "PT10M"
            },
            {
                "name": "Acquisition time resolution",
                "definition": "urn:ogc:def:classifier:x-istsos:1.0:acquisitionTimeResolution",
                "uom": "iso8601",
                "value": "PT1H"
            }
        ],
        "outputs": [
            {
                "name": "Time",
                "definition": "urn:ogc:def:dataType:x-istsos:1.0:time",
                "uom": "iso8601",
                "description": "",
                "constraint": {
                    "role": "urn:ogc:def:classifiers:x-istsos:1.0:dataAvailability",
                    "min": "",
                    "max": "",
                    "interval": [123,456],
                    "valuelist": ""
                }
            },
            {
                "name": "Conductivity",
                "definition": "urn:ogc:def:phenomenon:x-istsos:1.0:conductivity",
                "uom": "Pressure",
                "description": "foo bar",
                "constraint": {
                    "role": "urn:ogc:def:classifiers:x-istsos:1.0:qualityIndex:check:reasonable",
                    "interval": ["12","65"]
                }
            }
        ]
    }
executePut()

Method for executing a PUT requests that update a SOS sensorML procedure

@note: This method replace old sensorML with the new one, note that
database objectes are not updated. To update entirely a procedure consider to delete and recreate it.
  1. ...

The Put must be in Json format:

>>> {
        ...
    }

dataqualities

class walib.istsos.services.dataqualities.dataqualities.waDataqualities(waEnviron)

Bases: walib.resource.waResourceService

class to handle SOS unit of data quality objects, support GET and POST method

executeDelete()

Method for executing a DELETE requests that remove an existing SOS data quality

Note

The DELETE must include code in the URL

>>> http://localhost/istsos/wa/istsos/services/demo/dataqualities/1000
executeGet()

Method for executing a GET requests that remove an existing SOS data quality

Note

The GET must include code in the URL

>>> http://localhost/istsos/wa/istsos/services/demo/dataqualities/1000
executePost()

Method for executing a POST requests that create a new SOS data quality

Note

The POST must be in Json format with mandatory code, name and description keys

>>> http://localhost/istsos/wa/istsos/services/demo/dataqualities
>>> {
        "code": 100,
        "name": "raw",
        "description": "the format is correct"
    }
executePut()

Method for executing a PUT requests that updates an existing SOS data quality

Note

The PUT must be in Json format with mandatory name and description keys

>>> http://localhost/istsos/wa/istsos/services/demo/dataqualities/1000
>>> {
                    "name": "raw",
                    "description": "the format is correct"
            }

uoms

class walib.istsos.services.uoms.uoms.waUoms(waEnviron)

Bases: walib.resource.waResourceService

class to handle SOS unit of measure objects, support GET and POST method

executeDelete()

Method for executing a DELETE requests that remove an existing SOS observed property

executeGet()
executePost()

Method for executing a POST requests that create a new SOS observed property

executePut()

Method for executing a POST requests that create a new SOS observed property

services

identification

class walib.istsos.services.configsections.identification.waIdentification(waEnviron, loadjson=True)

Bases: walib.resource.waResourceConfigurator

[identification] keywords = SOS,IST,SUPSI abstract = hydro-meteorological monitoring network authority = x-ist urnversion = 1.0 fees = NONE accessConstrains = NONE title = IST Sensor Observation Service

template = {'title': ['identification', 'title'], 'abstract': ['identification', 'abstract'], 'urnversion': ['identification', 'urnversion'], 'authority': ['identification', 'authority'], 'fees': ['identification', 'fees'], 'keywords': ['identification', 'keywords'], 'accessconstrains': ['identification', 'accessConstrains']}

geo

class walib.istsos.services.configsections.geo.waGeo(waEnviron, loadjson=True)

Bases: walib.resource.waResourceConfigurator

template = {'yaxisname': ['geo', 'yAxisName'], 'zaxisname': ['geo', 'zAxisName'], 'istsosepsg': ['geo', 'istsosepsg'], 'allowedepsg': ['geo', 'allowedEPSG'], 'xaxisname': ['geo', 'xAxisName']}
validate()

urn

class walib.istsos.services.configsections.urn.waUrn(waEnviron, loadjson=True)

Bases: walib.resource.waResourceConfigurator

executeDelete()
executeGet()

Execute operation GET for on service configuration sections

executePost()
executePut()
template = {'offering': ['urn', 'offering'], 'dataType': ['urn', 'dataType'], 'phenomena': ['urn', 'phenomena'], 'keywords': ['urn', 'keywords'], 'identifier': ['urn', 'identifier'], 'parameter': ['urn', 'parameter'], 'feature': ['urn', 'feature'], 'sensorType': ['urn', 'sensorType'], 'process': ['urn', 'process'], 'role': ['urn', 'role'], 'refsystem': ['urn', 'refsystem'], 'time': ['urn', 'time'], 'property': ['urn', 'property'], 'sensor': ['urn', 'sensor'], 'procedure': ['urn', 'procedure']}

connection

class walib.istsos.services.configsections.connection.waConnection(waEnviron, loadjson=True)

Bases: walib.resource.waResourceConfigurator

executePut()
template = {'host': ['connection', 'host'], 'password': ['connection', 'password'], 'user': ['connection', 'user'], 'dbname': ['connection', 'dbname'], 'port': ['connection', 'port']}
class walib.istsos.services.configsections.connection.waValidatedb(waEnviron, service=None, loadjson=True)

Bases: walib.resource.waResourceService

Implementation of the operation/validatedb GET operation

executeGet()

Test the connection parameters in the server/service configuration

validateGet()

configsections

class walib.istsos.services.configsections.configsections.waConfigsections(waEnviron, service=None, loadjson=True)

Bases: walib.resource.waResourceService

Implementation of the configsection GET operation (if non configsection setted all the sections are returned)

executeGet()
executePut()

serviceurl

class walib.istsos.services.configsections.serviceurl.waServiceurl(waEnviron, loadjson=True)

Bases: walib.resource.waResourceConfigurator

template = {'url': ['serviceurl', 'url']}

provider

class walib.istsos.services.configsections.provider.waProvider(waEnviron, loadjson=True)

Bases: walib.resource.waResourceConfigurator

[provider] contactCountry = Switzerland providerName = Istituto Scienze della Terra contactCity = Lugano contactAdminArea = Canton Ticino contactVoice = +4179123456 contactEmail = clark.kent@superman.com contactDeliveryPoint = Via Cippili contactName = Pinco Pallino contactPostalCode = 6900 contactPosition = Data manager providerSite = http://istgeo.ist.supsi.ch contactFax = +4179123459

template = {'providername': ['provider', 'providerName'], 'contactposition': ['provider', 'contactPosition'], 'providersite': ['provider', 'providerSite'], 'contactfax': ['provider', 'contactFax'], 'contactcountry': ['provider', 'contactCountry'], 'contactcity': ['provider', 'contactCity'], 'contactvoice': ['provider', 'contactVoice'], 'contactemail': ['provider', 'contactEmail'], 'contactdeliverypoint': ['provider', 'contactDeliveryPoint'], 'contactname': ['provider', 'contactName'], 'contactpostalcode': ['provider', 'contactPostalCode'], 'contactadminarea': ['provider', 'contactAdminArea']}

getobservation

class walib.istsos.services.configsections.getobservation.waGetobservation(waEnviron, loadjson=True)

Bases: walib.resource.waResourceConfigurator

template = {'correct_qi': ['getobservation', 'correct_qi'], 'stat_qi': ['getobservation', 'stat_qi'], 'defaultqi': ['getobservation', 'default_qi'], 'aggregatenodataqi': ['getobservation', 'aggregate_nodata_qi'], 'maxgoperiod': ['getobservation', 'maxGoPeriod'], 'transactional_log': ['getobservation', 'transactional_log'], 'aggregatenodata': ['getobservation', 'aggregate_nodata']}

epsgs

class walib.istsos.services.epsgs.epsgs.waEpsgs(waEnviron)

Bases: walib.resource.waResourceService

class to handle SOS service objects, support GET and POST method

executeGet()

Method for executing a GET requests that return a list of valid EPSG codes

offerings.procedures

class walib.istsos.services.offerings.procedures.procedures.waMemberslist(waEnviron)

Bases: walib.istsos.services.offerings.procedures.procedures.waProcedures

class to handle SOS offerings objects, support only GET method

executeGet()
class walib.istsos.services.offerings.procedures.procedures.waNonmemberslist(waEnviron)

Bases: walib.istsos.services.offerings.procedures.procedures.waProcedures

class to handle SOS offerings objects, support only GET method

executeGet()
class walib.istsos.services.offerings.procedures.procedures.waProcedures(waEnviron)

Bases: walib.resource.waResourceService

class to handle SOS procedures objects in related to an offering, support GET and POST method

executeDelete()

Method for executing a DELETE requests remove an offering procedure member

executePost()

Method for executing a POST requests that initialize a new SOS service

@note: This method creates a new istSOS offering

The POST must be in Json format with mandatory offering key:

>>> [
        {
            "offerings": "meteo",
            "procedure": "RAIN_SENSOR_2"
        },{
            "offerings": "meteo",
            "procedure": "RAIN_SENSOR_1"
        }
    ] 

offerings

class walib.istsos.services.offerings.offerings.waGetlist(waEnviron, service=None, loadjson=True)

Bases: walib.resource.waResourceService

class to handle SOS offerings objects, support only GET method

executeGet()
class walib.istsos.services.offerings.offerings.waOfferings(waEnviron)

Bases: walib.resource.waResourceService

class to handle SOS offerings objects, support GET, POST, PUT and DELETE method

executeDelete()

Method for executing a DELETE requests that erase a SOS offering

@note: This method delete the offering (temporary offering cannot be deleted!)

The POST must be in Json format with mandatory service key

>>> {
        "service" : "service_name"
    } 
executeGet()

Method for executing a GET requests that return a list of offerings details

The data is returned in this format:

>>> {
        "total": 1,
        "success": true,
        "message": "Offerings details data loaded correctly",
        "data": [
            {
                "name": "temporary",
                "description": "descrizione 1",
                "procedures": 31,
                "expiration": "31.01.2012",
                "active": true
            },{...}
        ]
    }
executePost(db=True)

Method for executing a POST requests that initialize a new SOS service

@note: This method creates a new istSOS offering

The POST must be in Json format with mandatory offering key:

>>> {
        "offering" : "meteorology", 
        "description" : "meteo information"
        "expiration" : "2012-12-30T12:00"
        "active" : "sos_db"
    } 
executePut()

Method for executing a PUT requests that rename a SOS service

@note: This method renames:
  1. create a new service folder,
  2. copy content from old to new service configuration file
  3. rename the databse schema
  4. delete old service files

The POST must be in Json format with mandatory service key

>>> {
        "service" : "service_name"
    } 

observedproperties

class walib.istsos.services.observedproperties.observedproperties.waObservedproperties(waEnviron)

Bases: walib.resource.waResourceService

class to handle SOS service objects, support GET and POST method

executeDelete()

Method for executing a DELETE requests that remove an existing SOS observed property

executeGet()
executePost()

Method for executing a POST requests that create a new SOS observed property

executePut()

Method for executing a POST requests that create a new SOS observed property