diff --git a/docs/docs.md b/docs/docs.md index 1e04f712..ae9161cf 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -1964,6 +1964,7 @@ Sub-client for manipulating a single actor run. * [wait\_for\_finish()](#runclient-wait\_for\_finish) * [metamorph()](#runclient-metamorph) * [resurrect()](#runclient-resurrect) +* [reboot()](#runclient-reboot) * [dataset()](#runclient-dataset) * [key\_value\_store()](#runclient-key\_value\_store) * [request\_queue()](#runclient-request\_queue) @@ -2108,6 +2109,22 @@ Run status will be updated to RUNNING and its container will be restarted with t *** +#### [](#runclient-reboot) `RunClient.reboot()` + +Reboot an Actor run. Only runs that are running, i.e. runs with status RUNNING can be rebooted. + +[https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run](https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run) + +* **Returns** + + The Actor run data. + +* **Return type** + + `dict` + +*** + #### [](#runclient-dataset) `RunClient.dataset()` Get the client for the default dataset of the actor run. @@ -4416,6 +4433,7 @@ Async sub-client for manipulating a single actor run. * [async wait\_for\_finish()](#runclientasync-wait\_for\_finish) * [async metamorph()](#runclientasync-metamorph) * [async resurrect()](#runclientasync-resurrect) +* [async reboot()](#runclientasync-reboot) * [dataset()](#runclientasync-dataset) * [key\_value\_store()](#runclientasync-key\_value\_store) * [request\_queue()](#runclientasync-request\_queue) @@ -4560,6 +4578,22 @@ Run status will be updated to RUNNING and its container will be restarted with t *** +#### [](#runclientasync-reboot) `async RunClientAsync.reboot()` + +Reboot an Actor run. Only runs that are running, i.e. runs with status RUNNING can be rebooted. + +[https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run](https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run) + +* **Returns** + + The Actor run data. + +* **Return type** + + `dict` + +*** + #### [](#runclientasync-dataset) `RunClientAsync.dataset()` Get the client for the default dataset of the actor run. diff --git a/src/apify_client/clients/resource_clients/run.py b/src/apify_client/clients/resource_clients/run.py index 3cf29b58..5811aaa7 100644 --- a/src/apify_client/clients/resource_clients/run.py +++ b/src/apify_client/clients/resource_clients/run.py @@ -155,6 +155,20 @@ def resurrect( return parse_date_fields(_pluck_data(response.json())) + def reboot(self) -> Dict: + """Reboot an Actor run. Only runs that are running, i.e. runs with status RUNNING can be rebooted. + + https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run + + Returns: + dict: The Actor run data. + """ + response = self.http_client.call( + url=self._url('reboot'), + method='POST', + ) + return parse_date_fields(_pluck_data(response.json())) + def dataset(self) -> DatasetClient: """Get the client for the default dataset of the actor run. @@ -349,6 +363,20 @@ async def resurrect( return parse_date_fields(_pluck_data(response.json())) + async def reboot(self) -> Dict: + """Reboot an Actor run. Only runs that are running, i.e. runs with status RUNNING can be rebooted. + + https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run + + Returns: + dict: The Actor run data. + """ + response = await self.http_client.call( + url=self._url('reboot'), + method='POST', + ) + return parse_date_fields(_pluck_data(response.json())) + def dataset(self) -> DatasetClientAsync: """Get the client for the default dataset of the actor run.