walib.istsos.services package

Subpackages

Submodules

walib.istsos.services.services module

walib.istsos.services.services.parse_and_get_ns(file)
class walib.istsos.services.services.waGetobservation(waEnviron)

Bases: walib.resource.waResourceService

class to handle SOS observations, support only the GET method

executeGet()

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

Note

This method return a Json object with ObservationCollection members

The response is:

>>> {
        "message" : "abcderfghilmnopqrstuvz",
        "total": 4,
        "data" : [
            {
                "samplingTime": {...},
                "featureOfInterest": {...},
                "observedProperty": {...},
                "result": {...},
                "procedure": {...}
            },{
                "samplingTime": {...},
                "featureOfInterest": {...},
                "observedProperty": {...},
                "result": {...},
                "procedure": {...}
            },...
        ],
        "success": true
    }
class walib.istsos.services.services.waInsertobservation(waEnviron)

Bases: walib.resource.waResourceService

class to handle SOS observations, support only the GET method

executePost()

Method for executing a POST requests that insert new observations into a SOS procedure

Note

The POST data shall be in JSON format as following:

>>> {
    "ForceInsert" : "true",
    "Observation" : {
        "procedure": "urn:ogc:object:procedure:x-istsos:1.01.0:P_TRE",
        "AssignedSensorId" : "247df84cf4a0c2ebc632d08318d00cb3",
                    "samplingTime": {
                            "beginPosition": "2012-01-01T13:00:00+01:00",
                            "endPosition": "2012-01-01T17:00:00+01:00"
                    },
                    "observedProperty": {
                            "CompositePhenomenon": {
                                    "id": "comp_126",
                                    "dimension": "2"
                            },
                            "component": [
                                    "urn:ogc:def:parameter:x-istsos:1.01.0:time:iso8601",
                                    "urn:ogc:def:parameter:x-istsos:1.0:meteo:air:rainfall"
                            ]
                    },
                    "featureOfInterest": {
                            "geom": "<gml:Point srsName='EPSG:21781'><gml:coordinates>717900,98520,342</gml:coordinates></gml:Point>",
                            "name": "urn:ogc:object:feature:x-istsos:1.01.0:station:Trevano"
                    },
                    "result": {
                            "DataArray": {
                                    "elementCount": "2",
                                    "values": [
                                            [
                                                    "22012-01-01T14:00:00+01:00",
                                                    "10.000000"
                                            ],
                                            [
                                                    "2012-01-01T15:00:00+01:00",
                                                    "20.000000"
                                            ]
                                    ],
                                    "field": [
                                            {
                                                    "definition": "urn:ogc:def:parameter:x-istsos:1.01.0:time:iso8601",
                                                    "name": "Time"
                                            },
                                            {
                                                    "definition": "urn:ogc:def:parameter:x-istsos:1.0:meteo:air:rainfall",
                                                    "name": "air-rainfall",
                                                    "uom": "mm"
                                            }
                                    ]
                            }
                    }
            }
        }
class walib.istsos.services.services.waServices(waEnviron)

Bases: walib.resource.waResourceAdmin

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

executeDelete()

Method for executing a DELETE requests that erase a SOS service

Note

This method delete: 1. service folder, 2. service configuration file 3. C{sensorML} folder 4. C{virtual procedures} folder 5. a new schema with the same name of your service 6. istSOS tables and relations in the new schema

The POST must be in Json format with mandatory service key

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

Method for executing a GET requests that rename a SOS service

Note

This method renames: 1. service folder, 2. service configuration file 3. the databse schema

The POST must be in Json format with mandatory service key

>>> {
        "service" : "service_name"
    }
executePost(db=True)

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

Note

This method creates: 1. service folder, 2. service configuration file 3. C{sensorML} folder 4. C{virtual procedures} folder 5. a new schema with the same name of your service 6. istSOS tables and relations in the new schema

The POST must be in Json format with mandatory service key, if databease keys are not provided the server default connection are used:

>>> {
        "service" : "service_name",
        "user" : "pinco"
        "password" : "pallino"
        "dbname" : "sos_db"
        "host" : "10.7.5.3"
        "port" : "5432"
    }
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"
    }

Module contents

istSOS
Download istSOS

Table Of Contents

Previous topic

walib.istsos package

Next topic

walib.istsos.services.configsections package

This Page