Skip to main content

RunClientAsync

apify_client.clients.RunClientAsync

Async sub-client for manipulating a single actor run.

Index

Methods

abort

  • async abort(*, gracefully): dict
  • Abort the actor run which is starting or currently running and return its details.

    https://docs.apify.com/api/v2#/reference/actor-runs/abort-run/abort-run


    Parameters

    • gracefully: bool | None = Nonekeyword-only

      If True, the actor run will abort gracefully. It will send `aborting` and `persistStates` events into the run and force-stop the run after 30 seconds. It is helpful in cases where you plan to resurrect the run later.

    Returns dict

    The data of the aborted actor run

dataset

delete

  • async delete(): None

get

  • async get(): dict | None

key_value_store

log

metamorph

  • async metamorph(*, target_actor_id, target_actor_build, run_input, content_type): dict
  • Transform an actor run into a run of another actor with a new input.

    https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run/metamorph-run


    Parameters

    • target_actor_id: strkeyword-only

      ID of the target actor that the run should be transformed into

    • target_actor_build: str | None = Nonekeyword-only

      The build of the target actor. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target actor (typically the latest build).

    • run_input: Any = Nonekeyword-only

      The input to pass to the new run.

    • content_type: str | None = Nonekeyword-only

      The content type of the input.

    Returns dict

    The actor run data.

reboot

  • async reboot(): dict

request_queue

resurrect

  • async resurrect(*, build, memory_mbytes, timeout_secs): dict
  • Resurrect a finished actor run.

    Only finished runs, i.e. runs with status FINISHED, FAILED, ABORTED and TIMED-OUT can be resurrected. Run status will be updated to RUNNING and its container will be restarted with the same default storages.

    https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run/resurrect-run


    Parameters

    • build: str | None = Nonekeyword-only

      Which actor build the resurrected run should use. It can be either a build tag or build number. By default, the resurrected run uses the same build as before.

    • memory_mbytes: int | None = Nonekeyword-only

      New memory limit for the resurrected run, in megabytes. By default, the resurrected run uses the same memory limit as before.

    • timeout_secs: int | None = Nonekeyword-only

      New timeout for the resurrected run, in seconds. By default, the resurrected run uses the same timeout as before.

    Returns dict

    The actor run data.

update

  • async update(*, status_message, is_status_message_terminal): dict

  • Parameters

    • status_message: str | None = Nonekeyword-only

      The new status message for the run

    • is_status_message_terminal: bool | None = Nonekeyword-only

      Set this flag to True if this is the final status message of the Actor run.

    Returns dict

    The updated run

wait_for_finish

  • async wait_for_finish(*, wait_secs): dict | None
  • Wait synchronously until the run finishes or the server times out.


    Parameters

    • wait_secs: int | None = Nonekeyword-only

      how long does the client wait for run to finish. None for indefinite.

    Returns dict | None

    The actor run data. If the status on the object is not one of the terminal statuses (SUCEEDED, FAILED, TIMED_OUT, ABORTED), then the run has not yet finished.