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
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
def get_users_list(): url = ApiLinks.BASE_URI + ApiLinks.USERS response = requests.get(url, headers=auth_header('post')) return response
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
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
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
def get_user_info(): url = ApiLinks.BASE_URI + 'pubapi/v1/userinfo' response = requests.get(url, headers=auth_header('get')) return response
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