Example #1
0
def templates_list():
    try:
        return api_u.render(
            node_templates=[nt.dict for nt in api.get_node_templates()])
    except Exception, e:
        return api_u.internal_error(500,
                                    "Exception while listing NodeTemplates", e)
Example #2
0
def clusters_list():
    tenant_id = request.headers['X-Tenant-Id']
    try:
        return api_u.render(
            clusters=[c.dict for c in api.get_clusters(tenant_id=tenant_id)])
    except Exception, e:
        return api_u.internal_error(500, 'Exception while listing Clusters', e)
Example #3
0
 def version_list():
     context.set_ctx(None)
     return api_utils.render({
         "versions": [
             {"id": "v1.0", "status": "CURRENT"}
         ]
     })
Example #4
0
def job_execute(job_id, data):
    input = data['input_id']
    output = data['output_id']
    cluster = data['cluster_id']
    configs = data.get('job_configs', {})
    return u.render(job_execution=api.execute_job(job_id, input,
                                                  output, cluster,
                                                  configs).to_dict())
Example #5
0
 def make_json_error(ex):
     status_code = (ex.code
                    if isinstance(ex, HTTPException)
                    else 500)
     description = (ex.description
                    if isinstance(ex, HTTPException)
                    else str(ex))
     return render({'error': status_code, 'error_message': description},
                   status=status_code)
Example #6
0
def job_executions_status(job_execution_id):
    job_execution = api.get_job_execution_status(job_execution_id)
    return u.render(job_execution.to_wrapped_dict())
Example #7
0
def cluster_templates_list():
    return u.render(
        cluster_templates=[t.to_dict() for t in api.get_cluster_templates()])
Example #8
0
def job_create(data):
    return u.render(api.create_job(data).to_wrapped_dict())
Example #9
0
def job_executions_list():
    job_executions = [je.to_dict() for je in api.job_execution_list()]
    return u.render(job_executions=job_executions)
Example #10
0
def job_origin_get(job_origin_id):
    return u.render(api.get_job_origin(job_origin_id).to_wrapped_dict())
Example #11
0
def job_binary_internal_list():
    return u.render(binaries=[j.to_dict() for j in
                              api.get_job_binary_internals()])
Example #12
0
def job_create(data):
    return u.render(api.create_job(data).to_wrapped_dict())
Example #13
0
def data_source_register(data):
    return u.render(api.register_data_source(data).to_wrapped_dict())
Example #14
0
def job_origin_delete(job_origin_id):
    api.delete_job_origin(job_origin_id)
    return u.render()
Example #15
0
def jobs_list():
    return u.render(jobs=[j.to_dict() for j in api.get_jobs()])
Example #16
0
def job_origin_get(job_origin_id):
    return u.render(api.get_job_origin(job_origin_id).wrapped_dict)
Example #17
0
def job_executions_delete(job_execution_id):
    api.delete_job_execution(job_execution_id)
    return u.render()
Example #18
0
def job_executions_cancel(job_execution_id):
    job_execution = api.cancel_job_execution(job_execution_id)
    return u.render(job_execution.to_wrapped_dict())
Example #19
0
def cluster_templates_get(cluster_template_id):
    return u.render(
        api.get_cluster_template(cluster_template_id).to_wrapped_dict())
Example #20
0
def job_get(job_id):
    return u.render(api.get_job(job_id).to_wrapped_dict())
Example #21
0
def job_executions_delete(job_execution_id):
    api.delete_job_execution(job_execution_id)
    return u.render()
Example #22
0
def job_delete(job_id):
    api.delete_job(job_id)
    return u.render()
Example #23
0
def data_source_delete(data_source_id):
    api.delete_data_source(data_source_id)
    return u.render()
Example #24
0
def job_execute(job_id, input_id, output_id):
    return u.render(jobs=api.execute_job(job_id, input_id, output_id))
Example #25
0
def job_binary_delete(job_binary_id):
    api.delete_job_binary(job_binary_id)
    return u.render()
Example #26
0
def data_sources_list():
    return u.render(
        data_sources=[ds.to_dict() for ds in api.get_data_sources()])
Example #27
0
def job_binary_internal_delete(job_binary_internal_id):
    api.delete_job_binary_internal(job_binary_internal_id)
    return u.render()
Example #28
0
def data_source_register(data):
    return u.render(api.register_data_source(data).to_wrapped_dict())
