{
  "components": {
    "schemas": {
      "CacheStatusResponse": {
        "properties": {
          "last_synced": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Synced"
          },
          "maintenance_allowlist": {
            "items": {
              "type": "string"
            },
            "title": "Maintenance Allowlist",
            "type": "array"
          },
          "table_count": {
            "title": "Table Count",
            "type": "integer"
          }
        },
        "required": [
          "last_synced",
          "table_count",
          "maintenance_allowlist"
        ],
        "title": "CacheStatusResponse",
        "type": "object"
      },
      "FileStatsResponse": {
        "properties": {
          "avg_file_size_bytes": {
            "title": "Avg File Size Bytes",
            "type": "number"
          },
          "small_file_count": {
            "title": "Small File Count",
            "type": "integer"
          },
          "small_file_pct": {
            "title": "Small File Pct",
            "type": "number"
          },
          "total_data_files": {
            "title": "Total Data Files",
            "type": "integer"
          },
          "total_delete_files": {
            "title": "Total Delete Files",
            "type": "integer"
          },
          "total_size_bytes": {
            "title": "Total Size Bytes",
            "type": "integer"
          }
        },
        "required": [
          "total_data_files",
          "total_delete_files",
          "total_size_bytes",
          "avg_file_size_bytes",
          "small_file_count",
          "small_file_pct"
        ],
        "title": "FileStatsResponse",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "HealthResponse": {
        "properties": {
          "effective_cadence_hours": {
            "title": "Effective Cadence Hours",
            "type": "integer"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "file_stats": {
            "$ref": "#/components/schemas/FileStatsResponse"
          },
          "health_status": {
            "default": "Unknown",
            "title": "Health Status",
            "type": "string"
          },
          "hours_since_last_snapshot": {
            "default": 0.0,
            "title": "Hours Since Last Snapshot",
            "type": "number"
          },
          "maintenance_cadence_hours": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maintenance Cadence Hours"
          },
          "maintenance_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maintenance Enabled"
          },
          "manifest_count": {
            "title": "Manifest Count",
            "type": "integer"
          },
          "needs_maintenance": {
            "title": "Needs Maintenance",
            "type": "boolean"
          },
          "oldest_snapshot_age_hours": {
            "default": 0.0,
            "title": "Oldest Snapshot Age Hours",
            "type": "number"
          },
          "opt_in_mode": {
            "title": "Opt In Mode",
            "type": "boolean"
          },
          "recommended_actions": {
            "items": {
              "type": "string"
            },
            "title": "Recommended Actions",
            "type": "array"
          },
          "snapshot_count": {
            "title": "Snapshot Count",
            "type": "integer"
          },
          "snapshot_id": {
            "default": 0,
            "title": "Snapshot Id",
            "type": "integer"
          },
          "snowpack_config": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Snowpack Config",
            "type": "object"
          },
          "table": {
            "$ref": "#/components/schemas/TableDetailResponse"
          },
          "total_records": {
            "default": 0,
            "title": "Total Records",
            "type": "integer"
          }
        },
        "required": [
          "table",
          "file_stats",
          "snapshot_count",
          "manifest_count",
          "recommended_actions",
          "needs_maintenance",
          "maintenance_enabled",
          "maintenance_cadence_hours",
          "opt_in_mode",
          "effective_cadence_hours",
          "snowpack_config",
          "error"
        ],
        "title": "HealthResponse",
        "type": "object"
      },
      "JobResponse": {
        "properties": {
          "actions": {
            "items": {
              "type": "string"
            },
            "title": "Actions",
            "type": "array"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "database": {
            "title": "Database",
            "type": "string"
          },
          "dry_run": {
            "title": "Dry Run",
            "type": "boolean"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "job_id": {
            "title": "Job Id",
            "type": "string"
          },
          "results": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/MaintenanceActionResult"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Results"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "submitted_at": {
            "title": "Submitted At",
            "type": "string"
          },
          "table_name": {
            "title": "Table Name",
            "type": "string"
          }
        },
        "required": [
          "job_id",
          "database",
          "table_name",
          "actions",
          "dry_run",
          "status",
          "submitted_at",
          "started_at",
          "completed_at",
          "results",
          "error"
        ],
        "title": "JobResponse",
        "type": "object"
      },
      "MaintenanceActionResult": {
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "elapsed_seconds": {
            "title": "Elapsed Seconds",
            "type": "number"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "action",
          "success",
          "message",
          "error",
          "elapsed_seconds"
        ],
        "title": "MaintenanceActionResult",
        "type": "object"
      },
      "MaintenanceRequest": {
        "properties": {
          "actions": {
            "items": {
              "type": "string"
            },
            "title": "Actions",
            "type": "array"
          },
          "dry_run": {
            "default": false,
            "title": "Dry Run",
            "type": "boolean"
          }
        },
        "required": [
          "actions"
        ],
        "title": "MaintenanceRequest",
        "type": "object"
      },
      "OrchestratorRunRequest": {
        "properties": {
          "completed_at": {
            "title": "Completed At",
            "type": "string"
          },
          "dry_run": {
            "default": false,
            "title": "Dry Run",
            "type": "boolean"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "jobs_completed": {
            "default": 0,
            "title": "Jobs Completed",
            "type": "integer"
          },
          "jobs_failed": {
            "default": 0,
            "title": "Jobs Failed",
            "type": "integer"
          },
          "jobs_submitted": {
            "default": 0,
            "title": "Jobs Submitted",
            "type": "integer"
          },
          "started_at": {
            "title": "Started At",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tables_assessed": {
            "default": 0,
            "title": "Tables Assessed",
            "type": "integer"
          },
          "tables_healthy": {
            "default": 0,
            "title": "Tables Healthy",
            "type": "integer"
          },
          "tables_skipped": {
            "default": 0,
            "title": "Tables Skipped",
            "type": "integer"
          }
        },
        "required": [
          "started_at",
          "completed_at",
          "status"
        ],
        "title": "OrchestratorRunRequest",
        "type": "object"
      },
      "TableDetailResponse": {
        "properties": {
          "database": {
            "title": "Database",
            "type": "string"
          },
          "format_version": {
            "title": "Format Version",
            "type": "integer"
          },
          "location": {
            "title": "Location",
            "type": "string"
          },
          "table_name": {
            "title": "Table Name",
            "type": "string"
          }
        },
        "required": [
          "database",
          "table_name",
          "location",
          "format_version"
        ],
        "title": "TableDetailResponse",
        "type": "object"
      },
      "TableResponse": {
        "properties": {
          "database": {
            "title": "Database",
            "type": "string"
          },
          "in_maintenance_allowlist": {
            "title": "In Maintenance Allowlist",
            "type": "boolean"
          },
          "table_name": {
            "title": "Table Name",
            "type": "string"
          }
        },
        "required": [
          "database",
          "table_name",
          "in_maintenance_allowlist"
        ],
        "title": "TableResponse",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    }
  },
  "info": {
    "title": "Snowpack",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/healthz": {
      "get": {
        "operationId": "healthz_healthz_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Healthz Healthz Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Healthz"
      }
    },
    "/jobs": {
      "get": {
        "operationId": "list_jobs_jobs_get",
        "parameters": [
          {
            "in": "query",
            "name": "table",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Table"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/JobResponse"
                  },
                  "title": "Response List Jobs Jobs Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Jobs"
      }
    },
    "/jobs/history": {
      "get": {
        "operationId": "list_job_history_jobs_history_get",
        "parameters": [
          {
            "in": "query",
            "name": "table",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Table"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "title": "Response List Job History Jobs History Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Job History"
      }
    },
    "/jobs/history/health": {
      "get": {
        "operationId": "list_health_history_jobs_history_health_get",
        "parameters": [
          {
            "in": "query",
            "name": "table",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Table"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "title": "Response List Health History Jobs History Health Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Health History"
      }
    },
    "/jobs/history/prune": {
      "post": {
        "operationId": "prune_history_jobs_history_prune_post",
        "parameters": [
          {
            "in": "query",
            "name": "retention_days",
            "required": false,
            "schema": {
              "default": 90,
              "minimum": 1,
              "title": "Retention Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "integer"
                  },
                  "title": "Response Prune History Jobs History Prune Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Prune History"
      }
    },
    "/jobs/{job_id}": {
      "delete": {
        "operationId": "delete_job_jobs__job_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Job"
      },
      "get": {
        "operationId": "get_job_jobs__job_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Job"
      }
    },
    "/jobs/{job_id}/cancel": {
      "post": {
        "operationId": "cancel_job_jobs__job_id__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Cancel Job"
      }
    },
    "/orchestrator/runs": {
      "get": {
        "operationId": "list_orchestrator_runs_orchestrator_runs_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "title": "Response List Orchestrator Runs Orchestrator Runs Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Orchestrator Runs"
      },
      "post": {
        "operationId": "create_orchestrator_run_orchestrator_runs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrchestratorRunRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Create Orchestrator Run Orchestrator Runs Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Orchestrator Run"
      }
    },
    "/readyz": {
      "get": {
        "operationId": "readyz_readyz_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Readyz"
      }
    },
    "/tables": {
      "get": {
        "operationId": "list_tables_tables_get",
        "parameters": [
          {
            "in": "query",
            "name": "database",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Database"
            }
          },
          {
            "in": "query",
            "name": "maintenance_enabled",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Maintenance Enabled"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TableResponse"
                  },
                  "title": "Response List Tables Tables Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tables"
      }
    },
    "/tables/cache-status": {
      "get": {
        "operationId": "cache_status_tables_cache_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CacheStatusResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Cache Status"
      }
    },
    "/tables/{database}/{table}/health": {
      "get": {
        "operationId": "get_table_health_tables__database___table__health_get",
        "parameters": [
          {
            "in": "path",
            "name": "database",
            "required": true,
            "schema": {
              "title": "Database",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "title": "Table",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Table Health"
      }
    },
    "/tables/{database}/{table}/health/cached": {
      "get": {
        "operationId": "get_cached_health_tables__database___table__health_cached_get",
        "parameters": [
          {
            "in": "path",
            "name": "database",
            "required": true,
            "schema": {
              "title": "Database",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "title": "Table",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Cached Health Tables  Database   Table  Health Cached Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Cached Health"
      }
    },
    "/tables/{database}/{table}/maintenance": {
      "post": {
        "operationId": "submit_maintenance_tables__database___table__maintenance_post",
        "parameters": [
          {
            "in": "path",
            "name": "database",
            "required": true,
            "schema": {
              "title": "Database",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "title": "Table",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Maintenance"
      }
    }
  }
}
