(name, txn_id)
| 77 | return response.json()["transaction_id"] |
| 78 | |
| 79 | def commit_transaction(name, txn_id): |
| 80 | url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/commit" |
| 81 | response = requests.post(url, headers=client._get_headers(), verify=client.verify_ssl) |
| 82 | if response.status_code not in [200, 204]: |
| 83 | raise Exception(f"Failed to commit transaction: {response.text}") |
| 84 | |
| 85 | def abort_transaction(name, txn_id): |
| 86 | url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/abort" |