39 lines
1.2 KiB
Markdown
39 lines
1.2 KiB
Markdown
# API Contracts: 012-remove-superset-tool
|
|
|
|
## SupersetClient Internal API
|
|
|
|
The `SupersetClient` will provide the following methods for internal backend use:
|
|
|
|
### `get_dashboards(query: Optional[Dict] = None) -> Tuple[int, List[Dict]]`
|
|
- **Purpose**: Fetches paginated dashboards.
|
|
- **Contract**:
|
|
- `query`: Optional filters and pagination parameters.
|
|
- Returns: `(total_count, dashboard_list)`.
|
|
|
|
### `export_dashboard(dashboard_id: int) -> Tuple[bytes, str]`
|
|
- **Purpose**: Exports a dashboard as a ZIP file.
|
|
- **Contract**:
|
|
- `dashboard_id`: ID of the dashboard.
|
|
- Returns: `(zip_content, filename)`.
|
|
|
|
### `import_dashboard(file_name: Union[str, Path], dash_id: Optional[int] = None, dash_slug: Optional[str] = None) -> Dict`
|
|
- **Purpose**: Imports a dashboard from a ZIP file.
|
|
- **Contract**:
|
|
- `file_name`: Path to ZIP.
|
|
- `dash_id`/`dash_slug`: Optional identifiers for delete-retry logic.
|
|
- Returns: API response dictionary.
|
|
|
|
## Configuration Models (Pydantic)
|
|
|
|
### `Environment`
|
|
```python
|
|
class Environment(BaseModel):
|
|
id: str
|
|
name: str
|
|
url: str
|
|
username: str
|
|
password: str
|
|
verify_ssl: bool = True
|
|
timeout: int = 30
|
|
is_default: bool = False
|
|
backup_schedule: Schedule = Field(default_factory=Schedule) |