Example #29
0
def job_delete(job_id):
    api.delete_job(job_id)
    return u.render()
Example #30
0
def data_source_get(data_source_id):
    return u.render(api.get_data_source(data_source_id).to_wrapped_dict())
Example #31
0
def job_executions_cancel(job_execution_id):
    job_execution = api.cancel_job_execution(job_execution_id)
    return u.render(job_execution.to_wrapped_dict())
Example #32
0
def data_source_delete(data_source_id):
    api.delete_data_source(data_source_id)
    return u.render()
Example #33
0
def clusters_delete(cluster_id):
    api.terminate_cluster(cluster_id)
    return u.render()
Example #34
0
def job_origin_list():
    return u.render(job_origins=[j.dict for j in api.get_job_origins()])
Example #35
0
def cluster_templates_create(data):
    return u.render(api.create_cluster_template(data).to_wrapped_dict())
Example #36
0
def job_origin_create(data):
    return u.render(api.create_job_origin(data))
Example #37
0
def cluster_templates_delete(cluster_template_id):
    api.terminate_cluster_template(cluster_template_id)
    return u.render()
Example #38
0
def node_group_templates_list():
    return u.render(
        node_group_templates=[t.to_dict()
                              for t in api.get_node_group_templates()])
Example #39
0
def data_sources_list():
    return u.render(
        data_sources=[ds.to_dict() for ds in api.get_data_sources()])
Example #40
0
def node_group_templates_create(data):
    return u.render(api.create_node_group_template(data).to_wrapped_dict())
Example #41
0
def data_source_get(data_source_id):
    return u.render(api.get_data_source(data_source_id).to_wrapped_dict())
Example #42
0
def node_group_templates_get(node_group_template_id):
    return u.render(
        api.get_node_group_template(node_group_template_id).to_wrapped_dict())
Example #43
0
def job_origin_list():
    return u.render(job_origins=[j.to_dict() for j in api.get_job_origins()])
Example #44
0
def node_group_templates_delete(node_group_template_id):
    api.terminate_node_group_template(node_group_template_id)
    return u.render()
Example #45
0
def job_origin_delete(job_origin_id):
    api.delete_job_origin(job_origin_id)
    return u.render()
Example #46
0
def plugins_list():
    return u.render(plugins=[p.dict for p in api.get_plugins()])
Example #47
0
def job_binary_internal_create(**values):
    return u.render(api.create_job_binary_internal(values).to_wrapped_dict())
Example #48
0
def plugins_get(plugin_name):
    return u.render(api.get_plugin(plugin_name).wrapped_dict)
Example #49
0
def job_binary_internal_get(job_binary_internal_id):
    return u.render(api.get_job_binary_internal(job_binary_internal_id
                                                ).to_wrapped_dict())
Example #50
0
def plugins_get_version(plugin_name, version):
    return u.render(api.get_plugin(plugin_name, version).wrapped_dict)
Example #51
0
def jobs_list():
    return u.render(
        jobs=[j.to_dict() for j in api.get_jobs()])
Example #52
0
def plugins_convert_to_cluster_template(plugin_name, version, name, data):
    return u.render(api.convert_to_cluster_template(plugin_name,
                                                    version,
                                                    name,
                                                    data).to_wrapped_dict())
Example #53
0
def job_get(job_id):
    return u.render(api.get_job(job_id).to_wrapped_dict())
Example #54
0
def job_config_hints_get(job_type):
    return u.render(api.get_job_config_hints(job_type))
Example #55
0
def job_binary_data(job_binary_id):
    data = api.get_job_binary_data(job_binary_id)
    if type(data) == dict:
        data = u.render(data)
    return data
Example #56
0
def images_get(image_id):
    return u.render(api.get_image(id=image_id).wrapped_dict)
Example #57
0
def job_executions_status(job_execution_id):
    job_execution = api.get_job_execution_status(job_execution_id)
    return u.render(job_execution.to_wrapped_dict())
Example #58
0
def images_set(image_id, data):
    return u.render(api.register_image(image_id, **data).wrapped_dict)
Example #59
0
def images_list():
    tags = u.get_request_args().getlist('tags')
    return u.render(images=[i.dict for i in api.get_images(tags)])
Example #60
0
def job_executions_list():
    job_executions = [je.to_dict() for je in api.job_execution_list()]
    return u.render(job_executions=job_executions)