MCPcopy Create free account
hub / github.com/cosdata/cosdata / create_transaction

Function create_transaction

tests/test-usv.py:72–77  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

70
71
72def create_transaction(name):
73 url = f"{client.base_url}/collections/{name}/transactions"
74 response = requests.post(url, headers=client._get_headers(), verify=client.verify_ssl)
75 if response.status_code not in [200, 201]:
76 raise Exception(f"Failed to create transaction: {response.text}")
77 return response.json()["transaction_id"]
78
79def commit_transaction(name, txn_id):
80 url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/commit"

Callers 1

mainFunction · 0.70

Calls 1

_get_headersMethod · 0.45

Tested by

no test coverage detected