feat(realm_sync): add plugin for triggering realm synchronizations

This commit is contained in:
2022-08-24 12:03:27 +02:00
parent bc5ad0f798
commit 82f9fc9e77
2 changed files with 140 additions and 0 deletions

View File

@ -53,3 +53,8 @@ def set_realm_data(auth_info: ProxmoxAuthInfo, realm: str, config: dict[str, str
new_realm_data = None
return existing_realm_data, new_realm_data
def do_realm_sync(auth_info: ProxmoxAuthInfo, realm: str, config: dict[str, str], dry_run: bool):
sync_config = config | {"dry-run": dry_run}
realm_sync = _proxmox_request('post', f"/access/domains/{realm}/sync", auth_info, data=sync_config)
return realm_sync.ok