diff --git a/arango/replication.py b/arango/replication.py index 7dd1323f..07f90382 100644 --- a/arango/replication.py +++ b/arango/replication.py @@ -208,7 +208,9 @@ def synchronize( restrict_collections: Optional[Sequence[str]] = None, initial_sync_wait_time: Optional[int] = None, ) -> Result[Json]: # pragma: no cover - """Synchronize data from a remote endpoint. + """**Removed** in ArangoDB v3.12.10. + + Synchronize data from a remote endpoint. :param endpoint: Master endpoint (e.g. "tcp://192.168.173.13:8529"). :type endpoint: str @@ -246,6 +248,9 @@ def synchronize( :rtype: dict :raise arango.exceptions.ReplicationSyncError: If sync fails. """ + m = "/_api/replication/sync was removed in ArangoDB v3.12.10." + warn(m, DeprecationWarning, stacklevel=2) + data: Json = {"endpoint": endpoint} if database is not None: @@ -319,13 +324,18 @@ def response_handler(resp: Response) -> Json: return self._execute(request, response_handler) def logger_first_tick(self) -> Result[str]: - """Return the first available tick value from the server. + """**Removed** in ArangoDB v3.12.10. + + Return the first available tick value from the server. :return: First tick value. :rtype: str :raise arango.exceptions.ReplicationLoggerFirstTickError: If retrieval fails. """ - m = "/_api/replication/logger-first-tick endpoint is removed in ArangoDB v4.0" + m = ( + "/_api/replication/logger-first-tick endpoint is removed in " + "ArangoDB v3.12.10." + ) warn(m, DeprecationWarning, stacklevel=2) request = Request( @@ -618,12 +628,17 @@ def response_handler(resp: Response) -> Json: return self._execute(request, response_handler) def server_id(self) -> Result[str]: - """Return this server's ID. + """**Removed** in ArangoDB v3.12.10. + + Return this server's ID. :return: Server ID. :rtype: str :raise arango.exceptions.ReplicationServerIDError: If retrieval fails. """ + m = "/_api/replication/server-id was removed in ArangoDB v3.12.10." + warn(m, DeprecationWarning, stacklevel=2) + request = Request( method="get", endpoint="/_api/replication/server-id", diff --git a/docs/replication.rst b/docs/replication.rst index 9aaf9496..92631f34 100644 --- a/docs/replication.rst +++ b/docs/replication.rst @@ -57,22 +57,5 @@ information, refer to `ArangoDB manual`_. # Get the logger state. replication.logger_state() - # Get the logger first tick value. - replication.logger_first_tick() - - # Get the server ID. - replication.server_id() - - # Synchronize data from a remote (master) endpoint - replication.synchronize( - endpoint='tcp://master:8500', - database='test', - username='root', - password='passwd', - include_system=False, - incremental=False, - restrict_type='include', - restrict_collections=['students'] - ) See :ref:`Replication` for API specification. diff --git a/tests/test_replication.py b/tests/test_replication.py index 302076dd..e71c890a 100644 --- a/tests/test_replication.py +++ b/tests/test_replication.py @@ -15,8 +15,6 @@ ReplicationDumpError, ReplicationInventoryError, ReplicationLoggerStateError, - ReplicationServerIDError, - ReplicationSyncError, ) from tests.helpers import assert_raises @@ -107,35 +105,3 @@ def test_replication_cluster_inventory(sys_db, bad_db, cluster): with assert_raises(ReplicationClusterInventoryError) as err: bad_db.replication.cluster_inventory(include_system=True) assert err.value.error_code in {FORBIDDEN, DATABASE_NOT_FOUND} - - -def test_replication_server_id(sys_db, bad_db): - result = sys_db.replication.server_id() - assert isinstance(result, str) - - with assert_raises(ReplicationServerIDError) as err: - bad_db.replication.server_id() - assert err.value.error_code in {FORBIDDEN, DATABASE_NOT_FOUND} - - -def test_replication_synchronize(sys_db, bad_db, url, replication): - if not replication: - pytest.skip("Only tested for replication") - - result = sys_db.replication.synchronize( - endpoint="tcp://192.168.1.65:8500", - database="test", - username="root", - password="passwd", - include_system=False, - incremental=False, - restrict_type="include", - restrict_collections=["test"], - initial_sync_wait_time=None, - ) - assert "collections" in result - assert "last_log_tick" in result - - with assert_raises(ReplicationSyncError) as err: - bad_db.replication.synchronize(endpoint=url) - assert err.value.error_code in {FORBIDDEN, DATABASE_NOT_FOUND}