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

Function use

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

Switch to GRAPH context, see identifier with `ls` command

(context, graph_identifier)

Source from the content-addressed store, hash-verified

74)
75@click.argument("GRAPH_IDENTIFIER", required=True)
76def use(context, graph_identifier):
77 """Switch to GRAPH context, see identifier with `ls` command"""
78 try:
79 graph_identifier = get_graph_id_by_name(graph_identifier)
80 graph_name = get_graph_name_by_id(graph_identifier)
81 status = list_service_status()
82 for s in status:
83 if s.graph_id == graph_identifier and s.status != "Running":
84 info(
85 f"Starting service on graph {graph_name}(id={graph_identifier})..."
86 )
87 start_service(graph_identifier)
88 switch_context(graph_identifier, graph_name)
89 except Exception as e:
90 err(f"Failed to switch context: {str(e)}")
91 else:
92 click.secho(f"Using GRAPH {graph_name}(id={graph_identifier})", fg="green")
93
94
95@cli.command()

Callers

nothing calls this directly

Calls 7

get_graph_id_by_nameFunction · 0.90
get_graph_name_by_idFunction · 0.90
list_service_statusFunction · 0.90
infoFunction · 0.90
start_serviceFunction · 0.90
switch_contextFunction · 0.90
errFunction · 0.90

Tested by

no test coverage detected