Skip to content

Commit

Permalink
add log for list resources
Browse files Browse the repository at this point in the history
  • Loading branch information
kthare10 committed Sep 1, 2024
1 parent 2257909 commit f0df47b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions fabric_cf/orchestrator/core/orchestrator_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def get_broker(self, *, controller: ABCMgmtControllerMixin) -> ID:
def discover_broker_query_model(self, *, controller: ABCMgmtControllerMixin, token: str = None,
level: int = 10, graph_format: GraphFormat = GraphFormat.GRAPHML,
force_refresh: bool = False, start: datetime = None,
end: datetime = None, includes: str = None, excludes: str = None) -> str or None:
end: datetime = None, includes: str = None, excludes: str = None,
email: str = None) -> str or None:
"""
Discover all the available resources by querying Broker
:param controller Management Controller Object
Expand Down Expand Up @@ -159,6 +160,9 @@ def discover_broker_query_model(self, *, controller: ABCMgmtControllerMixin, tok
raise OrchestratorException("Unable to determine broker proxy for this controller. "
"Please check Orchestrator container configuration and logs.")

self.logger.info(f"Sending Query to broker on behalf of {email} Start: {start}, End: {end}, "
f"Force: {force_refresh}, Level: {level}")

model = controller.get_broker_query_model(broker=broker, id_token=token, level=level,
graph_format=graph_format, start=start, end=end,
includes=includes, excludes=excludes)
Expand Down Expand Up @@ -199,11 +203,14 @@ def list_resources(self, *, level: int, force_refresh: bool = False, start: date
graph_format = self.__translate_graph_format(graph_format=graph_format_str) if graph_format_str else GraphFormat.GRAPHML

if authorize:
self.__authorize_request(id_token=token, action_id=ActionId.query)
fabric_token = self.__authorize_request(id_token=token, action_id=ActionId.query)
email = fabric_token.email
else:
email = None
broker_query_model = self.discover_broker_query_model(controller=controller, token=token, level=level,
force_refresh=force_refresh, start=start,
end=end, includes=includes, excludes=excludes,
graph_format=graph_format)
graph_format=graph_format, email=email)
return broker_query_model

except Exception as e:
Expand Down

0 comments on commit f0df47b

Please sign in to comment.