{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/coactive/main/json-schema/coactive-search-metadata-filter-metadata-search-status-response-schema.json",
  "title": "MetadataSearchStatusResponse",
  "description": "Current status of a Databricks job run.",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coactive-search-metadata-filter-api-openapi.yml#/components/schemas/search-metadata-filter_MetadataSearchStatusResponse",
  "type": "object",
  "properties": {
    "run_id": {
      "type": "integer"
    },
    "state": {
      "$ref": "#/$defs/search-metadata-filter_DatabricksLifeCycleState",
      "description": "Current lifecycle state of the run"
    },
    "termination_type": {
      "oneOf": [
        {
          "$ref": "#/$defs/search-metadata-filter_DatabricksTerminationType"
        },
        {
          "type": "null"
        }
      ],
      "description": "Termination type, populated when run is complete"
    },
    "termination_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable termination message from Databricks"
    }
  },
  "required": [
    "run_id",
    "state"
  ],
  "$defs": {
    "search-metadata-filter_DatabricksLifeCycleState": {
      "type": "string",
      "enum": [
        "BLOCKED",
        "PENDING",
        "QUEUED",
        "RUNNING",
        "TERMINATING",
        "TERMINATED",
        "WAITING"
      ],
      "description": "Databricks job run lifecycle states returned in status.state from the runs/get API.\n\nThese are the standard values as documented at:\nhttps://docs.databricks.com/api/workspace/jobs/getrun (see RunStatus > state)\n\nIf Databricks adds or changes values, _parse_lifecycle_state in job.py handles unknown\nvalues gracefully by falling back to PENDING and emitting a warning log.",
      "title": "DatabricksLifeCycleState"
    },
    "search-metadata-filter_DatabricksTerminationType": {
      "type": "string",
      "enum": [
        "SUCCESS",
        "INTERNAL_ERROR",
        "CLIENT_ERROR",
        "CLOUD_FAILURE"
      ],
      "description": "Why a Databricks run terminated, returned in status.termination_details.type.\n\nThese are the standard values as documented at:\nhttps://docs.databricks.com/api/workspace/jobs/getrun (see TerminationDetails > type)\n\nIf Databricks adds or changes values, _parse_termination_type in job.py handles unknown\nvalues gracefully by returning None and emitting a warning log.",
      "title": "DatabricksTerminationType"
    }
  }
}