Patch safekeeper control file on HTTP request (#6455)

Closes #6397
This commit is contained in:
Arthur Petukhovsky
2024-01-29 18:20:57 +00:00
committed by GitHub
parent ec8dcc2231
commit 2ff1a5cecd
6 changed files with 191 additions and 1 deletions
+18
View File
@@ -3443,6 +3443,24 @@ class SafekeeperHttpClient(requests.Session):
assert isinstance(res_json, dict)
return res_json
def patch_control_file(
self,
tenant_id: TenantId,
timeline_id: TimelineId,
patch: Dict[str, Any],
) -> Dict[str, Any]:
res = self.patch(
f"http://localhost:{self.port}/v1/tenant/{tenant_id}/timeline/{timeline_id}/control_file",
json={
"updates": patch,
"apply_fields": list(patch.keys()),
},
)
res.raise_for_status()
res_json = res.json()
assert isinstance(res_json, dict)
return res_json
def pull_timeline(self, body: Dict[str, Any]) -> Dict[str, Any]:
res = self.post(f"http://localhost:{self.port}/v1/pull_timeline", json=body)
res.raise_for_status()