|
41 | 41 |
|
42 | 42 |
|
43 | 43 | class SearchIndexManager(SearchIndexManagerLogic):
|
44 |
| - def __init__(self, connection, loop): |
| 44 | + def __init__(self, |
| 45 | + connection, |
| 46 | + loop |
| 47 | + ): |
45 | 48 | super().__init__(connection)
|
46 | 49 | self._loop = loop
|
47 | 50 |
|
@@ -167,3 +170,141 @@ def get_all_index_stats(self,
|
167 | 170 | **kwargs # type: Dict[str, Any]
|
168 | 171 | ) -> Awaitable[Dict[str, Any]]:
|
169 | 172 | super().get_all_index_stats(*options, **kwargs)
|
| 173 | + |
| 174 | + |
| 175 | +class ScopeSearchIndexManager(SearchIndexManagerLogic): |
| 176 | + """ |
| 177 | + **VOLATILE** This API is subject to change at any time. |
| 178 | + """ |
| 179 | + |
| 180 | + def __init__(self, |
| 181 | + connection, |
| 182 | + loop, |
| 183 | + bucket_name, # type: str |
| 184 | + scope_name # type: str |
| 185 | + ): |
| 186 | + super().__init__(connection, bucket_name=bucket_name, scope_name=scope_name) |
| 187 | + self._loop = loop |
| 188 | + |
| 189 | + @property |
| 190 | + def loop(self): |
| 191 | + """ |
| 192 | + **INTERNAL** |
| 193 | + """ |
| 194 | + return self._loop |
| 195 | + |
| 196 | + @AsyncMgmtWrapper.inject_callbacks(None, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 197 | + def upsert_index(self, |
| 198 | + index, # type: SearchIndex |
| 199 | + *options, # type: UpsertSearchIndexOptions |
| 200 | + **kwargs # type: Dict[str, Any] |
| 201 | + ) -> Awaitable[None]: |
| 202 | + |
| 203 | + super().upsert_index(index, *options, **kwargs) |
| 204 | + |
| 205 | + @AsyncMgmtWrapper.inject_callbacks(None, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 206 | + def drop_index(self, |
| 207 | + index_name, # type: str |
| 208 | + *options, # type: DropSearchIndexOptions |
| 209 | + **kwargs # type: Dict[str, Any] |
| 210 | + ) -> Awaitable[None]: |
| 211 | + |
| 212 | + super().drop_index(index_name, *options, **kwargs) |
| 213 | + |
| 214 | + @AsyncMgmtWrapper.inject_callbacks(SearchIndex, ManagementType.SearchIndexMgmt, |
| 215 | + SearchIndexManagerLogic._ERROR_MAPPING) |
| 216 | + def get_index(self, |
| 217 | + index_name, # type: str |
| 218 | + *options, # type: GetSearchIndexOptions |
| 219 | + **kwargs # type: Dict[str, Any] |
| 220 | + ) -> Awaitable[SearchIndex]: |
| 221 | + |
| 222 | + super().get_index(index_name, *options, **kwargs) |
| 223 | + |
| 224 | + @AsyncMgmtWrapper.inject_callbacks(SearchIndex, ManagementType.SearchIndexMgmt, |
| 225 | + SearchIndexManagerLogic._ERROR_MAPPING) |
| 226 | + def get_all_indexes(self, |
| 227 | + *options, # type: GetAllSearchIndexesOptions |
| 228 | + **kwargs # type: Dict[str, Any] |
| 229 | + ) -> Awaitable[Iterable[SearchIndex]]: |
| 230 | + super().get_all_indexes(*options, **kwargs) |
| 231 | + |
| 232 | + @AsyncMgmtWrapper.inject_callbacks(int, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 233 | + def get_indexed_documents_count(self, |
| 234 | + index_name, # type: str |
| 235 | + *options, # type: GetSearchIndexedDocumentsCountOptions |
| 236 | + **kwargs # type: Dict[str, Any] |
| 237 | + ) -> Awaitable[int]: |
| 238 | + super().get_indexed_documents_count(index_name, *options, **kwargs) |
| 239 | + |
| 240 | + @AsyncMgmtWrapper.inject_callbacks(None, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 241 | + def pause_ingest(self, |
| 242 | + index_name, # type: str |
| 243 | + *options, # type: PauseIngestSearchIndexOptions |
| 244 | + **kwargs # type: Dict[str, Any] |
| 245 | + ) -> Awaitable[None]: |
| 246 | + super().pause_ingest(index_name, *options, **kwargs) |
| 247 | + |
| 248 | + @AsyncMgmtWrapper.inject_callbacks(None, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 249 | + def resume_ingest(self, |
| 250 | + index_name, # type: str |
| 251 | + *options, # type: ResumeIngestSearchIndexOptions |
| 252 | + **kwargs # type: Dict[str, Any] |
| 253 | + ) -> Awaitable[None]: |
| 254 | + super().resume_ingest(index_name, *options, **kwargs) |
| 255 | + |
| 256 | + @AsyncMgmtWrapper.inject_callbacks(None, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 257 | + def allow_querying(self, |
| 258 | + index_name, # type: str |
| 259 | + *options, # type: AllowQueryingSearchIndexOptions |
| 260 | + **kwargs # type: Dict[str, Any] |
| 261 | + ) -> Awaitable[None]: |
| 262 | + super().allow_querying(index_name, *options, **kwargs) |
| 263 | + |
| 264 | + @AsyncMgmtWrapper.inject_callbacks(None, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 265 | + def disallow_querying(self, |
| 266 | + index_name, # type: str |
| 267 | + *options, # type: DisallowQueryingSearchIndexOptions |
| 268 | + **kwargs # type: Dict[str, Any] |
| 269 | + ) -> Awaitable[None]: |
| 270 | + super().disallow_querying(index_name, *options, **kwargs) |
| 271 | + |
| 272 | + @AsyncMgmtWrapper.inject_callbacks(None, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 273 | + def freeze_plan(self, |
| 274 | + index_name, # type: str |
| 275 | + *options, # type: FreezePlanSearchIndexOptions |
| 276 | + **kwargs # type: Dict[str, Any] |
| 277 | + ) -> Awaitable[None]: |
| 278 | + super().freeze_plan(index_name, *options, **kwargs) |
| 279 | + |
| 280 | + @AsyncMgmtWrapper.inject_callbacks(None, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 281 | + def unfreeze_plan(self, |
| 282 | + index_name, # type: str |
| 283 | + *options, # type: UnfreezePlanSearchIndexOptions |
| 284 | + **kwargs # type: Dict[str, Any] |
| 285 | + ) -> Awaitable[None]: |
| 286 | + super().unfreeze_plan(index_name, *options, **kwargs) |
| 287 | + |
| 288 | + @AsyncMgmtWrapper.inject_callbacks(dict, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 289 | + def analyze_document(self, |
| 290 | + index_name, # type: str |
| 291 | + document, # type: Any |
| 292 | + *options, # type: AnalyzeDocumentSearchIndexOptions |
| 293 | + **kwargs # type: Dict[str, Any] |
| 294 | + ) -> Awaitable[Dict[str, Any]]: |
| 295 | + super().analyze_document(index_name, document, *options, **kwargs) |
| 296 | + |
| 297 | + @AsyncMgmtWrapper.inject_callbacks(dict, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 298 | + def get_index_stats(self, |
| 299 | + index_name, # type: str |
| 300 | + *options, # type: GetSearchIndexStatsOptions |
| 301 | + **kwargs # type: Dict[str, Any] |
| 302 | + ) -> Awaitable[Dict[str, Any]]: |
| 303 | + super().get_index_stats(index_name, *options, **kwargs) |
| 304 | + |
| 305 | + @AsyncMgmtWrapper.inject_callbacks(dict, ManagementType.SearchIndexMgmt, SearchIndexManagerLogic._ERROR_MAPPING) |
| 306 | + def get_all_index_stats(self, |
| 307 | + *options, # type: GetAllSearchIndexStatsOptions |
| 308 | + **kwargs # type: Dict[str, Any] |
| 309 | + ) -> Awaitable[Dict[str, Any]]: |
| 310 | + super().get_all_index_stats(*options, **kwargs) |
0 commit comments