POST /management/cache/invalidate. ``auth`` defaults to admin credentials; pass a tuple to test auth gating.
(
self,
scope: str,
selectors: dict | None = None,
*,
auth=None,
)
| 397 | # -- Cache (admin break-glass) -- |
| 398 | |
| 399 | def invalidate_cache( |
| 400 | self, |
| 401 | scope: str, |
| 402 | selectors: dict | None = None, |
| 403 | *, |
| 404 | auth=None, |
| 405 | ) -> requests.Response: |
| 406 | """POST /management/cache/invalidate. |
| 407 | |
| 408 | ``auth`` defaults to admin credentials; pass a tuple to test auth gating. |
| 409 | """ |
| 410 | body = {"scope": scope, "selectors": selectors or {}} |
| 411 | return requests.post( |
| 412 | f"{self.base_url}/cache/invalidate", |
| 413 | json=body, |
| 414 | auth=auth or self.admin_auth, |
| 415 | timeout=self.timeout, verify=self.verify, |
| 416 | ) |