Esempio n. 1
0
 def executePut(self):
     import json
     for section in self.json:
         if section == "connection":
             from walib.istsos.services.configsections import connection
             self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
             sect = connection.waConnection(self.waEnviron)
             sect.executePut()
         if section == "identification":
             from walib.istsos.services.configsections import identification
             self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
             sect = identification.waIdentification(self.waEnviron)
             sect.executePut()
         if section == "geo":
             from walib.istsos.services.configsections import geo
             self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
             sect = geo.waGeo(self.waEnviron)
             sect.executePut() 
         if section == "getobservation":
             from walib.istsos.services.configsections import getobservation
             self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
             sect = getobservation.waGetobservation(self.waEnviron)
             sect.executePut()
         if section == "provider":
             from walib.istsos.services.configsections import provider
             self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
             sect = provider.waProvider(self.waEnviron)
             sect.executePut()
         if section == "serviceurl":
             from walib.istsos.services.configsections import serviceurl
             self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
             sect = serviceurl.waServiceurl(self.waEnviron)
             sect.executePut()                
     
     self.setMessage("Configuration Sections successfully updated")
Esempio n. 2
0
 def executeGet(self):
     data = {}
     for section in self.serviceconf.sections:
         if section == "connection":
             from walib.istsos.services.configsections import connection
             sect = connection.waConnection(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "identification":
             from walib.istsos.services.configsections import identification
             sect = identification.waIdentification(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "geo":
             from walib.istsos.services.configsections import geo
             sect = geo.waGeo(self.waEnviron)
             data[section] = sect.executeGet() 
         if section == "getobservation":
             from walib.istsos.services.configsections import getobservation
             sect = getobservation.waGetobservation(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "provider":
             from walib.istsos.services.configsections import provider
             sect = provider.waProvider(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "serviceurl":
             from walib.istsos.services.configsections import serviceurl
             sect = serviceurl.waServiceurl(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "urn":
             from walib.istsos.services.configsections import urn
             sect = urn.waUrn(self.waEnviron)
             data[section] = sect.executeGet()
     self.setData(data)
     self.setMessage("List of sections successfully returned")
Esempio n. 3
0
    def executePut(self):
        import json
        for section in self.json:
            if section == "connection":
                from walib.istsos.services.configsections import connection
                self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
                sect = connection.waConnection(self.waEnviron)
                sect.executePut()
            if section == "identification":
                from walib.istsos.services.configsections import identification
                self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
                sect = identification.waIdentification(self.waEnviron)
                sect.executePut()
            if section == "geo":
                from walib.istsos.services.configsections import geo
                self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
                sect = geo.waGeo(self.waEnviron)
                sect.executePut()
            if section == "getobservation":
                from walib.istsos.services.configsections import getobservation
                self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
                sect = getobservation.waGetobservation(self.waEnviron)
                sect.executePut()
            if section == "provider":
                from walib.istsos.services.configsections import provider
                self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
                sect = provider.waProvider(self.waEnviron)
                sect.executePut()
            if section == "serviceurl":
                from walib.istsos.services.configsections import serviceurl
                self.waEnviron['wsgi_input'] = json.dumps(self.json[section])
                sect = serviceurl.waServiceurl(self.waEnviron)
                sect.executePut()

        self.setMessage("Configuration Sections successfully updated")
Esempio n. 4
0
 def executeGet(self):
     data = {}
     for section in self.serviceconf.sections:
         if section == "connection":
             from walib.istsos.services.configsections import connection
             sect = connection.waConnection(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "identification":
             from walib.istsos.services.configsections import identification
             sect = identification.waIdentification(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "geo":
             from walib.istsos.services.configsections import geo
             sect = geo.waGeo(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "getobservation":
             from walib.istsos.services.configsections import getobservation
             sect = getobservation.waGetobservation(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "provider":
             from walib.istsos.services.configsections import provider
             sect = provider.waProvider(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "serviceurl":
             from walib.istsos.services.configsections import serviceurl
             sect = serviceurl.waServiceurl(self.waEnviron)
             data[section] = sect.executeGet()
         if section == "urn":
             from walib.istsos.services.configsections import urn
             sect = urn.waUrn(self.waEnviron)
             data[section] = sect.executeGet()
     self.setData(data)
     self.setMessage("List of sections successfully returned")
Esempio n. 5
0
def initResource(waEnviron):
    path = waEnviron['path']
    # ---------------
    # Entering istsos
    # ---------------
    pathinfo = copy.deepcopy(waEnviron['pathinfo'])
    resource = pathinfo.pop(0)

    if resource == "istsos":
        '''if 'user' in waEnviron and not waEnviron['user'].isAdmin():
            from walib import users
            return users.waUserUnauthorized(waEnviron)'''

        resource = pathinfo.pop(0)

        # --------------------------
        # Entering istsos.operations
        # --------------------------
        if resource == "operations":
            resource = pathinfo.pop(0)

            if resource == "status":
                from walib.istsos import istsos
                return istsos.waStatus(waEnviron)
            elif resource == "log":
                from walib.istsos import istsos
                return istsos.waLog(waEnviron)
            elif resource == "about":
                from walib.istsos import istsos
                return istsos.waAbout(waEnviron)
            elif resource == "validatedb":
                from walib.istsos import istsos
                return istsos.waValidatedb(waEnviron)
            ''' checking if not need any more
            elif resource == "initialization":
                from walib.istsos import istsos
                return istsos.waInitialization(waEnviron)'''

        # --------------------------
        # Entering istsos.services
        # --------------------------
        elif resource == "services":

            if len(pathinfo) <= 1:
                from walib.istsos.services import services
                return services.waServices(waEnviron)
            else:
                pathinfo.pop(0)
                resource = pathinfo.pop(0)

                # Entering istsos.services.configsections
                if resource == "configsections":

                    if len(pathinfo) == 0:
                        from walib.istsos.services.configsections import configsections
                        return configsections.waConfigsections(waEnviron)
                    else:
                        resource = pathinfo.pop(0)
                        if resource == "connection":
                            if len(pathinfo) == 0:
                                from walib.istsos.services.configsections import connection
                                return connection.waConnection(waEnviron)
                            else:
                                resource = pathinfo.pop(0)
                                if resource == "operations":
                                    resource = pathinfo.pop(0)
                                    if resource == "validatedb":
                                        from walib.istsos.services.configsections import connection
                                        return connection.waValidatedb(
                                            waEnviron)

                        elif resource == "getobservation":
                            from walib.istsos.services.configsections import getobservation
                            return getobservation.waGetobservation(waEnviron)

                        elif resource == "paths":
                            from walib.istsos.services.configsections import paths
                            return paths.waPaths(waEnviron)

                        elif resource == "authority":
                            from walib.istsos.services.configsections import authority
                            return authority.waAuthority(waEnviron)

                        elif resource == "identification":
                            from walib.istsos.services.configsections import identification
                            return identification.waIdentification(waEnviron)

                        elif resource == "geo":
                            from walib.istsos.services.configsections import geo
                            return geo.waGeo(waEnviron)

                        elif resource == "serviceurl":
                            from walib.istsos.services.configsections import serviceurl
                            return serviceurl.waServiceurl(waEnviron)

                        elif resource == "provider":
                            from walib.istsos.services.configsections import provider
                            return provider.waProvider(waEnviron)

                        elif resource == "urn":
                            from walib.istsos.services.configsections import urn
                            return urn.waUrn(waEnviron)

                        elif resource == "mqtt":
                            from walib.istsos.services.configsections import mqtt
                            return mqtt.waMqtt(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.dataqualities
                # ---------------------------------------
                elif resource == "dataqualities":
                    from walib.istsos.services.dataqualities import dataqualities
                    return dataqualities.waDataqualities(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.specimens
                # ---------------------------------------
                elif resource == "specimens":
                    from walib.istsos.services.specimens import specimens
                    return specimens.waSpecimens(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.procedures
                # ---------------------------------------
                elif resource == "procedures":

                    if len(pathinfo) <= 1:
                        from walib.istsos.services.procedures import procedures
                        return procedures.waProcedures(waEnviron)

                    else:
                        resource = pathinfo.pop(0)

                        if resource == 'operations':
                            resource = pathinfo.pop(0)

                            if resource == "getlist":
                                from walib.istsos.services.procedures import procedures
                                return procedures.waGetlist(waEnviron)

                            elif resource == "geojson":
                                from walib.istsos.services.procedures import procedures
                                return procedures.waGetGeoJson(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.virtualprocedures
                # ---------------------------------------
                elif resource == "virtualprocedures":

                    if len(pathinfo) <= 1:
                        from walib.istsos.services.virtualprocedures import virtualprocedures
                        return virtualprocedures.waVirtualProcedures(waEnviron)

                    else:
                        resource = pathinfo.pop(0)

                        if resource == "operations":
                            resource = pathinfo.pop(0)
                            if resource == "getlist":
                                from walib.istsos.services.virtualprocedures import virtualprocedures
                                return virtualprocedures.waGetlist(waEnviron)

                        resource = pathinfo.pop(0)

                        if resource == 'code':
                            from walib.istsos.services.virtualprocedures import code
                            return code.waCode(waEnviron)

                        elif resource == 'ratingcurve':
                            from walib.istsos.services.virtualprocedures import ratingcurve
                            return ratingcurve.waRatingcurves(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.observedproperties
                # ---------------------------------------
                elif resource == "observedproperties":
                    from walib.istsos.services.observedproperties import observedproperties
                    return observedproperties.waObservedproperties(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.uoms
                # ---------------------------------------
                elif resource == "uoms":
                    from walib.istsos.services.uoms import uoms
                    return uoms.waUoms(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.epsgs
                # ---------------------------------------
                elif resource == "epsgs":
                    from walib.istsos.services.epsgs import epsgs
                    return epsgs.waEpsgs(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.epsgs
                # ---------------------------------------
                elif resource == "systemtypes":
                    from walib.istsos.services.systemtypes import systemtypes
                    return systemtypes.waSystemTypes(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.offerings
                # ---------------------------------------
                elif resource == "offerings":

                    if len(pathinfo) <= 1:
                        from walib.istsos.services.offerings import offerings
                        return offerings.waOfferings(waEnviron)
                    else:
                        resource = pathinfo.pop(0)  # remove offering name

                        if resource == "operations":
                            resource = pathinfo.pop(0)
                            if resource == "getlist":
                                from walib.istsos.services.offerings import offerings
                                return offerings.waGetlist(waEnviron)
                        else:
                            resource = pathinfo.pop(0)
                            if resource == "procedures":
                                if len(pathinfo) <= 1:
                                    from walib.istsos.services.offerings.procedures import procedures
                                    return procedures.waProcedures(waEnviron)
                                else:
                                    resource = pathinfo.pop(0)
                                    if resource == "operations":
                                        resource = pathinfo.pop(0)
                                        if resource == "memberslist":
                                            from walib.istsos.services.offerings.procedures import procedures
                                            return procedures.waMemberslist(
                                                waEnviron)
                                        elif resource == "nonmemberslist":
                                            from walib.istsos.services.offerings.procedures import procedures
                                            return procedures.waNonmemberslist(
                                                waEnviron)

                # ---------------------------------------
                # Entering istsos.services.operations
                # ---------------------------------------
                elif resource == "operations":
                    resource = pathinfo.pop(0)
                    if resource == "getobservation":
                        from walib.istsos.services import services
                        return services.waGetobservation(waEnviron)
                    elif resource == "insertobservation":
                        from walib.istsos.services import services
                        return services.waInsertobservation(waEnviron)
                    elif resource == "fastinsert":
                        from walib.istsos.services import services
                        return services.waFastInsert(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.logs
                # ---------------------------------------
                elif resource == "logs":
                    from walib.istsos.services.logs import logs
                    return logs.waLogs(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.status
                # ---------------------------------------
                elif resource == "status":
                    from walib.istsos.services.status import status
                    return status.waStatus(waEnviron)

    elif resource == "user":
        from walib import users
        return users.waUsers(waEnviron)

    raise Exception("Resource is not identified, check the URL")
Esempio n. 6
0
def initResource(waEnviron):
    path = waEnviron['path']
    # ---------------
    # Entering istsos
    # ---------------
    pathinfo = copy.deepcopy(waEnviron['pathinfo'])
    resource = pathinfo.pop(0)
    #print >> sys.stderr, resource
    
    if resource == "istsos":
        
        resource = pathinfo.pop(0)
        
        # --------------------------
        # Entering istsos.operations
        # -------------------------- 
        if resource == "operations":
            resource = pathinfo.pop(0)
            
            if resource == "status":
                from walib.istsos import istsos
                return istsos.waStatus(waEnviron)
            elif resource == "log":
                from walib.istsos import istsos
                return istsos.waLog(waEnviron)
            elif resource == "about":
                from walib.istsos import istsos
                return istsos.waAbout(waEnviron)
            elif resource == "validatedb":
                from walib.istsos import istsos
                return istsos.waValidatedb(waEnviron)
            elif resource == "initialization":
                from walib.istsos import istsos
                return istsos.waInitialization(waEnviron)
        
        # --------------------------
        # Entering istsos.services
        # -------------------------- 
        elif resource == "services":
            #print >> sys.stderr, resource
            
            if len(pathinfo)<=1:
                from walib.istsos.services import services
                return services.waServices(waEnviron)
            else:
                pathinfo.pop(0) #print >> sys.stderr, pathinfo.pop(0)  # remove service name
                resource = pathinfo.pop(0)
                
                # ---------------------------------------
                # Entering istsos.services.configsections
                # ---------------------------------------
                if resource == "configsections":
                    #print >> sys.stderr, resource
                    
                    if len(pathinfo)==0:
                        from walib.istsos.services.configsections import configsections
                        return configsections.waConfigsections(waEnviron)
                    else:
                        resource = pathinfo.pop(0)
                        #print >> sys.stderr, resource
                        if resource == "connection":
                            if len(pathinfo)==0:
                                from walib.istsos.services.configsections import connection
                                return connection.waConnection(waEnviron)
                            else:
                                resource = pathinfo.pop(0)
                                #print >> sys.stderr, resource
                                if resource == "operations":
                                    resource = pathinfo.pop(0)
                                    #print >> sys.stderr, resource
                                    if resource == "validatedb":
                                        from walib.istsos.services.configsections import connection
                                        return connection.waValidatedb(waEnviron)
                                
                        elif resource == "getobservation":
                            from walib.istsos.services.configsections import getobservation
                            return getobservation.waGetobservation(waEnviron)
                        elif resource == "paths":
                            from walib.istsos.services.configsections import paths
                            return paths.waPaths(waEnviron)
                        elif resource == "authority":
                            from walib.istsos.services.configsections import authority
                            return authority.waAuthority(waEnviron)
                        elif resource == "identification":
                            from walib.istsos.services.configsections import identification
                            return identification.waIdentification(waEnviron)
                        elif resource == "geo":
                            from walib.istsos.services.configsections import geo
                            return geo.waGeo(waEnviron)
                        elif resource == "serviceurl":
                            from walib.istsos.services.configsections import serviceurl
                            return serviceurl.waServiceurl(waEnviron)
                        elif resource == "provider":
                            from walib.istsos.services.configsections import provider
                            return provider.waProvider(waEnviron)
                        elif resource == "urn":
                            from walib.istsos.services.configsections import urn
                            return urn.waUrn(waEnviron)
                
                # ---------------------------------------
                # Entering istsos.services.dataqualities
                # ---------------------------------------
                elif resource == "dataqualities":
                    #print >> sys.stderr, resource
                    from walib.istsos.services.dataqualities import dataqualities
                    return dataqualities.waDataqualities(waEnviron)
                
                # ---------------------------------------
                # Entering istsos.services.procedures
                # ---------------------------------------
                elif resource == "procedures":
                    #print >> sys.stderr, resource
                    
                    if len(pathinfo)<=1:
                        from walib.istsos.services.procedures import procedures
                        return procedures.waProcedures(waEnviron)
                                        
                    else:
                        
                        resource = pathinfo.pop(0)
                        #print >> sys.stderr, resource
                        
                        if resource == 'operations':
                            resource = pathinfo.pop(0)
                            #print >> sys.stderr, resource
                            
                            if resource == "getlist":
                                from walib.istsos.services.procedures import procedures
                                return procedures.waGetlist(waEnviron)
                            
                            elif resource == "geojson":
                                from walib.istsos.services.procedures import procedures
                                return procedures.waGetGeoJson(waEnviron)
                        
                # ---------------------------------------
                # Entering istsos.services.virtualprocedures
                # ---------------------------------------
                elif resource == "virtualprocedures":
                    #print >> sys.stderr, resource
                    
                    if len(pathinfo)<=1:
                        from walib.istsos.services.virtualprocedures import virtualprocedures
                        return virtualprocedures.waVirtualProcedures(waEnviron)
                                        
                    else:
                        resource = pathinfo.pop(0)
                        #print >> sys.stderr, resource

                        if resource == "operations":
                            #print >> sys.stderr, resource              
                            resource = pathinfo.pop(0)    
                            if resource == "getlist":  
                                #print >> sys.stderr, resource     
                                from walib.istsos.services.virtualprocedures import virtualprocedures
                                return virtualprocedures.waGetlist(waEnviron)
                                
                        resource = pathinfo.pop(0)
                        #print >> sys.stderr, resource
                        
                        if resource == 'code':
                            #print >> sys.stderr, resource
                            from walib.istsos.services.virtualprocedures import code
                            return code.waCode(waEnviron)
                            
                        elif resource == 'ratingcurve':
                            #print >> sys.stderr, resource
                            from walib.istsos.services.virtualprocedures import ratingcurve
                            return ratingcurve.waRatingcurves(waEnviron)
                            
                # ---------------------------------------
                # Entering istsos.services.observedproperties
                # ---------------------------------------
                elif resource == "observedproperties":
                    #print >> sys.stderr, resource
                    from walib.istsos.services.observedproperties import observedproperties
                    return observedproperties.waObservedproperties(waEnviron)
                    
                # ---------------------------------------
                # Entering istsos.services.uoms
                # ---------------------------------------
                elif resource == "uoms":
                    #print >> sys.stderr, resource
                    from walib.istsos.services.uoms import uoms
                    return uoms.waUoms(waEnviron)
                
                # ---------------------------------------
                # Entering istsos.services.epsgs
                # ---------------------------------------
                elif resource == "epsgs":
                    #print >> sys.stderr, resource
                    from walib.istsos.services.epsgs import epsgs
                    return epsgs.waEpsgs(waEnviron)
                    
                # ---------------------------------------
                # Entering istsos.services.epsgs
                # ---------------------------------------
                elif resource == "systemtypes":
                    #print >> sys.stderr, resource
                    from walib.istsos.services.systemtypes import systemtypes
                    return systemtypes.waSystemTypes(waEnviron)
                
                
                # ---------------------------------------
                # Entering istsos.services.offerings
                # ---------------------------------------
                elif resource == "offerings":
                    #print >> sys.stderr, resource
                    
                    if len(pathinfo)<=1:
                        from walib.istsos.services.offerings import offerings
                        return offerings.waOfferings(waEnviron)
                    else:
                        resource = pathinfo.pop(0) # remove offering name
                        #print >> sys.stderr, resource
                        
                        if resource == "operations":
                            resource = pathinfo.pop(0)
                            if resource == "getlist":
                                #print >> sys.stderr, resource
                                from walib.istsos.services.offerings import offerings
                                return offerings.waGetlist(waEnviron)
                        else:
                            resource = pathinfo.pop(0)
                            if resource == "procedures":
                                if len(pathinfo)<=1:
                                    from walib.istsos.services.offerings.procedures import procedures
                                    return procedures.waProcedures(waEnviron)
                                else:
                                    resource = pathinfo.pop(0)
                                    if resource == "operations":
                                        #print >> sys.stderr, resource
                                        resource = pathinfo.pop(0)
                                        if resource == "memberslist":
                                            from walib.istsos.services.offerings.procedures import procedures
                                            return procedures.waMemberslist(waEnviron)
                                        elif resource == "nonmemberslist":
                                            from walib.istsos.services.offerings.procedures import procedures
                                            return procedures.waNonmemberslist(waEnviron)
                          
                # ---------------------------------------
                # Entering istsos.services.operations
                # ---------------------------------------
                elif resource == "operations":
                    #print >> sys.stderr, resource              
                    resource = pathinfo.pop(0)    
                    if resource == "getobservation":  
                        #print >> sys.stderr, resource     
                        from walib.istsos.services import services
                        return services.waGetobservation(waEnviron)
                    elif resource == "insertobservation":
                        #print >> sys.stderr, resource     
                        from walib.istsos.services import services
                        return services.waInsertobservation(waEnviron)
                        
                # ---------------------------------------
                # Entering istsos.services.logs
                # ---------------------------------------        
                elif resource == "logs":
                    from walib.istsos.services.logs import logs
                    return logs.waLogs(waEnviron)
                
                # ---------------------------------------
                # Entering istsos.services.status
                # ---------------------------------------
                elif resource == "status":
                    from walib.istsos.services.status import status
                    return status.waStatus(waEnviron)
                                   
    raise Exception("Resource is not identified, check the URL")
Esempio n. 7
0
def initResource(waEnviron):
    path = waEnviron['path']
    # ---------------
    # Entering istsos
    # ---------------
    pathinfo = copy.deepcopy(waEnviron['pathinfo'])
    resource = pathinfo.pop(0)
    print >> sys.stderr, pathinfo

    if resource == "istsos":
        '''if 'user' in waEnviron and not waEnviron['user'].isAdmin():
            from walib import users
            return users.waUserUnauthorized(waEnviron)'''

        resource = pathinfo.pop(0)

        # --------------------------
        # Entering istsos.operations
        # --------------------------
        if resource == "operations":
            resource = pathinfo.pop(0)

            if resource == "status":
                from walib.istsos import istsos
                return istsos.waStatus(waEnviron)
            elif resource == "log":
                from walib.istsos import istsos
                return istsos.waLog(waEnviron)
            elif resource == "about":
                from walib.istsos import istsos
                return istsos.waAbout(waEnviron)
            elif resource == "validatedb":
                from walib.istsos import istsos
                return istsos.waValidatedb(waEnviron)

            # ---------------------------------------
            # Entering istsos.operation.oat
            # ---------------------------------------
            elif resource == "oat":
                resource = pathinfo.pop(0)

                if resource == "resample":
                    from walib.OAT import ProcessThread
                    return ProcessThread.resamplingData(waEnviron)
                elif resource == "digitalfilter":
                    from walib.OAT import ProcessThread
                    return ProcessThread.DigitalThread(waEnviron)
                elif resource == "exceedance":
                    from walib.OAT import ProcessThread
                    return ProcessThread.ExceedanceData(waEnviron)
                elif resource == "he":
                    from walib.OAT import ProcessThread
                    return ProcessThread.HydroEventsTh(waEnviron)
                elif resource == "hi":
                    from walib.OAT import ProcessThread
                    return ProcessThread.HydroIndices(waEnviron)
                elif resource == "qualitymethod":
                    from walib.OAT import ProcessThread
                    return ProcessThread.QualityMethod(waEnviron)
                elif resource == "datavalue":
                    from walib.OAT import ProcessThread
                    return ProcessThread.DataValuesMethod(waEnviron)
                elif resource == "hysap":
                    from walib.OAT import ProcessThread
                    return ProcessThread.HydroSeparationTh(waEnviron)
                elif resource == "intgrate":
                    from walib.OAT import ProcessThread
                    return ProcessThread.IntegrateMethod(waEnviron)
                elif resource == "compare":
                    from walib.OAT import ProcessThread
                    return ProcessThread.regularization(waEnviron)
                elif resource == "subtract":
                    from walib.OAT import ProcessThread
                    return ProcessThread.regularization(waEnviron)
                elif resource == "fill":
                    from walib.OAT import ProcessThread
                    return ProcessThread.fillMethod(waEnviron)
                elif resource == "statistics":
                    from walib.OAT import ProcessThread
                    return ProcessThread.Statisticsmethod(waEnviron)
                elif resource == "hargreaves":
                    from walib.OAT import ProcessThread
                    return ProcessThread.Hargreaves(waEnviron)
            ''' checking if not need any more
            elif resource == "initialization":
                from walib.istsos import istsos
                return istsos.waInitialization(waEnviron)'''

        # --------------------------
        # Entering istsos.services
        # --------------------------
        elif resource == "services":
            #print >> sys.stderr, resource

            if len(pathinfo) <= 1:
                from walib.istsos.services import services
                return services.waServices(waEnviron)
            else:
                pathinfo.pop(0)
                resource = pathinfo.pop(0)

                # Entering istsos.services.configsections
                if resource == "configsections":
                    #print >> sys.stderr, resource

                    if len(pathinfo) == 0:
                        from walib.istsos.services.configsections import configsections
                        return configsections.waConfigsections(waEnviron)
                    else:
                        resource = pathinfo.pop(0)
                        #print >> sys.stderr, resource
                        if resource == "connection":
                            if len(pathinfo) == 0:
                                from walib.istsos.services.configsections import connection
                                return connection.waConnection(waEnviron)
                            else:
                                resource = pathinfo.pop(0)
                                #print >> sys.stderr, resource
                                if resource == "operations":
                                    resource = pathinfo.pop(0)
                                    #print >> sys.stderr, resource
                                    if resource == "validatedb":
                                        from walib.istsos.services.configsections import connection
                                        return connection.waValidatedb(
                                            waEnviron)

                        elif resource == "getobservation":
                            from walib.istsos.services.configsections import getobservation
                            return getobservation.waGetobservation(waEnviron)
                        elif resource == "paths":
                            from walib.istsos.services.configsections import paths
                            return paths.waPaths(waEnviron)
                        elif resource == "authority":
                            from walib.istsos.services.configsections import authority
                            return authority.waAuthority(waEnviron)
                        elif resource == "identification":
                            from walib.istsos.services.configsections import identification
                            return identification.waIdentification(waEnviron)
                        elif resource == "geo":
                            from walib.istsos.services.configsections import geo
                            return geo.waGeo(waEnviron)
                        elif resource == "serviceurl":
                            from walib.istsos.services.configsections import serviceurl
                            return serviceurl.waServiceurl(waEnviron)
                        elif resource == "provider":
                            from walib.istsos.services.configsections import provider
                            return provider.waProvider(waEnviron)
                        elif resource == "urn":
                            from walib.istsos.services.configsections import urn
                            return urn.waUrn(waEnviron)
                        elif resource == "mqtt":
                            from walib.istsos.services.configsections import mqtt
                            return mqtt.waMqtt(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.dataqualities
                # ---------------------------------------
                elif resource == "dataqualities":
                    #print >> sys.stderr, resource
                    from walib.istsos.services.dataqualities import dataqualities
                    return dataqualities.waDataqualities(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.procedures
                # ---------------------------------------
                elif resource == "procedures":
                    #print >> sys.stderr, resource

                    if len(pathinfo) <= 1:
                        from walib.istsos.services.procedures import procedures
                        return procedures.waProcedures(waEnviron)

                    else:

                        resource = pathinfo.pop(0)
                        #print >> sys.stderr, resource

                        if resource == 'operations':
                            resource = pathinfo.pop(0)
                            #print >> sys.stderr, resource

                            if resource == "getlist":
                                from walib.istsos.services.procedures import procedures
                                return procedures.waGetlist(waEnviron)

                            elif resource == "geojson":
                                from walib.istsos.services.procedures import procedures
                                return procedures.waGetGeoJson(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.virtualprocedures
                # ---------------------------------------
                elif resource == "virtualprocedures":
                    #print >> sys.stderr, resource

                    if len(pathinfo) <= 1:
                        from walib.istsos.services.virtualprocedures import virtualprocedures
                        return virtualprocedures.waVirtualProcedures(waEnviron)

                    else:
                        resource = pathinfo.pop(0)
                        #print >> sys.stderr, resource

                        if resource == "operations":
                            #print >> sys.stderr, resource
                            resource = pathinfo.pop(0)
                            if resource == "getlist":
                                #print >> sys.stderr, resource
                                from walib.istsos.services.virtualprocedures import virtualprocedures
                                return virtualprocedures.waGetlist(waEnviron)

                        resource = pathinfo.pop(0)
                        #print >> sys.stderr, resource

                        if resource == 'code':
                            #print >> sys.stderr, resource
                            from walib.istsos.services.virtualprocedures import code
                            return code.waCode(waEnviron)

                        elif resource == 'ratingcurve':
                            #print >> sys.stderr, resource
                            from walib.istsos.services.virtualprocedures import ratingcurve
                            return ratingcurve.waRatingcurves(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.observedproperties
                # ---------------------------------------
                elif resource == "observedproperties":
                    #print >> sys.stderr, resource
                    from walib.istsos.services.observedproperties import observedproperties
                    return observedproperties.waObservedproperties(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.uoms
                # ---------------------------------------
                elif resource == "uoms":
                    #print >> sys.stderr, resource
                    from walib.istsos.services.uoms import uoms
                    return uoms.waUoms(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.epsgs
                # ---------------------------------------
                elif resource == "epsgs":
                    #print >> sys.stderr, resource
                    from walib.istsos.services.epsgs import epsgs
                    return epsgs.waEpsgs(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.epsgs
                # ---------------------------------------
                elif resource == "systemtypes":
                    #print >> sys.stderr, resource
                    from walib.istsos.services.systemtypes import systemtypes
                    return systemtypes.waSystemTypes(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.offerings
                # ---------------------------------------
                elif resource == "offerings":
                    #print >> sys.stderr, resource

                    if len(pathinfo) <= 1:
                        from walib.istsos.services.offerings import offerings
                        return offerings.waOfferings(waEnviron)
                    else:
                        resource = pathinfo.pop(0)  # remove offering name
                        #print >> sys.stderr, resource

                        if resource == "operations":
                            resource = pathinfo.pop(0)
                            if resource == "getlist":
                                #print >> sys.stderr, resource
                                from walib.istsos.services.offerings import offerings
                                return offerings.waGetlist(waEnviron)
                        else:
                            resource = pathinfo.pop(0)
                            if resource == "procedures":
                                if len(pathinfo) <= 1:
                                    from walib.istsos.services.offerings.procedures import procedures
                                    return procedures.waProcedures(waEnviron)
                                else:
                                    resource = pathinfo.pop(0)
                                    if resource == "operations":
                                        #print >> sys.stderr, resource
                                        resource = pathinfo.pop(0)
                                        if resource == "memberslist":
                                            from walib.istsos.services.offerings.procedures import procedures
                                            return procedures.waMemberslist(
                                                waEnviron)
                                        elif resource == "nonmemberslist":
                                            from walib.istsos.services.offerings.procedures import procedures
                                            return procedures.waNonmemberslist(
                                                waEnviron)

                # ---------------------------------------
                # Entering istsos.services.operations
                # ---------------------------------------
                elif resource == "operations":
                    #print >> sys.stderr, resource
                    resource = pathinfo.pop(0)
                    if resource == "getobservation":
                        from walib.istsos.services import services
                        return services.waGetobservation(waEnviron)
                    elif resource == "insertobservation":
                        #print >> sys.stderr, resource
                        from walib.istsos.services import services
                        return services.waInsertobservation(waEnviron)
                    elif resource == "fastinsert":
                        print >> sys.stderr, resource
                        from walib.istsos.services import services
                        return services.waFastInsert(waEnviron)
                    elif resource == "seeobservation":
                        from walib.istsos.services import services
                        return services.waGetobservation(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.logs
                # ---------------------------------------
                elif resource == "logs":
                    from walib.istsos.services.logs import logs
                    return logs.waLogs(waEnviron)

                # ---------------------------------------
                # Entering istsos.services.status
                # ---------------------------------------
                elif resource == "status":
                    from walib.istsos.services.status import status
                    return status.waStatus(waEnviron)

    elif resource == "oat":
        from walib.istsos.services import services
        print >> sys.stderr, resource
        return services.resampling(waEnviron)

    elif resource == "user":
        from walib import users
        return users.waUsers(waEnviron)

    raise Exception("Resource is not identified, check the URL")