MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / execute_command

Function execute_command

keepercommander/service/api/command.py:132–145  ·  view source on GitHub ↗

Submit a command for execution and return request ID immediately.

(**kwargs)

Source from the content-addressed store, hash-verified

130 @bp.route("/executecommand-async", methods=["POST"])
131 @unified_api_decorator()
132 def execute_command(**kwargs) -> Tuple[Response, int]:
133 """Submit a command for execution and return request ID immediately."""
134 temp_files = []
135 try:
136 processed_command, temp_files, request_error = _prepare_command_request()
137 if request_error:
138 return request_error
139
140 response_data, _ = _submit_queue_request(processed_command, temp_files, wait_for_completion=False)
141 return response_data
142 except Exception as e:
143 logger.error(f"Error submitting request: {e}")
144 RequestValidator.cleanup_temp_files(temp_files)
145 return jsonify({"status": "error", "error": f"{str(e)}"}), 500
146
147 @bp.route("/status/<request_id>", methods=["GET"])
148 @unified_api_decorator()

Callers

nothing calls this directly

Calls 4

_prepare_command_requestFunction · 0.85
_submit_queue_requestFunction · 0.85
cleanup_temp_filesMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected