MCPcopy Create free account
hub / github.com/alibaba/GraphScope / ls

Function ls

python/graphscope/gsctl/commands/interactive/glob.py:97–120  ·  view source on GitHub ↗

Display graph resources in database

(l)

Source from the content-addressed store, hash-verified

95@cli.command()
96@click.option("-l", is_flag=True, help="List sub resources recursively")
97def ls(l): # noqa: F811, E741
98 """Display graph resources in database"""
99 tree = TreeDisplay()
100 try:
101 graphs = list_graphs()
102 for g in graphs:
103 # schema
104 tree.create_graph_node(g, recursive=l)
105 if l:
106 # data source mapping
107 datasource_mapping = get_datasource_by_id(g.id)
108 tree.create_datasource_mapping_node(g, datasource_mapping)
109 # stored procedure
110 stored_procedures = list_stored_procedures(g.id)
111 tree.create_stored_procedure_node(g, stored_procedures)
112 # job
113 jobs = list_jobs()
114 tree.create_job_node(g, jobs)
115 except Exception as e:
116 err(f"Failed to list resources: {str(e)}")
117 else:
118 tree.show()
119 if not l:
120 info("Run `gsctl ls -l` to list all resources recursively.")
121
122
123@create.command()

Callers

nothing calls this directly

Calls 12

create_graph_nodeMethod · 0.95
create_job_nodeMethod · 0.95
showMethod · 0.95
TreeDisplayClass · 0.90
list_graphsFunction · 0.90
get_datasource_by_idFunction · 0.90
list_stored_proceduresFunction · 0.90
list_jobsFunction · 0.90
errFunction · 0.90
infoFunction · 0.90

Tested by

no test coverage detected