Exemple #1
0
def list_jobs(request_handler, study_id, status=None):
    jobs = Study.get(id=study_id).jobs

    if status is not None:
        jobs = jobs.where(Job.status == status)

    return {'jobs': [j.uri for j in jobs]}
Exemple #2
0
def study_info(request_handler, study_id):
    study = Study.get(Study.id == study_id)

    return {
        'name': study.name,
        'description': study.description,
        'created': str(study.created)
    }
Exemple #3
0
def study_info(request_handler, study_id):
    study = Study.get(Study.id == study_id)

    return {
        'name': study.name,
        'description': study.description,
        'created': str(study.created)
    }
Exemple #4
0
def study_info(request_handler, study_id, name=None, description=None):
    study = Study.get(Study.id == study_id)
    if name is not None:
        study.name = name
    if description is not None:
        study.description = description
    study.save()

    return {}
Exemple #5
0
def list_jobs(request_handler, study_id, status=None):
    jobs = Study.get(id=study_id).jobs

    if status is not None:
        jobs = jobs.where(Job.status == status)

    return {
        'jobs': [j.uri for j in jobs]
    }
Exemple #6
0
def study_info(request_handler, study_id, name=None, description=None):
    study = Study.get(Study.id == study_id)
    if name is not None:
        study.name = name
    if description is not None:
        study.description = description
    study.save()

    return {}
Exemple #7
0
def create_artifact(request_handler, study_id, name, artifact_type):
    data = _get_file_data(request_handler.request)
    if data is None:
        raise ValueError("Cannot create artifact: missing uploaded file.")

    # TODO remove when using postgresql and foreign keys are actually supported
    study = Study.get(id=study_id)
    type_ = Type.get(uri=artifact_type)
    artifact = Artifact(type=type_, data=data, study=study)
    artifact.save()

    artifact_proxy = ArtifactProxy(name=name, artifact=artifact, study=study)
    artifact_proxy.save()

    return {}
Exemple #8
0
def create_artifact(request_handler, study_id, name, artifact_type):
    data = _get_file_data(request_handler.request)
    if data is None:
        raise ValueError("Cannot create artifact: missing uploaded file.")

    # TODO remove when using postgresql and foreign keys are actually supported
    study = Study.get(id=study_id)
    type_ = Type.get(uri=artifact_type)
    artifact = Artifact(type=type_, data=data, study=study)
    artifact.save()

    artifact_proxy = ArtifactProxy(name=name, artifact=artifact, study=study)
    artifact_proxy.save()

    return {}
Exemple #9
0
def list_artifacts(request_handler, study_id):
    artifacts = Study.get(id=study_id).artifacts

    return {'artifacts': [a.uri for a in artifacts]}
Exemple #10
0
def study_info(request_handler, study_id):
    study = Study.get(Study.id == study_id)
    study.delete_instance()  # TODO think about cascading deletes

    return {}
Exemple #11
0
def create_study(request_handler, name, description):
    study = Study(name=name, description=description)
    study.save()
    return {'study': study.uri}
Exemple #12
0
def create_study(request_handler, name, description):
    study = Study(name=name, description=description)
    study.save()
    return {
        'study': study.uri
    }
Exemple #13
0
def list_workflows(request_handler, study_id):
    workflows = Study.get(id=study_id).workflows

    return {
        'workflows': [w.uri for w in workflows]
    }
Exemple #14
0
def list_artifacts(request_handler, study_id):
    artifacts = Study.get(id=study_id).artifacts

    return {
        'artifacts': [a.uri for a in artifacts]
    }
Exemple #15
0
def study_info(request_handler, study_id):
    study = Study.get(Study.id == study_id)
    study.delete_instance() # TODO think about cascading deletes

    return {}
Exemple #16
0
def list_studies(request_handler):
    return {'studies': [study.uri for study in Study.select()]}
Exemple #17
0
def list_workflows(request_handler, study_id):
    workflows = Study.get(id=study_id).workflows

    return {'workflows': [w.uri for w in workflows]}
Exemple #18
0
def list_studies(request_handler):
    return {
        'studies': [study.uri for study in Study.select()]
    }