def __init__(self, location):
     self._baseUrl = "http://localhost:5984"  # CouchDB
     self._dbconn = DbConnection(baseUrl)
     self._xtss = ExecutorClient('localhost', 'msgq', 'xtss')
     self._mq = MqConnection('localhost', 'msgq')
     self._broker = RabbitMqMessageBroker()
     self.location = location
 def __init__(self):
     self.weblogsBaseUrl = "http://localhost:8000"
     self.baseUrl = "http://localhost:5984" # CouchDB
     self.dbconn  = DbConnection(self.baseUrl)
     self.dbName  = "pipeline-reports"
     self.xtss   = ExecutorClient('localhost', 'msgq', 'xtss')
     self.select = "pipeline.report.JAO"
     self.mq     = MqConnection('localhost', 'msgq',  select)
def writeMetadata(progID, ousUID, timestamp, dataProduct):
    # No error checking!
    dbcon = DbConnection(baseUrl)
    dbName = "products-metadata"
    metadata = {}
    metadata['progID'] = progID
    metadata['ousUID'] = ousUID
    metadata['timestamp'] = timestamp
    retcode, retmsg = dbcon.save(dbName, dataProduct, metadata)
    if retcode != 201:
        raise RuntimeError("setSubstate: error %d, %s" % (retcode, retmsg))
Beispiel #4
0
    def __init__(self, host, queueName, listenTo=None, sendTo=None):

        self.host = host
        self.queueName = queueName
        self.listenTo = None
        self.sendTo = None

        if listenTo != None:
            self.listenTo = listenTo
        if sendTo != None:
            self.sendTo = sendTo

        self.dbcon = DbConnection(baseUrl)
def writeDeliveryStatus(progID,
                        ousUID,
                        timestamp,
                        dataProducts,
                        complete=False):
    # No error checking!
    dbcon = DbConnection(baseUrl)
    dbName = "delivery-status"
    delStatus = {}
    delStatus['progID'] = progID
    delStatus['timestamp'] = timestamp
    delStatus['dataProducts'] = sorted(dataProducts)
    delStatus['complete'] = complete
    delStatus['ousUID'] = ousUID
    retcode, retmsg = dbcon.save(dbName, ousUID, delStatus)
    if retcode != 201:
        raise RuntimeError("setSubstate: error %d, %s" % (retcode, retmsg))
    if len(ouss) == 0:
        return None
    if retcode != 200:
        print(ouss)
        return None

    ouss.sort(key=lambda x: x['entityId'])
    return ouss


###################################################################
## Main program
###################################################################

baseUrl = "http://localhost:5984"  # CouchDB
dbconn = DbConnection(baseUrl)

parser = argparse.ArgumentParser(
    description='Data Reducer Assignment tool mockup')
parser.add_argument("--assign-to",
                    "-a",
                    dest="location",
                    help="Location where Pipeline jobs should run")
args = parser.parse_args()

location = args.location

# Make sure we know where we should assign Pipeline jobs
if location == None:
    location = os.environ.get('DRAWS_LOCATION')
    if location == None:
#!/usr/bin/env python3

from flask import Flask
import sys
sys.path.insert(0, "../../shared")
from dbcon import DbConnection
import json
from flask import Flask, request, send_from_directory

# TODO

app = Flask(__name__)

baseUrl = "http://127.0.0.1:5984"  # CouchDB
dbCon = DbConnection(baseUrl)
dbName = "status-entities"
states = [
    "FullyObserved", "ReadyForProcessing", "Processing", "ProcessingProblem",
    "ReadyForReview", "Reviewing", "Verified", "DeliveryInProgress",
    "Delivered"
]
htmlTemplate = """
	<!doctype html>
	<html>
		<head>
		  <meta http-equiv="refresh" content="1" >	<!-- Refresh every few secs -->
		  <title>Dashboard</title>
		  <style>
		  	body { font-family: Helvetica }
			th { text-align: left; }
			td { padding: 5px; }
Beispiel #8
0
 def __init__(self):
     self._baseUrl = "http://localhost:5984" # CouchDB
     self._dbcon = DbConnection(self._baseUrl)
     self._dbName = "status-entities"
     self._broker = RabbitMqMessageBroker()
     self._subscriber = Subscriber(self._broker, 'xtss.transitions', 'xtss')
Beispiel #9
0
 def __init__(self):
     self.baseUrl = "http://localhost:5984" # CouchDB
     self.dbconn  = DbConnection(self.baseUrl)
Beispiel #10
0
 def __init__( self ):
     self.dbName  = "ngas"
     self.dbcon = DbConnection( baseUrl )