File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,10 @@ async def execute_command(
163163 command = Command (command )
164164 return await self .execute_commands (device_url , [command ], label )
165165
166+ async def cancel_command (self , exec_id : str ) -> None :
167+ """ Cancel a running setup-level execution """
168+ await self .__delete (f"/exec/current/setup/{ exec_id } " )
169+
166170 async def execute_commands (
167171 self ,
168172 device_url : str ,
@@ -203,6 +207,11 @@ async def __post(
203207 await self .check_response (response )
204208 return await response .json ()
205209
210+ async def __delete (self , endpoint : str ) -> None :
211+ """ Make a DELETE request to the TaHoma API """
212+ async with self .session .delete (f"{ self .api_url } { endpoint } " ) as response :
213+ await self .check_response (response )
214+
206215 @staticmethod
207216 async def check_response (response : ClientResponse ) -> None :
208217 """ Check the response returned by the TaHoma API"""
You can’t perform that action at this time.
0 commit comments