client.scripts.list_sql_runs

A method of the Scripts endpoint.

list_sql_runs(id: int, *, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) ListResponse | PaginatedResponse

List runs for the given SQL job

API URL: GET /scripts/sql/{id}/runs

import civis
client = civis.APIClient()
response = client.scripts.list_sql_runs(...)
Parameters:
idint

The ID of the SQL job.

limitint, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to desc.

iteratorbool, optional

If True, return a generator (specifically, a civis.PaginatedResponse object) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return a civis.ListResponse object (= a list of civis.Response objects), whose size is determined by ‘limit’. Defaults to False.

Returns:
civis.ListResponse | civis.PaginatedResponse
  • idint

    The ID of the run.

  • sql_idint

    The ID of the SQL job.

  • statestr

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedbool

    True if run cancel requested, else false.

  • created_atstr (time)

    The time the run was created.

  • started_atstr (time)

    The time the run started at.

  • finished_atstr (time)

    The time the run completed.

  • errorstr

    The error, if any, returned by the run.

  • outputList[civis.Response]

    A list of the outputs of this script.

    • output_namestr

      The name of the output file.

    • file_idint

      The unique ID of the output file.

    • pathstr

      The temporary link to download this output file, valid for 36 hours.

  • output_cached_onstr (time)

    The time that the output was originally exported, if a cache entry was used by the run.