Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions hydra_agent/classes_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ def load_from_server(
# save the new data.
self.redis_graph.commit()

def connect_nodes(self, endpoint_properties, node_alias):
for class_endpoint in endpoint_properties:
src_node = node_alias.get(class_endpoint)
for endpoint in endpoint_properties[class_endpoint]:
node = node_alias.get(endpoint)
self.addEdge(src_node, 'has_endpoint_property', node)

def endpointclasses(
self,
entrypoint_node,
Expand All @@ -200,6 +207,7 @@ def endpointclasses(
"""
print("classes endpoint or accessing classes")
endpoint_property_list = {}
node_alias = {}
# endpoint_property_list contain all endpoints
# which have other endpoints as a property ex: State.
for endpoint in self.class_endpoints:
Expand Down Expand Up @@ -230,19 +238,5 @@ def endpointclasses(
"classes", str(endpoint), node_properties)
# set edge between the entrypoint and the class endpoint.
self.addEdge(entrypoint_node, "has" + endpoint, class_object_node)

# for connect the nodes to endpoint which have endpoint as a property.
if endpoint_property_list:
for endpoint_property in endpoint_property_list:
for src_node in self.redis_graph.nodes.values():
if str(endpoint_property) == src_node.alias:
for endpoints in endpoint_property_list[
endpoint_property]:
for nodes in self.redis_graph.nodes.values():
if endpoints == nodes.alias:
self.addEdge(
src_node,
"has_endpoint_property",
nodes)
break
break
node_alias[str(endpoint)] = class_object_node
self.connect_nodes(endpoint_property_list, node_alias)
1 change: 0 additions & 1 deletion hydra_agent/hydra_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def get_endpoints(self,api_doc, redis_connection):
alias="Entrypoint",
properties=entrypoint_properties)
self.redis_graph.add_node(entrypoint_node)
redis_connection.set("EntryPoint", entrypoint_properties)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shravandoda classes_objects and collection-endpoints also have the same error.
I think @PrajwalM2212 also working on the same issue in PR #73. So, Please ask him.

return self.get_apistructure(entrypoint_node, api_doc)


Expand Down