示例#1
0
文件: views.py 项目: monkey-H/nap_api
def project(request, pro, format=None):
    """
    delete a project, or get services from a project
    """
    username = str(request.user)

    if request.method == 'DELETE':
        sts, logs = app_info.destroy_project(username, pro)
        return Response({'Delete': sts, 'log': logs})

    elif request.method == 'GET':
        item = app_info.get_project(username, pro)
        ret_data = {'success': 'true', 'total': 1, 'item': item}
        return Response(ret_data)
示例#2
0
文件: views.py 项目: icsnju/nap-core
def project(request, pro, format=None):
    """
    delete a project, or get services from a project
    """
    username = str(request.user)
    print "hello"

    if request.method == 'DELETE':
        sts, logs = app_info.destroy_project(username, pro)
        return Response({'Delete': sts, 'log': logs})

    elif request.method == 'GET':
        item = app_info.get_project(username, pro)
        ret_data = {'success': 'true', 'total': 1, 'item': item}
        return Response(ret_data)
示例#3
0
文件: views.py 项目: icsnju/nap-api
def project(request, project, format=None):
    """
    delete a project, or get services from a project
    """
    username, passwd = str(request.user), str(request.user)

    if request.method == 'DELETE':
        sts, logs = app_info.destroy_project(username, passwd, project)
        return Response({'Delete': sts, 'log': logs})

    elif request.method == 'GET':
        services = app_info.service_list(username, passwd, project)
        ret_data = {}
        ret_data['success'] = 'true'
        ret_data['total'] = len(services)
        ret_data['services'] = services
        return Response(ret_data)
示例#4
0
文件: views.py 项目: icsnju/nap-api
def project(request, project, format=None):
    """
    delete a project, or get services from a project
    """
    username, passwd = str(request.user), str(request.user)

    if request.method == 'DELETE':
        sts, logs = app_info.destroy_project(username, passwd, project)
        return Response({'Delete': sts, 'log': logs})

    elif request.method == 'GET':
        services = app_info.service_list(username, passwd, project)
        ret_data = {}
        ret_data['success'] = 'true'
        ret_data['total'] = len(services)
        ret_data['services'] = services
        return Response(ret_data)
示例#5
0
文件: test.py 项目: icsnju/nap-core
#!/usr/bin/python

from orchestration.nap_api import app_info
from orchestration.database import database_update
from orchestration.nap_api import project_create

#print app_info.delete_user("mongo")
#print app_info.create_user("mongo", "mongo")
#print app_info.delete_user("mongo")
#
print app_info.destroy_project('mongo', 'mongo', 'test')
#print app_info.destroy_project('wangwy', 'wangwy', 'cdh')
#print project_create.create_project_from_url('mongo', 'mongo', 'test', '[email protected]:monkey-H/test_argv.git')
#print project_create.create_project_from_url('wangwy', 'wangwy', 'cdh', '[email protected]:co2y/cdh_app.git')
#print project_create.create_project_from_url('mongo', 'mongo', 'test', '[email protected]:monkey-H/mrbs_app.git')
print project_create.create_project_from_url('mongo', 'mongo', 'test', '[email protected]:monkey-H/web_app.git')

#di = {}
#for item in data[1]:
#    di[item] = 'hello'
#
#print project_create.replace_argv('apple', 'apple', '/home/monkey/Documents/filebrowser/apple/test', 'test', di)
#print app_info.project_list('wangwy', 'wangwy', 0, 3)
#print app_info.service_list('wangwy', 'wangwy', 'cdh')
print app_info.project_list('mongo', 'mongo', 0, 3)
print app_info.service_list('mongo', 'mongo', 'test')
示例#6
0
文件: test.py 项目: icsnju/nap-core
from orchestration.nap_api.project_create import create_project_from_url
from orchestration.nap_api.app_info import destroy_project 

print destroy_project('mongo', 'mongo', 'test')
print create_project_from_url('mongo', 'mongo', 'test', '[email protected]:monkey-H/web_app.git')
示例#7
0
文件: mpi.py 项目: icsnju/nap-core
def create_mpi(username, password, mpi_name, slaves):
    table = []
    args = {'type':'mpi', 'slaves':slaves}
    table.append(args)
    print app_info.destroy_project(username, password, mpi_name)
    print create_from_table.create_project_from_table(username, password, mpi_name, table)