| 1 | import type { SafeAny } from "./common.d" |
| 2 | |
| 3 | export interface SnapshotRepository { |
| 4 | name: string |
| 5 | type: string |
| 6 | settings: Record<string, SafeAny> |
| 7 | } |
| 8 | |
| 9 | export interface SnapshotRepositoryListResponse { |
| 10 | repositories: SnapshotRepository[] |
| 11 | success: boolean |
| 12 | message: string |
| 13 | } |
| 14 | |
| 15 | export interface SnapshotShardStatus { |
| 16 | stage: string |
| 17 | total_files?: number |
| 18 | total_size_in_bytes?: number |
| 19 | processed_files?: number |
| 20 | processed_size_in_bytes?: number |
| 21 | } |
| 22 | |
| 23 | export interface SnapshotIndexStatus { |
| 24 | shards_stats: Record<string, any> |
| 25 | stats: Record<string, any> |
| 26 | shards: Record<string, SnapshotShardStatus> |
| 27 | } |
| 28 | |
| 29 | export interface SnapshotStatus { |
| 30 | snapshot: string |
| 31 | repository: string |
| 32 | uuid?: string |
| 33 | state: string |
| 34 | include_global_state?: boolean |
| 35 | shards_stats: Record<string, any> |
| 36 | stats: Record<string, any> |
| 37 | indices: Record<string, SnapshotIndexStatus> |
| 38 | } |
| 39 | |
| 40 | export interface SnapshotStatusResponse { |
| 41 | snapshots: SnapshotStatus[] |
| 42 | success: boolean |
| 43 | message: string |
| 44 | } |
| 45 | |
| 46 | export interface SnapshotInfo { |
| 47 | snapshot: string |
| 48 | uuid?: string |
| 49 | version_id?: number |
| 50 | version?: string |
| 51 | indices: string[] |
| 52 | include_global_state?: boolean |
| 53 | state: string |
| 54 | start_time?: string |
| 55 | start_time_in_millis?: number |
| 56 | end_time?: string |
| 57 | end_time_in_millis?: number |
| 58 | duration_in_millis?: number |
| 59 | failures: Record<string, any>[] |
| 60 | shards: Record<string, any> |
| 61 | } |
| 62 | |
| 63 | export interface SnapshotListResponse { |
| 64 | repository: string |
| 65 | snapshots: SnapshotInfo[] |
| 66 | success: boolean |
| 67 | message: string |
| 68 | } |
| 69 | |
| 70 | export interface RestoreSnapshotRequest { |
| 71 | repository: string |
| 72 | snapshot: string |
| 73 | indices?: string[] |
| 74 | ignore_unavailable?: boolean |
| 75 | include_global_state?: boolean |
| 76 | rename_pattern?: string |
| 77 | rename_replacement?: string |
| 78 | include_aliases?: boolean |
| 79 | partial?: boolean |
| 80 | } |
| 81 | |
| 82 | export interface RestoreShardInfo { |
| 83 | total: number |
| 84 | failed: number |
| 85 | successful: number |
| 86 | } |
| 87 | |
| 88 | export interface RestoreSnapshotResponse { |
| 89 | snapshot: string |
| 90 | repository: string |
| 91 | indices: string[] |
| 92 | shards: RestoreShardInfo |
| 93 | success: boolean |
| 94 | message: string |
| 95 | } |
| 96 | |
| 97 | export interface CreateSnapshotRequest { |
| 98 | repository: string |
| 99 | snapshot: string |
| 100 | indices?: string[] |
| 101 | ignore_unavailable?: boolean |
| 102 | include_global_state?: boolean |
| 103 | partial?: boolean |
| 104 | wait_for_completion?: boolean |
| 105 | metadata?: Record<string, any> |
| 106 | skip_write_indices?: boolean |
| 107 | } |
| 108 | |
| 109 | export interface CreateSnapshotResponse { |
| 110 | snapshot: string |
| 111 | repository: string |
| 112 | uuid?: string |
| 113 | state?: string |
| 114 | indices: string[] |
| 115 | skipped_write_indices: string[] |
| 116 | shards?: RestoreShardInfo |
| 117 | accepted: boolean |
| 118 | success: boolean |
| 119 | message: string |
| 120 | } |
| 121 | |
| 122 | // Snapshot Schedule Types |
| 123 | export interface SnapshotScheduleCreate { |
| 124 | name: string |
| 125 | index_pattern: string |
| 126 | repository: string |
| 127 | enabled?: boolean |
| 128 | snapshot_prefix?: string |
| 129 | include_global_state?: boolean |
| 130 | skip_write_indices?: boolean |
| 131 | retention_days?: number | null |
| 132 | scheduled_hour?: number | null |
| 133 | scheduled_minute?: number | null |
| 134 | interval_days?: number |
| 135 | day_of_week?: number | null |
| 136 | timezone?: string |
| 137 | } |
| 138 | |
| 139 | export interface SnapshotScheduleUpdate { |
| 140 | name?: string |
| 141 | index_pattern?: string |
| 142 | repository?: string |
| 143 | enabled?: boolean |
| 144 | snapshot_prefix?: string |
| 145 | include_global_state?: boolean |
| 146 | skip_write_indices?: boolean |
| 147 | retention_days?: number | null |
| 148 | scheduled_hour?: number | null |
| 149 | scheduled_minute?: number | null |
| 150 | interval_days?: number |
| 151 | day_of_week?: number | null |
| 152 | timezone?: string |
| 153 | } |
| 154 | |
| 155 | export interface SnapshotScheduleResponse { |
| 156 | id: number |
| 157 | name: string |
| 158 | index_pattern: string |
| 159 | repository: string |
| 160 | enabled: boolean |
| 161 | snapshot_prefix: string |
| 162 | include_global_state: boolean |
| 163 | skip_write_indices: boolean |
| 164 | retention_days?: number | null |
| 165 | last_execution_time?: string | null |
| 166 | last_snapshot_name?: string | null |
| 167 | last_execution_status?: string | null |
| 168 | scheduled_hour?: number | null |
| 169 | scheduled_minute?: number | null |
| 170 | interval_days: number |
| 171 | day_of_week?: number | null |
| 172 | timezone: string |
| 173 | created_at: string |
| 174 | updated_at: string |
| 175 | } |
| 176 | |
| 177 | export interface SnapshotScheduleListResponse { |
| 178 | schedules: SnapshotScheduleResponse[] |
| 179 | success: boolean |
| 180 | message: string |
| 181 | } |
| 182 | |
| 183 | export interface SnapshotScheduleOperationResponse { |
| 184 | schedule?: SnapshotScheduleResponse | null |
| 185 | success: boolean |
| 186 | message: string |
| 187 | } |
| 188 | |
| 189 | export interface ScheduledSnapshotExecutionResponse { |
| 190 | schedule_id: number |
| 191 | schedule_name: string |
| 192 | snapshot_name?: string | null |
| 193 | indices_snapshotted: string[] |
| 194 | skipped_write_indices: string[] |
| 195 | already_snapshotted_indices: string[] |
| 196 | success: boolean |
| 197 | message: string |
| 198 | } |