예제 #1
0
def search_spaces(site, name):
    headers = build_headers(login(site))
    response = requests.get(site["host"] + "query/space/group?query_name=" +
                            name,
                            headers=headers)
    # print(response.status_code)
    return response.json()
예제 #2
0
def load_space_list(site, names):
    headers = build_headers(login(site))
    response = requests.post(site["host"] + "space/list/name",
                             data=json.dumps(names),
                             headers=headers)

    return response.json()
def import_instances(instances):
    headers = build_headers(login())
    for instance in instances:
        response = requests.post("http://localhost:8000/topic/data",
                                 data=json.dumps(instance),
                                 headers=headers)
        print(response.status_code)
예제 #4
0
def import_pipelines(site, pipelines):
    headers = build_headers(login(site))
    for pipeline in pipelines:
        response = requests.post(site["host"] + "import/admin/pipeline",
                                 data=json.dumps(pipeline),
                                 headers=headers)
        if response.status_code == 200:
            print("import successfully")
예제 #5
0
def import_topics(site, topics):
    headers = build_headers(login(site))
    for topic in topics:
        response = requests.post(site["host"] + "import/admin/topic",
                                 data=json.dumps(topic),
                                 headers=headers)
        if response.status_code == 200:
            print("import successfully")
예제 #6
0
def load_users(site, names):
    headers = build_headers(login(site))
    response = requests.post(site["host"] + "user/list/name",
                             data=json.dumps(names),
                             headers=headers)
    data = response.json()
    # print(data)
    return data
예제 #7
0
def import_users(site, users):
    headers = build_headers(login(site))
    for user in users:
        response = requests.post(site["host"] + "import/admin/user",
                                 data=json.dumps(user),
                                 headers=headers)
        if response.status_code == 200:
            print("import successfully")
예제 #8
0
def import_user_groups(site, groups):
    headers = build_headers(login(site))
    for group in groups:
        # print(json.dumps(group))
        response = requests.post(site["host"] + "import/admin/user/group",
                                 data=json.dumps(group),
                                 headers=headers)
        if response.status_code == 200:
            print("import successfully")
예제 #9
0
def load_pipeline_by_id(site, id):
    headers = build_headers(login(site))
    response = requests.get(site["host"] + "pipeline/id?pipeline_id=" +
                            str(id),
                            headers=headers)
    return response.json()
예제 #10
0
def search_topics(site, name):
    headers = build_headers(login(site))
    response = requests.get(site["host"] + "topic/query?query_name=" + name,
                            headers=headers)
    # print(response.status_code)
    return response.json()
예제 #11
0
def list_all_pipeline(site):
    headers = build_headers(login(site))
    response = requests.get(site["host"] + "pipeline/all", headers=headers)
    return response.json()
예제 #12
0
def load_user_list(site, username_list):
    headers = build_headers(login(site))
def remove_topic_collection(collections):
    headers = build_headers(login())
    response = requests.post("http://localhost:8000/topic/data/remove",
                             data=json.dumps(collections),
                             headers=headers)
    print(response.status_code)