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)
| 60 | |
| 61 | @run_bp.route("container/<command>", methods=["GET"]) |
| 62 | def 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) |
nothing calls this directly
no test coverage detected