walib.istsos.services.offerings package

Submodules

walib.istsos.services.offerings.offerings module

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"
    }

Module contents