Skip to main content
  • Submits a request to any endpoint as a job: /create/job, then /get/job until it finishes, whether or not the endpoint is in job_endpoints.

    For long-running endpoints without a generated method, such as /rebuild_db or /admin/rebalance, where holding one HTTP request open for the duration would outlast a proxy. The response is the endpoint’s own, unwrapped from the job. Jobs poll, so the call is always asynchronous, even in the standalone build; job_timeout bounds it.

    Type Parameters

    • T = Record<string, any>

    Parameters

    • endpoint: string

      The endpoint path, such as /rebuild_db

    • request: string | Record<string, any>

      The request object, matching the endpoint’s schema; a JSON string is accepted too, as the JavaScript API took one

    • Optionalcallback: GPUdbCallback

      Optional callback function

    Returns Promise<T>

    Promise resolving to the endpoint’s response