# Return active WordPress installs

This function lists the WordPress installs that are still queued or
running for the account. It joins each queued install task to the run's
progress log, so status is the value get_task_progress reports.

  Note:

  * This function reads the task queue without taking element locks, so
    it never fails or blocks when another reader or the task runner
    briefly holds an element.
  * A task that is queued but has not written a log line yet reports
    unknown with a percentage of 0.
  * An element in the queue is not proof that an install is in flight. If
    the task runner dies mid-install (reboot, OOM kill) the element stays
    in the queue until the account queues another task. The function
    reports such a row as stale when its log says running but the
    runner's pid file names a process that is gone or is not a task
    runner.
  * A finished install leaves the queue when the runner completes it. It
    can appear once with complete or failed in the short window
    before that removal.
  * The rows need no ownership check: the queue and the logs live in
    the caller's own home directory, so the caller can only ever see
    its own installs.

Endpoint: GET /WPX/list_active_installs
Version: 11.138.0.19
Security: BasicAuth

## Query parameters:

  - `domain` (string)
    Return only the installs for this domain. Omit it to return every active install for the account. The domain must belong to the account; if it doesn't, the function returns an error instead of an empty list.
    Example: "example.com"

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "list_active_installs"

  - `module` (string)
    The name of the module called.
    Example: "WPX"

  - `result` (object)

  - `result.data` (array)
    The WordPress installs that are still queued or running for the account, one row per install.

  - `result.data.domain` (string)
    The domain the install targets, lower-cased.
    Example: "example.com"

  - `result.data.install_id` (string)
    The run's correlator. Poll get_task_progress with it.
    Example: "1784237244-988110-12345"

  - `result.data.message` (string)
    The last progress message from the run's log. Empty when the run has not written a log line yet.
    Example: "Installing WordPress"

  - `result.data.percentage` (integer)
    The monotonic progress percentage from the run's log. 0 when the run has not written a log line yet.
    Example: 42

  - `result.data.sse_url` (string)
    The /sse/UserTasks/ stream for the run.
    Example: "/sse/UserTasks/00000000_63d7f020927f8f/wpx_install_1784237244-988110-12345.log"

  - `result.data.status` (string)
    The run's state, as get_task_progress reports it.
* unknown - The task is queued but has not written a log line yet.
* running - The install is in progress.
* stale - The log says the install is running but its task runner is no longer alive. The install will not finish; treat it like failed and offer a retry.
* complete - The install finished. The task is about to leave the queue.
* failed - The install failed. The task is about to leave the queue.
    Enum: "unknown", "running", "stale", "complete", "failed"

  - `result.data.task_id` (string)
    The queue element id, as create_website returned it.
    Example: "00000000/63d7f020927f8f"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    - 1 - Success.
- 0 - Failed: Check the errors field for more details.
    Enum: 1, 0

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.


