From bf441454f69c9d1d4c8d4ca422c4f46e651dd102 Mon Sep 17 00:00:00 2001 From: ezdimitry Date: Tue, 18 Feb 2025 22:03:42 +0300 Subject: [PATCH 1/8] add endpoints spaces, rename, get_project_list --- polyanalyst6api/project.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/polyanalyst6api/project.py b/polyanalyst6api/project.py index d27b1ef..4344aae 100644 --- a/polyanalyst6api/project.py +++ b/polyanalyst6api/project.py @@ -84,6 +84,35 @@ def save(self) -> None: """Initiates saving of all changes that have been made in the project.""" self.api.post('project/save', json={'prjUUID': self.uuid}) + def spaces(self) -> List[Dict]: + """This operation returns a list of project spaces. + + :return: project spaces + """ + return self.api.get('project/spaces') + + def rename(self, new_name: Optional[str] = None, new_description: Optional[str] = None) -> None: + """ + :raises: ValueError if no parameter is set + + This operation allows users to rename a project and to give it a new description. + The operation is available only for project owners and administrators and can not be undone. + """ + if not new_name and not new_description: + raise ValueError("Must be specify one of the 'name' or 'description' parameters'") + + payload = {'prjUUID': self.uuid} + + if new_name: + payload['name'] = new_name + if new_description: + payload['description'] = new_description + + self.api.post('project/rename', json=payload) + + def get_project_list(self) -> List[Dict[str, Any]]: + return self.api.get('projects') + def abort(self) -> None: """Aborts the execution of all nodes in the project.""" self.api.post('project/global-abort', json={'prjUUID': self.uuid}) @@ -285,7 +314,6 @@ def info(self): """ return self.api.get('project/info', params={'prjUUID': self.uuid}) - def unload(self, force_unload: bool = False) -> None: """ Unload the project from the memory. From 5c4ca2b2b05e49252fb89946d26fe8dc3fae089e Mon Sep 17 00:00:00 2001 From: ezdimitry Date: Thu, 20 Feb 2025 15:09:38 +0300 Subject: [PATCH 2/8] added method get_save_status, duplicate, get_duplicating_status, move, dependencies, get_project_config. I also updated the description of some functions. --- polyanalyst6api/project.py | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/polyanalyst6api/project.py b/polyanalyst6api/project.py index 4344aae..843e1af 100644 --- a/polyanalyst6api/project.py +++ b/polyanalyst6api/project.py @@ -84,6 +84,71 @@ def save(self) -> None: """Initiates saving of all changes that have been made in the project.""" self.api.post('project/save', json={'prjUUID': self.uuid}) + def get_save_status(self, save_id: int) -> Dict[str, Any]: + """Get the status of project save + + :param save_id: the save identifier + + :return: project save status + """ + return self.api.get('project/save/status', params={'asyncOperationId': save_id}) + + def duplicate(self, name: str, folder_path: str = "", spaceId: str = None): + """This operation allows users to duplicate a project. + The operation is available only for project owners and administrators and can not be undone. + + :param name: sets the name for the project copy + :param folder_path: + """ + if not folder_path: + folder_path = "" + + request_body = { + "prjUUID": self.uuid, + "name": name, + "folderPath": folder_path, + "spaceId": spaceId + } + + request_body = {k: v for k, v in request_body.items() if v is not None} + self.api.post('project/duplicate', json=request_body) + + def get_duplicating_status(self, duplicate_id: int) -> Dict[str, Any]: + """Get the status of project duplicate + + :param duplicate_id: the duplicate identifier + + :return: project duplicate status + """ + return self.api.get('project/duplicate/status', params={'asyncOperationId': duplicate_id}) + + def move(self, folder_path: str) -> None: + """This operation moves a project to a specified folder""" + if folder_path == "": + folder_path = "/" + payload = { + 'ids': [self.uuid], + 'folderPath': folder_path + } + self.api.post('project/move', json=payload) + + def dependencies(self) -> Dict: + """This operation returns a list of project dependencies.""" + payload = { + 'ids': [self.uuid] + } + return self.api.get('project/dependencies', json=payload) + + def get_project_config(self, prefix: str = "") -> List[Dict]: + responce = self.api.get('project/config', json={'prjUUID': self.uuid, 'prefix': prefix}) + config_data = responce.json() + + if prefix: + filtered_config = {key: value for key, value in config_data.items() if key.startswith(prefix)} + else: + filtered_config = config_data + return filtered_config + def spaces(self) -> List[Dict]: """This operation returns a list of project spaces. @@ -93,6 +158,9 @@ def spaces(self) -> List[Dict]: def rename(self, new_name: Optional[str] = None, new_description: Optional[str] = None) -> None: """ + :param new_name: sets a new project name + :param new_description: sets a new project description + :raises: ValueError if no parameter is set This operation allows users to rename a project and to give it a new description. @@ -111,6 +179,10 @@ def rename(self, new_name: Optional[str] = None, new_description: Optional[str] self.api.post('project/rename', json=payload) def get_project_list(self) -> List[Dict[str, Any]]: + """This operation returns a list of projects of the server + + :return: list of projects + """ return self.api.get('projects') def abort(self) -> None: From 639247cf0e42093312e5c82f1224a1013518c0d1 Mon Sep 17 00:00:00 2001 From: ezdimitry Date: Tue, 25 Feb 2025 13:54:52 +0300 Subject: [PATCH 3/8] added methods foldder_list, create_folder, delete_folder, rename_folder, project_import, project_import_status, project_export, project_export_status, project_config_set --- polyanalyst6api/project.py | 136 ++++++++++++++++++++++++++++++++++--- 1 file changed, 125 insertions(+), 11 deletions(-) diff --git a/polyanalyst6api/project.py b/polyanalyst6api/project.py index 843e1af..eabc4e6 100644 --- a/polyanalyst6api/project.py +++ b/polyanalyst6api/project.py @@ -93,12 +93,123 @@ def get_save_status(self, save_id: int) -> Dict[str, Any]: """ return self.api.get('project/save/status', params={'asyncOperationId': save_id}) + def folder_list(self) -> List[Dict]: + """Gets the list of folders + + :return: list of folders + """ + return self.api.get('project/folders') + + def create_folder(self, name: str, folder_path: str = "", description: str = "") -> None: + """This operation creates a folder in the Project manager + + param name: folderName is a name of the folder to create + param folder_path: path to a parent folder + param description: the description field is used to set a folder description + """ + self.api.post('project/folder/create', json={'folderName': name, 'parentPath': folder_path, "description": description}) + + def delete_folder(self, folder_path: str, recursive: bool = False) -> None: + """This operation deletes a folder from the Project manager + + param folder_path: path to a user is folder + param recursive: flag to delete subfolders and projects inside the folder. + """ + self.api.post('project/folder/delete', json={'folderPath': folder_path, 'recursive': recursive}) + + def rename_folder(self, folder_path: str, new_name: str, description: str = "") -> None: + """This operation renames a folder in the Project manager and sets a description for the folder + + param folder_path: path to a user is folder + param new_name: sets a new name + param description: sets a new description + """ + self.api.post('project/folder/rename', json={'folderPath': folder_path, 'name': new_name, 'description': description}) + + def project_import(self, abs_path_file: str, folder_path: str, conflict_method: str) -> None: + """This operation allows users to import a project onto the server + + param abs_path_file: The fileName parameter is used to specify a path to a project file + param folder_path: The folderPath parameter denotes a folder where a project is being imported into + """ + self.api.post('project/import', json={'fileName': abs_path_file, 'folderPath': folder_path, 'conflictResolveMethod': conflict_method}) + + def project_import_status(self, prj_uuid: str) -> List[Dict[str, Any]]: + """Checking the status of the import operation + + :return: project import status + """ + return self.api.get('project/import/status', params={'importId': prj_uuid}) + + def project_export(self, file_name: str, file_format: str, ids: list, compression_level: int = 5, multi: bool = False, + keep_slice_statistics: bool = False, keep_backups: bool = False, keep_macros_and_vars: bool = False, + overwrite_existing: bool = False) -> None: + """This operation allows users to export a project from the server + + param file_name: name of the project + param file_format: format to export + param ids: IDs of the project + param compression_level: level of compression + param multi: flag to show there are several projects to export + param keep_slice_statistics: flag to keep slice usage statistics + param keep_backups: flag to keep backup versions + param keep_macros_and_vars: flag to keep user and server macros and variables + param overwrite_existing: flag to overwrite the existing file + + :raises ValueError if there are no arguments "file_name", "file_format", "ids" + :raises ValueError if ids is not a list or invalid "file_format" + """ + if not file_name or not file_format or not ids: + raise ValueError("file_name, file_format and ids parameters are required") + + if not isinstance(ids, list): + raise ValueError("ids must be an array of strings") + + valid_formats = ['pa6', 'ps6', 'paar6', 'psar6', 'pagridar6'] + if file_format not in valid_formats: + raise ValueError("Invalid file_format. Must be one of: pa6, ps6, paar6, psar6, pagridar6") + + request_body = { + "fileName": file_name, + "fileFormat": file_format, + "ids": ids, + "compressionLevel": compression_level, + "multi": multi, + "keepSliceStatistics": keep_slice_statistics, + "keepBackups": keep_backups, + "keepMacrosAndVars": keep_macros_and_vars, + "overwriteExisting": overwrite_existing + } + + self.api.post('project/export', json=request_body) + + def project_export_status(self): + """Checking the status of the export operation + + :return: A status of the export operation will be returned + """ + return self.api.get('project/export/status', params={'exportId': self.uuid}) + + def project_config_set(self, prj_uuid: str, actions: list) -> None: + """This operation updates the project configuration + Note that appropriate project rights are needed to perform the operation + + param prj_uuid: ID of the project + param actions: parameters to be changed + """ + request_body = { + "prjUUID": prj_uuid, + "actions": actions + } + + self.api.post('project/config/update', json=request_body) + def duplicate(self, name: str, folder_path: str = "", spaceId: str = None): """This operation allows users to duplicate a project. The operation is available only for project owners and administrators and can not be undone. :param name: sets the name for the project copy - :param folder_path: + :param folder_path: parameter is a folder in which a project duplicate must be created """ if not folder_path: folder_path = "" @@ -133,22 +244,25 @@ def move(self, folder_path: str) -> None: self.api.post('project/move', json=payload) def dependencies(self) -> Dict: - """This operation returns a list of project dependencies.""" + """This operation returns a list of project dependencies. + + :return: list of project dependencies + """ payload = { 'ids': [self.uuid] } return self.api.get('project/dependencies', json=payload) - def get_project_config(self, prefix: str = "") -> List[Dict]: - responce = self.api.get('project/config', json={'prjUUID': self.uuid, 'prefix': prefix}) - config_data = responce.json() - - if prefix: - filtered_config = {key: value for key, value in config_data.items() if key.startswith(prefix)} - else: - filtered_config = config_data - return filtered_config + def get_project_config(self, prj_uuid: str, prefix: str = "") -> List[Dict]: + """This operation returns a list of the project settings + + :return: list of the project configuration + :param prj_uuid: ID of the project + :param prefix: The parameter allows to get only a part of the project configuration + """ + return self.api.get('project/config', params={'prjUUID': prj_uuid, 'prefix': prefix}) + def spaces(self) -> List[Dict]: """This operation returns a list of project spaces. From f2155312c741275154f31dbc0dd3475ecde83404 Mon Sep 17 00:00:00 2001 From: ezdimitry Date: Wed, 26 Feb 2025 13:01:24 +0300 Subject: [PATCH 4/8] added all the missing methods to report.py --- polyanalyst6api/report.py | 90 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/polyanalyst6api/report.py b/polyanalyst6api/report.py index cc067c8..d721534 100644 --- a/polyanalyst6api/report.py +++ b/polyanalyst6api/report.py @@ -48,3 +48,93 @@ def import_slice_statistics(self, slice_stats: SliceStatistics) -> None: :param slice_stats: Slice statistics """ self.api.post('report/slice-statistics/import', params={'reportUUID': self.uuid}, json=slice_stats) + + def clear_slice_statistics(self) -> None: + """This operation clears statistics of slices""" + self.api.post('report/slice-statistics/clear', json={'reportUUID': self.uuid}) + + def sheets(self) -> List[Dict]: + """This operation returns a list of sheets of a web report""" + return self.api.get('report/sheets', params={'reportUUID': self.uuid}) + + def sharing(self, locale: str) -> None: + """This operation shares a publication and provides a guest access to the shared publication + + param locale: locale of the publication + + raises: ValueError if locale is not set + """ + loc = ["end", "esp", "fra", "cht", "chs", "kor", "rus"] + if locale not in loc: + raise ValueError('The following locale types are supported: end, esp, fra, cht, chs, kor, rus') + self.api.post('report/share', json={'reportUUID': self.uuid, 'locale': locale}) + + def stop_sharing(self) -> None: + """This operation stops publication sharing if there is a shared publication + + raises: APIException if there is not a shared publication + """ + self.api.post('report/stop-sharing', json={'reportUUID': self.uuid}) + + def get_reports(self) -> List[Dict]: + """This operation returns a list of web reports""" + return self.api.get('reports') + + def report_rename(self, name: str, description: str = "") -> None: + """This operation allows users to rename a report and give it a new description + + param name: parameter must contain a new name of the report + param description: set a new description + """ + self.api.post('report/rename', json={'reportUUID': self.uuid, 'name': name, 'description': description}) + + def report_move(self, ids: list, folder_path: str = "") -> None: + """This operation moves a report to a specified folder + + param ids: the ids is an array of strings where reportUUID are specified + param folder_path: the folderPath parameter is a folder where a report is moved + """ + self.api.post('report/move', json={'ids': ids, 'folderPath': folder_path}) + + def report_info(self) -> Dict: + """This operation returns information about a report""" + return self.api.get('report/info', params={'reportUUID': self.uuid}) + + def wrapper_guid(self, slice: int, prj_uuid: str, cid: str) -> Dict: + """This operation creates a wrapper of a web report component + + param slice: ID of the slice + param prj_uuid: ID of the project + param cid: ID of a web report component + """ + return self.api.get('report/dataset/wrapper-guid', params={'sliceId': slice, 'prjUUID': prj_uuid, 'reportUUID': self.uuid, 'CID': cid}) + + def report_folders(self) -> List[Dict]: + """This operation allows you to get a list of folders from the Report manager""" + return self.api.get('report/folders') + + def report_folder_rename(self, name: str, folder_id: str, description: str = "") -> None: + """This operation allows users to rename a folder in the Report manager and give it a new description + + param name: new name for a folder + param folder_id: folderId is an ID of the folder to rename + param description: sets a new description + """ + self.api.post('report/folder/rename', json={'folderId': folder_id, 'name': name, 'description': description}) + + def report_folder_delete(self, folder_id: str, recursive: bool = False) -> None: + """This operation deletes a folder from the Report manager + + param folder_id: folderId is an ID of the folder to delete + param recursive: flag to delete subfolders and reports inside the folder + """ + self.api.post('report/folder/delete', json={'folderId': folder_id, 'recursive': recursive}) + + def report_folder_create(self, folder_name: str, parent_id: str, description: str = "") -> Dict: + """This operation creates a folder in the Report manager + + param folder_name: a name of the folder to create + param parent_id: ID of the parent folder + param description: set a folder description + """ + return self.api.post('report/folder/create', json={'folderName': folder_name, 'parentId': parent_id, 'description': description}) From 1b5e9f3e4c19e198bc5b4ad47303f11582b7442f Mon Sep 17 00:00:00 2001 From: ezdimitry Date: Fri, 28 Feb 2025 12:09:49 +0300 Subject: [PATCH 5/8] adding missing endpoints to the project dataset --- polyanalyst6api/project.py | 110 +++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/polyanalyst6api/project.py b/polyanalyst6api/project.py index eabc4e6..c54a46b 100644 --- a/polyanalyst6api/project.py +++ b/polyanalyst6api/project.py @@ -1015,3 +1015,113 @@ def _cell_text(self, row: int, col: int) -> str: 'col': col, }, )['text'] + + @retry_on_invalid_guid + def statistics_tab(self, col: int) -> List: + """This operation returns data on the statistics of the dataset + + param col: ID of the column to get statistics for + """ + return self._api.post('dataset/statistics', json={'wrapperGuid': self.guid, 'columnId': col}) + + @retry_on_invalid_guid + def distinct(self, col_id: int, col_name: str = "", col_type: str = "") -> List: + """This operation returns the GUID of the wrapper table of unique records of the dataset + + param col_id: ID of the column for which you need to get a table wrapper of unique records + param col_name: name of the column + param col_type: type of the column + """ + return self._api.post('dataset/distinct', json={'wrapperGuid': self.guid, 'columnId': col_id, 'columnName': col_name, 'columnType': col_type}) + + @retry_on_invalid_guid + def search(self, col_id: int, col_name: str = "", col_type: str = "", search_from: int = 0, search_how: int = 0, str_value: str = "", + double_value: float = 0, match_case: bool = False, search_up: bool = False, + use_regex: bool = False, unique_id: str = "", use_pdl: bool = False) -> List: + """This operation searches for values in the selected dataset + + + """ + request_body = { + 'wrapperGuid': self.guid, + 'doubleValue': double_value, + 'strValue': str_value, + 'columnId': col_id, + 'searchFrom': search_from, + 'searchUp': search_up, + 'columnName': col_name, + 'columnType': col_type, + 'uniqueId': unique_id, + 'searchHow': search_how, + 'matchCase': match_case, + 'useRegEx': use_regex, + 'usePDL': use_pdl + } + return self._api.post('dataset/search', json=request_body) + + @retry_on_invalid_guid + def sort_dataset(self, col: list) -> List: + """This operation sorts the values of a dataset + + param col: array of column parameters + """ + return self._api.post('dataset/sort', json={'wrapperGuid': self.guid, 'columns': col}) + + @retry_on_invalid_guid + def filter_dataset(self, action: int, how_search: int, col_id: int = 0, value: int = 0, + str_value: str = "", match_case: bool = False, use_regex: bool = False, use_pdl: bool = False, col_name: str = "", + col_type: str = "", day: int = 0, month: int = 0, year: int = 0) -> List: + """This operation filters a dataset by specified values + + param col_id: ID of the column to filter + param action: The way to filter a dataset + param value: Value to filter a dataset + param how_search: The way to search a value + param match_case: Flag to enable case-sensitive filtration + param use_regex: Flat to use regular expressions to filter + param use_pdl: Flag to use PDL to filter + param col_name: Name of the column to filter + param col_type: Type of the column to filter + param day: Day value to filter when working with the date/time column + param month: Month value to filter when working with the date/time column + param year: Year value to filter when working with the date/time column + """ + massive = [0, 1, 2, 3, 4, 5] + if action not in massive or how_search not in massive[:3]: + raise ValueError("action can accept numbers from 1 to 5, how_search from 0 to 2") + request_body = { + 'wrapperGuid': self.guid, + 'columnId': col_id, + 'action': action, + 'value': value, + 'strValue': str_value, + 'howsearch': how_search, + 'matchCase': match_case, + 'useRegEx': use_regex, + 'usePDL': use_pdl, + 'columnName': col_name, + 'columnType': col_type, + 'day': day, + 'month': month, + 'year': year + } + return self._api.post('dataset/filter', json=request_body) + + @retry_on_invalid_guid + def get_binary(self, key: str, file_name: str = "content"): + """This operation returns the binary content of the dataset + + param key: ID of the column containing binary data + param file_name: name of the file to be returned + """ + return self._api.get('dataset/get-binary-content', params={'wrapperGuid': self.guid, 'key': key, 'fileName': file_name}) + + @retry_on_invalid_guid + def dataset_export(self, type: str, file_name: str) -> List: + """This operation allows you to export a dataset to a file + + param type: a file type you want to export your data to ("csv", "xls", "html", "xml", "xlsx", "json") + param file_name: name of the file + """ + return self._api.post("dataset/export", json={'wrapperGuid': self.guid, 'type': type, 'fileName': file_name}) + \ No newline at end of file From d7c913b5eb048caa32ac0acd2e32759d44b31bfb Mon Sep 17 00:00:00 2001 From: ezdimitry Date: Fri, 28 Feb 2025 12:59:30 +0300 Subject: [PATCH 6/8] correcting an exception --- polyanalyst6api/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyanalyst6api/project.py b/polyanalyst6api/project.py index c54a46b..9985c0e 100644 --- a/polyanalyst6api/project.py +++ b/polyanalyst6api/project.py @@ -1088,7 +1088,7 @@ def filter_dataset(self, action: int, how_search: int, col_id: int = 0, value: i """ massive = [0, 1, 2, 3, 4, 5] if action not in massive or how_search not in massive[:3]: - raise ValueError("action can accept numbers from 1 to 5, how_search from 0 to 2") + raise ValueError("action can accept numbers from 0 to 5, how_search from 0 to 2") request_body = { 'wrapperGuid': self.guid, 'columnId': col_id, From 73f8ee836b4f6293bfc9d1641ee05767ea4e1660 Mon Sep 17 00:00:00 2001 From: ezdimitry Date: Tue, 4 Mar 2025 11:12:12 +0300 Subject: [PATCH 7/8] removed the argument prj_uuid in the methods project_config_set, get_project_config --- polyanalyst6api/project.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/polyanalyst6api/project.py b/polyanalyst6api/project.py index 9985c0e..75f8aee 100644 --- a/polyanalyst6api/project.py +++ b/polyanalyst6api/project.py @@ -134,12 +134,14 @@ def project_import(self, abs_path_file: str, folder_path: str, conflict_method: """ self.api.post('project/import', json={'fileName': abs_path_file, 'folderPath': folder_path, 'conflictResolveMethod': conflict_method}) - def project_import_status(self, prj_uuid: str) -> List[Dict[str, Any]]: + def project_import_status(self, import_id: str) -> List[Dict[str, Any]]: """Checking the status of the import operation :return: project import status + + param import_id: ID of the export operation """ - return self.api.get('project/import/status', params={'importId': prj_uuid}) + return self.api.get('project/import/status', params={'importId': import_id}) def project_export(self, file_name: str, file_format: str, ids: list, compression_level: int = 5, multi: bool = False, keep_slice_statistics: bool = False, keep_backups: bool = False, keep_macros_and_vars: bool = False, @@ -190,15 +192,14 @@ def project_export_status(self): """ return self.api.get('project/export/status', params={'exportId': self.uuid}) - def project_config_set(self, prj_uuid: str, actions: list) -> None: + def project_config_set(self, actions: list) -> None: """This operation updates the project configuration Note that appropriate project rights are needed to perform the operation - param prj_uuid: ID of the project param actions: parameters to be changed """ request_body = { - "prjUUID": prj_uuid, + "prjUUID": self.uuid, "actions": actions } @@ -253,15 +254,14 @@ def dependencies(self) -> Dict: } return self.api.get('project/dependencies', json=payload) - def get_project_config(self, prj_uuid: str, prefix: str = "") -> List[Dict]: + def get_project_config(self, prefix: str = "") -> List[Dict]: """This operation returns a list of the project settings :return: list of the project configuration - :param prj_uuid: ID of the project :param prefix: The parameter allows to get only a part of the project configuration """ - return self.api.get('project/config', params={'prjUUID': prj_uuid, 'prefix': prefix}) + return self.api.get('project/config', params={'prjUUID': self.uuid, 'prefix': prefix}) def spaces(self) -> List[Dict]: """This operation returns a list of project spaces. From daaa74e488416d23d59d16b88e5a80d27cc356cf Mon Sep 17 00:00:00 2001 From: ezdimitry Date: Fri, 7 Mar 2025 11:45:44 +0300 Subject: [PATCH 8/8] removing unnecessary methods --- polyanalyst6api/project.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/polyanalyst6api/project.py b/polyanalyst6api/project.py index 75f8aee..3888c45 100644 --- a/polyanalyst6api/project.py +++ b/polyanalyst6api/project.py @@ -125,23 +125,6 @@ def rename_folder(self, folder_path: str, new_name: str, description: str = "") param description: sets a new description """ self.api.post('project/folder/rename', json={'folderPath': folder_path, 'name': new_name, 'description': description}) - - def project_import(self, abs_path_file: str, folder_path: str, conflict_method: str) -> None: - """This operation allows users to import a project onto the server - - param abs_path_file: The fileName parameter is used to specify a path to a project file - param folder_path: The folderPath parameter denotes a folder where a project is being imported into - """ - self.api.post('project/import', json={'fileName': abs_path_file, 'folderPath': folder_path, 'conflictResolveMethod': conflict_method}) - - def project_import_status(self, import_id: str) -> List[Dict[str, Any]]: - """Checking the status of the import operation - - :return: project import status - - param import_id: ID of the export operation - """ - return self.api.get('project/import/status', params={'importId': import_id}) def project_export(self, file_name: str, file_format: str, ids: list, compression_level: int = 5, multi: bool = False, keep_slice_statistics: bool = False, keep_backups: bool = False, keep_macros_and_vars: bool = False, @@ -262,13 +245,6 @@ def get_project_config(self, prefix: str = "") -> List[Dict]: :param prefix: The parameter allows to get only a part of the project configuration """ return self.api.get('project/config', params={'prjUUID': self.uuid, 'prefix': prefix}) - - def spaces(self) -> List[Dict]: - """This operation returns a list of project spaces. - - :return: project spaces - """ - return self.api.get('project/spaces') def rename(self, new_name: Optional[str] = None, new_description: Optional[str] = None) -> None: """ @@ -292,13 +268,6 @@ def rename(self, new_name: Optional[str] = None, new_description: Optional[str] self.api.post('project/rename', json=payload) - def get_project_list(self) -> List[Dict[str, Any]]: - """This operation returns a list of projects of the server - - :return: list of projects - """ - return self.api.get('projects') - def abort(self) -> None: """Aborts the execution of all nodes in the project.""" self.api.post('project/global-abort', json={'prjUUID': self.uuid})