Switch to GRAPH context, see identifier with `ls` command
(context, graph_identifier)
| 74 | ) |
| 75 | @click.argument("GRAPH_IDENTIFIER", required=True) |
| 76 | def 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() |
nothing calls this directly
no test coverage detected