From 5cfb5bc2ec4869942c0a29b7acdf580ba3f2f8c7 Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Mon, 15 Apr 2024 17:37:35 -0400 Subject: [PATCH 1/9] adv res support --- fabrictestbed/__init__.py | 2 +- fabrictestbed/slice_manager/slice_manager.py | 12 +++++++++--- pyproject.toml | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/fabrictestbed/__init__.py b/fabrictestbed/__init__.py index 4e9ca20..5f2ae61 100644 --- a/fabrictestbed/__init__.py +++ b/fabrictestbed/__init__.py @@ -1,2 +1,2 @@ -__version__ = "1.6.9" +__version__ = "1.7.0b1" __VERSION__ = __version__ diff --git a/fabrictestbed/slice_manager/slice_manager.py b/fabrictestbed/slice_manager/slice_manager.py index 2834dfd..587f168 100644 --- a/fabrictestbed/slice_manager/slice_manager.py +++ b/fabrictestbed/slice_manager/slice_manager.py @@ -433,18 +433,24 @@ def slivers(self, *, slice_object: Slice, error_message = Utils.extract_error_message(exception=e) return Status.FAILURE, SliceManagerException(error_message) - def resources(self, *, level: int = 1, - force_refresh: bool = False) -> Tuple[Status, Union[SliceManagerException, AdvertisedTopology]]: + def resources(self, *, level: int = 1, force_refresh: bool = False, start: datetime = None, end: datetime = None, + includes: List[str] = None, + excludes: List[str] = None) -> Tuple[Status, Union[SliceManagerException, AdvertisedTopology]]: """ Get resources @param level level @param force_refresh force_refresh + @param start start time + @param end end time + @param includes list of sites to include + @param excludes list of sites to exclude @return Tuple containing Status and Exception/Json containing Resources """ try: if self.__should_renew(): self.__load_tokens() - return self.oc_proxy.resources(token=self.get_id_token(), level=level, force_refresh=force_refresh) + return self.oc_proxy.resources(token=self.get_id_token(), level=level, force_refresh=force_refresh, + start=start, end=end, includes=includes, excludes=excludes) except Exception as e: error_message = Utils.extract_error_message(exception=e) return Status.FAILURE, SliceManagerException(error_message) diff --git a/pyproject.toml b/pyproject.toml index 3f4224a..7b447d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "fabric_fss_utils>=1.5.1", "click", "fabric-credmgr-client==1.6.1", - "fabric-orchestrator-client==1.6.1", + "fabric-orchestrator-client==1.7.0b1", "paramiko" ] From f1bfcc2dfb654188fb4062909e8ab4f03f080460 Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Tue, 16 Apr 2024 22:52:29 -0400 Subject: [PATCH 2/9] rollback to refresh check for llts --- fabrictestbed/slice_manager/slice_manager.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/fabrictestbed/slice_manager/slice_manager.py b/fabrictestbed/slice_manager/slice_manager.py index 587f168..58750b6 100644 --- a/fabrictestbed/slice_manager/slice_manager.py +++ b/fabrictestbed/slice_manager/slice_manager.py @@ -157,8 +157,6 @@ def __load_tokens(self, refresh: bool = True): refresh_token = os.environ.get(Constants.CILOGON_REFRESH_TOKEN) # Renew the tokens to ensure any project_id changes are taken into account if refresh and self.auto_refresh: - if refresh_token is None: - raise SliceManagerException(f"Unable to refresh tokens: no refresh token found!") self.refresh_tokens(refresh_token=refresh_token) def get_refresh_token(self) -> str: From a4c4988db12573975916ba8fc4b23c9f09b356e5 Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Tue, 7 May 2024 17:32:51 -0400 Subject: [PATCH 3/9] added support for allocated state --- fabrictestbed/__init__.py | 2 +- fabrictestbed/slice_manager/slice_manager.py | 6 ++++-- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fabrictestbed/__init__.py b/fabrictestbed/__init__.py index 5f2ae61..c5f3cc7 100644 --- a/fabrictestbed/__init__.py +++ b/fabrictestbed/__init__.py @@ -1,2 +1,2 @@ -__version__ = "1.7.0b1" +__version__ = "1.7.0b2" __VERSION__ = __version__ diff --git a/fabrictestbed/slice_manager/slice_manager.py b/fabrictestbed/slice_manager/slice_manager.py index 58750b6..8b0f915 100644 --- a/fabrictestbed/slice_manager/slice_manager.py +++ b/fabrictestbed/slice_manager/slice_manager.py @@ -277,7 +277,7 @@ def clear_token_cache(self, *, file_name: str = None): return Status.FAILURE, f"Failed to clear token cache: {Utils.extract_error_message(exception=exception)}" def create(self, *, slice_name: str, ssh_key: Union[str, List[str]], topology: ExperimentTopology = None, - slice_graph: str = None, + slice_graph: str = None, lease_start_time: str = None, lease_end_time: str = None) -> Tuple[Status, Union[SliceManagerException, List[Sliver]]]: """ Create a slice @@ -285,6 +285,7 @@ def create(self, *, slice_name: str, ssh_key: Union[str, List[str]], topology: E @param ssh_key SSH Key(s) @param topology Experiment topology @param slice_graph Slice Graph string + @param lease_start_time Lease Start Time @param lease_end_time Lease End Time @return Tuple containing Status and Exception/Json containing slivers created """ @@ -304,7 +305,8 @@ def create(self, *, slice_name: str, ssh_key: Union[str, List[str]], topology: E if self.__should_renew(): self.__load_tokens() return self.oc_proxy.create(token=self.get_id_token(), slice_name=slice_name, ssh_key=ssh_key, - topology=topology, slice_graph=slice_graph, lease_end_time=lease_end_time) + topology=topology, slice_graph=slice_graph, lease_end_time=lease_end_time, + lease_start_time=lease_start_time) except Exception as e: error_message = Utils.extract_error_message(exception=e) return Status.FAILURE, SliceManagerException(error_message) diff --git a/pyproject.toml b/pyproject.toml index 7b447d0..79b4b6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "fabric_fss_utils>=1.5.1", "click", "fabric-credmgr-client==1.6.1", - "fabric-orchestrator-client==1.7.0b1", + "fabric-orchestrator-client==1.7.0b2", "paramiko" ] From 56bd4cbb5ff8cc065cce32ce6862fa84d3c58689 Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Fri, 10 May 2024 04:43:28 -0400 Subject: [PATCH 4/9] add support for metrics api --- fabrictestbed/__init__.py | 2 +- fabrictestbed/slice_manager/slice_manager.py | 20 +++++++++++++++++++- pyproject.toml | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/fabrictestbed/__init__.py b/fabrictestbed/__init__.py index c5f3cc7..5aa2f16 100644 --- a/fabrictestbed/__init__.py +++ b/fabrictestbed/__init__.py @@ -1,2 +1,2 @@ -__version__ = "1.7.0b2" +__version__ = "1.7.0b3" __VERSION__ = __version__ diff --git a/fabrictestbed/slice_manager/slice_manager.py b/fabrictestbed/slice_manager/slice_manager.py index 8b0f915..e99b557 100644 --- a/fabrictestbed/slice_manager/slice_manager.py +++ b/fabrictestbed/slice_manager/slice_manager.py @@ -629,4 +629,22 @@ def get_project_info(self, project_name: str = "all", project_id: str = "all", u return core_api_proxy.get_user_projects(project_name=project_name, project_id=project_id, uuid=uuid) except Exception as e: error_message = Utils.extract_error_message(exception=e) - raise SliceManagerException(error_message) \ No newline at end of file + raise SliceManagerException(error_message) + + def get_metrics_overview(self, excluded_projects: List[str] = None, + authenticated: bool = False) -> Tuple[Status, Union[list, Exception]]: + """ + Get Metrics overview + @param excluded_projects: excluded_projects + @param authenticated: Specific user metrics + @return list of metrics + """ + try: + token = None + if authenticated and self.__should_renew(): + self.__load_tokens() + token = self.get_id_token() + return self.oc_proxy.get_metrics_overview(token=token, excluded_projects=excluded_projects) + except Exception as e: + error_message = Utils.extract_error_message(exception=e) + return Status.FAILURE, SliceManagerException(error_message) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 79b4b6f..b6660ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "fabric_fss_utils>=1.5.1", "click", "fabric-credmgr-client==1.6.1", - "fabric-orchestrator-client==1.7.0b2", + "fabric-orchestrator-client==1.7.0b3", "paramiko" ] From 77478f888f09521824fdb8be3e9f13a39cab9e9f Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Fri, 10 May 2024 10:01:51 -0400 Subject: [PATCH 5/9] up the version --- fabrictestbed/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fabrictestbed/__init__.py b/fabrictestbed/__init__.py index 5aa2f16..01d22ec 100644 --- a/fabrictestbed/__init__.py +++ b/fabrictestbed/__init__.py @@ -1,2 +1,2 @@ -__version__ = "1.7.0b3" +__version__ = "1.7.0b4" __VERSION__ = __version__ diff --git a/pyproject.toml b/pyproject.toml index b6660ca..4e11a98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "fabric_fss_utils>=1.5.1", "click", "fabric-credmgr-client==1.6.1", - "fabric-orchestrator-client==1.7.0b3", + "fabric-orchestrator-client==1.7.0b4", "paramiko" ] From e71a3458e188b6c3015b89e8fd7b4a7e87602e19 Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Sat, 11 May 2024 06:38:35 -0400 Subject: [PATCH 6/9] up dependencies --- fabrictestbed/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fabrictestbed/__init__.py b/fabrictestbed/__init__.py index 01d22ec..954e5d6 100644 --- a/fabrictestbed/__init__.py +++ b/fabrictestbed/__init__.py @@ -1,2 +1,2 @@ -__version__ = "1.7.0b4" +__version__ = "1.7.0b5" __VERSION__ = __version__ diff --git a/pyproject.toml b/pyproject.toml index 4e11a98..0db8315 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "fabric_fss_utils>=1.5.1", "click", "fabric-credmgr-client==1.6.1", - "fabric-orchestrator-client==1.7.0b4", + "fabric-orchestrator-client==1.7.0b5", "paramiko" ] From 82a8ea7617ea6c8675c7eeee072f9eb689fd3508 Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Mon, 24 Jun 2024 10:47:02 -0400 Subject: [PATCH 7/9] up the version --- fabrictestbed/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fabrictestbed/__init__.py b/fabrictestbed/__init__.py index 954e5d6..57c9738 100644 --- a/fabrictestbed/__init__.py +++ b/fabrictestbed/__init__.py @@ -1,2 +1,2 @@ -__version__ = "1.7.0b5" +__version__ = "1.7.0b8" __VERSION__ = __version__ diff --git a/pyproject.toml b/pyproject.toml index 0db8315..8ccbfca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "fabric_fss_utils>=1.5.1", "click", "fabric-credmgr-client==1.6.1", - "fabric-orchestrator-client==1.7.0b5", + "fabric-orchestrator-client==1.7.0b8", "paramiko" ] From 7569901d2084ce801a1edd5c1851e4ac62f10e87 Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Mon, 15 Jul 2024 12:59:43 -0400 Subject: [PATCH 8/9] up version and dependencies --- fabrictestbed/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fabrictestbed/__init__.py b/fabrictestbed/__init__.py index 57c9738..96e7bfe 100644 --- a/fabrictestbed/__init__.py +++ b/fabrictestbed/__init__.py @@ -1,2 +1,2 @@ -__version__ = "1.7.0b8" +__version__ = "1.7.0rc0" __VERSION__ = __version__ diff --git a/pyproject.toml b/pyproject.toml index 8ccbfca..9c27fce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "fabric_fss_utils>=1.5.1", "click", "fabric-credmgr-client==1.6.1", - "fabric-orchestrator-client==1.7.0b8", + "fabric-orchestrator-client==1.7.0", "paramiko" ] From 3cfeb52e5216c39c5b82dba954ae594bd218cfb2 Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Thu, 18 Jul 2024 09:51:29 -0400 Subject: [PATCH 9/9] push to pypi --- fabrictestbed/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabrictestbed/__init__.py b/fabrictestbed/__init__.py index 96e7bfe..1f6dc02 100644 --- a/fabrictestbed/__init__.py +++ b/fabrictestbed/__init__.py @@ -1,2 +1,2 @@ -__version__ = "1.7.0rc0" +__version__ = "1.7.0" __VERSION__ = __version__