MCPcopy Index your code
hub / github.com/Zipstack/unstract / run_command

Function run_command

runner/src/unstract/runner/controller/run.py:62–78  ·  view source on GitHub ↗

Endpoint which will can execute any of the below commands. Args: command (str): AnyOf("properties","spec","variables","icon") Returns: Optional[Any]: Response from container for the specific command. Returns None in case of error.

(command: str)

Source from the content-addressed store, hash-verified

60
61@run_bp.route("container/<command>", methods=["GET"])
62def run_command(command: str) -> Any | None:
63 """Endpoint which will can execute any of the below commands.
64
65 Args:
66 command (str): AnyOf("properties","spec","variables","icon")
67
68 Returns:
69 Optional[Any]: Response from container for the specific command.
70 Returns None in case of error.
71 """
72 if command not in {"properties", "spec", "variables", "icon"}:
73 abort(404)
74 image_name = request.args.get("image_name")
75 image_tag = request.args.get("image_tag")
76 runner = UnstractRunner(image_name, image_tag, app)
77
78 return runner.run_command(command)

Callers

nothing calls this directly

Calls 3

run_commandMethod · 0.95
UnstractRunnerClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected