示例#1
0
def create_folder(folder):
    url = ApiLinks.BASE_URI + ApiLinks.FILE_SYSTEM
    body = {'action': 'add_folder'}
    folder_url = url + folder
    body_json = extract_json_data.parse_body_to_json(body)
    response = requests.post(folder_url,
                             body_json,
                             headers=auth_header('post'))
    return response
示例#2
0
def patch_user_params(user_id, body):
    url = ApiLinks.BASE_URI + ApiLinks.USERS + str(user_id)
    body_json = extract_json_data.parse_body_to_json(body)
    response = requests.patch(url, body_json, headers=auth_header('patch'))
    return response
示例#3
0
def get_users_list():
    url = ApiLinks.BASE_URI + ApiLinks.USERS
    response = requests.get(url, headers=auth_header('post'))
    return response
示例#4
0
def set_group_folder_permissions(folder, body):
    url = ApiLinks.BASE_URI + ApiLinks.PERMISSIONS + folder
    body_json = extract_json_data.parse_body_to_json(body)
    response = requests.post(url, body_json, headers=auth_header('post'))
    return response
示例#5
0
def get_group_folder_permissions(folder, key):
    url = ApiLinks.BASE_URI + ApiLinks.PERMISSIONS + folder
    response = requests.get(url, headers=auth_header('get'))
    json_value = extract_json_data.find_json_key(response, key)
    return json_value
示例#6
0
def upload_file(file_path, file_name):
    url = ApiLinks.BASE_URI + ApiLinks.UPLOAD_FILE + file_path
    files = {'upload_file': open('../resources/' + file_name, 'rb')}
    response = requests.post(url, files=files, headers=auth_header('post'))
    return response
示例#7
0
def get_user_info():
    url = ApiLinks.BASE_URI + 'pubapi/v1/userinfo'
    response = requests.get(url, headers=auth_header('get'))
    return response
示例#8
0
def delete_folder(folder):
    url = ApiLinks.BASE_URI + ApiLinks.FILE_SYSTEM
    folder_url = url + folder
    response = requests.delete(folder_url, headers=auth_header('delete'))
    return response