python-arango 8.3.3__tar.gz → 8.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_arango-8.3.4/.circleci/config.yml +200 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/PKG-INFO +1 -1
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/collection.py +22 -8
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/database.py +14 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/replication.py +47 -175
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/utils.py +47 -17
- python_arango-8.3.4/arango/version.py +1 -0
- python_arango-8.3.4/ci/conftest.py +1 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/database.rst +8 -1
- python_arango-8.3.4/docs/replication.rst +61 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/python_arango.egg-info/PKG-INFO +1 -1
- {python_arango-8.3.3 → python_arango-8.3.4}/python_arango.egg-info/SOURCES.txt +3 -0
- python_arango-8.3.4/python_arango.egg-info/scm_file_list.json +130 -0
- python_arango-8.3.4/python_arango.egg-info/scm_version.json +8 -0
- python_arango-8.3.3/.circleci/config.yml +0 -117
- python_arango-8.3.3/arango/version.py +0 -1
- python_arango-8.3.3/docs/replication.rst +0 -115
- {python_arango-8.3.3 → python_arango-8.3.4}/.github/workflows/codeql.yaml +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/.github/workflows/docs.yaml +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/.github/workflows/pypi.yaml +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/.gitignore +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/.pre-commit-config.yaml +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/.readthedocs.yaml +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/CONTRIBUTING.md +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/LICENSE +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/MANIFEST.in +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/README.md +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/__init__.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/api.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/aql.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/backup.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/client.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/cluster.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/connection.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/cursor.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/errno.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/exceptions.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/executor.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/formatter.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/foxx.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/graph.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/http.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/job.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/pregel.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/py.typed +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/request.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/resolver.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/response.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/result.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/typings.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/arango/wal.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/Makefile +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/admin.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/analyzer.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/aql.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/async.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/auth.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/backup.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/batch.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/certificates.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/cluster.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/collection.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/compression.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/conf.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/contributing.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/cursor.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/document.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/errno.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/errors.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/foxx.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/graph.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/http.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/index.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/indexes.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/logging.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/make.bat +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/overload.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/overview.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/pregel.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/requirements.txt +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/schema.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/serializer.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/simple.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/specs.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/static/logo.png +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/task.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/threading.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/transaction.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/user.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/view.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/docs/wal.rst +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/pyproject.toml +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/python_arango.egg-info/dependency_links.txt +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/python_arango.egg-info/requires.txt +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/python_arango.egg-info/top_level.txt +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/setup.cfg +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/setup.py +0 -0
- {python_arango-8.3.3 → python_arango-8.3.4}/starter.sh +0 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
version: 2.1
|
|
2
|
+
|
|
3
|
+
executors:
|
|
4
|
+
python-container:
|
|
5
|
+
parameters:
|
|
6
|
+
python_version:
|
|
7
|
+
type: string
|
|
8
|
+
default: "3.14"
|
|
9
|
+
docker:
|
|
10
|
+
- image: cimg/python:<< parameters.python_version >>
|
|
11
|
+
resource_class: arangodb/small-amd64
|
|
12
|
+
arangodb-container:
|
|
13
|
+
parameters:
|
|
14
|
+
arangodb_image:
|
|
15
|
+
type: string
|
|
16
|
+
docker:
|
|
17
|
+
- image: << parameters.arangodb_image >>
|
|
18
|
+
entrypoint: /bin/sh
|
|
19
|
+
command: -c "while true; do sleep 10; done"
|
|
20
|
+
user: root
|
|
21
|
+
resource_class: arangodb/medium-amd64
|
|
22
|
+
|
|
23
|
+
workflows:
|
|
24
|
+
ci:
|
|
25
|
+
jobs:
|
|
26
|
+
- lint
|
|
27
|
+
- import-test:
|
|
28
|
+
name: Imports (Python << matrix.python_version >>)
|
|
29
|
+
matrix:
|
|
30
|
+
parameters:
|
|
31
|
+
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
32
|
+
- integration-test:
|
|
33
|
+
name: ArangoDB (enterprise, 3.12 << matrix.arangodb_config >>)
|
|
34
|
+
matrix:
|
|
35
|
+
parameters:
|
|
36
|
+
arangodb_config: ["single", "cluster"]
|
|
37
|
+
arangodb_image: ["arangodb/enterprise:3.12"]
|
|
38
|
+
arangodb_conf_version: ["3.12"]
|
|
39
|
+
- integration-test:
|
|
40
|
+
name: ArangoDB (enterprise-preview, 4.0-nightly << matrix.arangodb_config >>)
|
|
41
|
+
matrix:
|
|
42
|
+
parameters:
|
|
43
|
+
arangodb_config: ["single", "cluster"]
|
|
44
|
+
arangodb_image: ["arangodb/enterprise-preview:4.0-nightly"]
|
|
45
|
+
arangodb_conf_version: ["4.0"]
|
|
46
|
+
|
|
47
|
+
jobs:
|
|
48
|
+
lint:
|
|
49
|
+
executor: python-container
|
|
50
|
+
steps:
|
|
51
|
+
- checkout
|
|
52
|
+
- run:
|
|
53
|
+
name: Install Dependencies
|
|
54
|
+
command: python -m pip install .[dev]
|
|
55
|
+
- run:
|
|
56
|
+
name: Run black
|
|
57
|
+
command: black --check --verbose --diff --color --config=pyproject.toml ./arango ./tests/
|
|
58
|
+
- run:
|
|
59
|
+
name: Run flake8
|
|
60
|
+
command: flake8 ./arango ./tests
|
|
61
|
+
- run:
|
|
62
|
+
name: Run isort
|
|
63
|
+
command: isort --check ./arango ./tests
|
|
64
|
+
- run:
|
|
65
|
+
name: Run mypy
|
|
66
|
+
command: mypy ./arango
|
|
67
|
+
import-test:
|
|
68
|
+
parameters:
|
|
69
|
+
python_version:
|
|
70
|
+
type: string
|
|
71
|
+
executor:
|
|
72
|
+
name: python-container
|
|
73
|
+
python_version: << parameters.python_version >>
|
|
74
|
+
steps:
|
|
75
|
+
- checkout
|
|
76
|
+
- run:
|
|
77
|
+
name: Install Dependencies
|
|
78
|
+
command: |
|
|
79
|
+
python --version
|
|
80
|
+
python -m pip install .[dev]
|
|
81
|
+
- run:
|
|
82
|
+
name: Run Import Tests
|
|
83
|
+
command: python -m pytest tests/test_imports.py --skip-arango-setup --color=yes --code-highlight=yes
|
|
84
|
+
integration-test:
|
|
85
|
+
parameters:
|
|
86
|
+
arangodb_config:
|
|
87
|
+
type: string
|
|
88
|
+
arangodb_image:
|
|
89
|
+
type: string
|
|
90
|
+
arangodb_conf_version:
|
|
91
|
+
type: string
|
|
92
|
+
executor:
|
|
93
|
+
name: arangodb-container
|
|
94
|
+
arangodb_image: << parameters.arangodb_image >>
|
|
95
|
+
steps:
|
|
96
|
+
- run:
|
|
97
|
+
name: Bootstrap CI Tools
|
|
98
|
+
command: |
|
|
99
|
+
apk add --no-cache \
|
|
100
|
+
bash \
|
|
101
|
+
build-base \
|
|
102
|
+
ca-certificates \
|
|
103
|
+
curl \
|
|
104
|
+
git \
|
|
105
|
+
jq \
|
|
106
|
+
openssh-client \
|
|
107
|
+
openssl-dev \
|
|
108
|
+
py3-pip \
|
|
109
|
+
py3-virtualenv \
|
|
110
|
+
python3 \
|
|
111
|
+
python3-dev
|
|
112
|
+
- checkout
|
|
113
|
+
- run:
|
|
114
|
+
name: Setup ArangoDB
|
|
115
|
+
command: |
|
|
116
|
+
mkdir -p /tests
|
|
117
|
+
if [ ! -e /tests/static ]; then
|
|
118
|
+
ln -s "$PWD/tests/static" /tests/static
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
conf_file="/tests/static/<< parameters.arangodb_config >>-<< parameters.arangodb_conf_version >>.conf"
|
|
122
|
+
if [ ! -f "$conf_file" ]; then
|
|
123
|
+
echo "Missing configuration file: $conf_file"
|
|
124
|
+
exit 1
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
arangodb --configuration="$conf_file" > arangodb.log 2>&1 &
|
|
128
|
+
echo "$!" > arangodb.pid
|
|
129
|
+
|
|
130
|
+
ports="8529"
|
|
131
|
+
if [ << parameters.arangodb_config >> = "cluster" ]; then
|
|
132
|
+
ports="$ports 8539 8549"
|
|
133
|
+
fi
|
|
134
|
+
|
|
135
|
+
for port in $ports; do
|
|
136
|
+
echo "Waiting for ArangoDB at http://localhost:$port/_api/version"
|
|
137
|
+
for attempt in $(seq 1 120); do
|
|
138
|
+
if curl --fail --silent --show-error \
|
|
139
|
+
--user root:passwd \
|
|
140
|
+
"http://localhost:$port/_api/version" | jq; then
|
|
141
|
+
break
|
|
142
|
+
fi
|
|
143
|
+
|
|
144
|
+
if ! kill -0 "$(cat arangodb.pid)" 2>/dev/null; then
|
|
145
|
+
echo "ArangoDB process exited before port $port became ready"
|
|
146
|
+
exit 1
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
if [ "$attempt" -eq 120 ]; then
|
|
150
|
+
echo "Timed out waiting for ArangoDB on port $port"
|
|
151
|
+
exit 1
|
|
152
|
+
fi
|
|
153
|
+
|
|
154
|
+
sleep 1
|
|
155
|
+
done
|
|
156
|
+
done
|
|
157
|
+
- run:
|
|
158
|
+
name: Show ArangoDB Logs
|
|
159
|
+
command: tail -n 1000 arangodb.log
|
|
160
|
+
when: always
|
|
161
|
+
- run:
|
|
162
|
+
name: Setup Python
|
|
163
|
+
shell: /bin/bash -eo pipefail
|
|
164
|
+
command: |
|
|
165
|
+
python3 --version
|
|
166
|
+
python3 -m virtualenv .venv
|
|
167
|
+
source .venv/bin/activate
|
|
168
|
+
python --version
|
|
169
|
+
python -m pip --version
|
|
170
|
+
- run:
|
|
171
|
+
name: Install Dependencies
|
|
172
|
+
shell: /bin/bash -eo pipefail
|
|
173
|
+
command: |
|
|
174
|
+
source .venv/bin/activate
|
|
175
|
+
python -m pip install -e .[dev]
|
|
176
|
+
- run:
|
|
177
|
+
name: Run pytest
|
|
178
|
+
shell: /bin/bash -eo pipefail
|
|
179
|
+
command: |
|
|
180
|
+
mkdir test-results
|
|
181
|
+
mkdir htmlcov
|
|
182
|
+
|
|
183
|
+
source .venv/bin/activate
|
|
184
|
+
|
|
185
|
+
args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529")
|
|
186
|
+
if [ << parameters.arangodb_config >> = "cluster" ]; then
|
|
187
|
+
args+=("--cluster" "--port=8539" "--port=8549")
|
|
188
|
+
fi
|
|
189
|
+
|
|
190
|
+
echo "Running pytest with args: ${args[@]}"
|
|
191
|
+
pytest tests --cov=arango --cov-report=html:htmlcov --color=yes --code-highlight=yes "${args[@]}"
|
|
192
|
+
- store_artifacts:
|
|
193
|
+
path: htmlcov
|
|
194
|
+
destination: coverage-report
|
|
195
|
+
- store_artifacts:
|
|
196
|
+
path: test-results
|
|
197
|
+
- store_artifacts:
|
|
198
|
+
path: arangodb.log
|
|
199
|
+
- store_test_results:
|
|
200
|
+
path: test-results
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-arango
|
|
3
|
-
Version: 8.3.
|
|
3
|
+
Version: 8.3.4
|
|
4
4
|
Summary: Python Driver for ArangoDB
|
|
5
5
|
Author-email: Joohwan Oh <joohwan.oh@outlook.com>
|
|
6
6
|
Maintainer-email: Joohwan Oh <joohwan.oh@outlook.com>, Alexandru Petenchea <alex.petenchea@gmail.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
@@ -816,14 +816,20 @@ class Collection(ApiGroup):
|
|
|
816
816
|
|
|
817
817
|
skip_val = skip if skip is not None else 0
|
|
818
818
|
limit_val = limit if limit is not None else "null"
|
|
819
|
+
filter_conditions, filter_bind_vars = build_filter_conditions(filters)
|
|
820
|
+
sort_expression, sort_bind_vars = build_sort_expression(sort)
|
|
819
821
|
query = f"""
|
|
820
822
|
FOR doc IN @@collection
|
|
821
|
-
{
|
|
823
|
+
{filter_conditions}
|
|
822
824
|
LIMIT {skip_val}, {limit_val}
|
|
823
|
-
{
|
|
825
|
+
{sort_expression}
|
|
824
826
|
RETURN doc
|
|
825
827
|
"""
|
|
826
|
-
bind_vars = {
|
|
828
|
+
bind_vars = {
|
|
829
|
+
"@collection": self.name,
|
|
830
|
+
**filter_bind_vars,
|
|
831
|
+
**sort_bind_vars,
|
|
832
|
+
}
|
|
827
833
|
|
|
828
834
|
request = Request(
|
|
829
835
|
method="post",
|
|
@@ -1920,9 +1926,10 @@ class Collection(ApiGroup):
|
|
|
1920
1926
|
# then the collection’s default waitForSync behavior is applied.
|
|
1921
1927
|
sync_val = f", waitForSync: {sync}" if sync is not None else ""
|
|
1922
1928
|
|
|
1929
|
+
filter_conditions, filter_bind_vars = build_filter_conditions(filters)
|
|
1923
1930
|
query = f"""
|
|
1924
1931
|
FOR doc IN @@collection
|
|
1925
|
-
{
|
|
1932
|
+
{filter_conditions}
|
|
1926
1933
|
{f"LIMIT {limit}" if limit is not None else ""}
|
|
1927
1934
|
UPDATE doc WITH @body IN @@collection
|
|
1928
1935
|
OPTIONS {{ keepNull: @keep_none, mergeObjects: @merge {sync_val} }}
|
|
@@ -1933,6 +1940,7 @@ class Collection(ApiGroup):
|
|
|
1933
1940
|
"body": body,
|
|
1934
1941
|
"keep_none": keep_none,
|
|
1935
1942
|
"merge": merge,
|
|
1943
|
+
**filter_bind_vars,
|
|
1936
1944
|
}
|
|
1937
1945
|
|
|
1938
1946
|
request = Request(
|
|
@@ -2089,15 +2097,20 @@ class Collection(ApiGroup):
|
|
|
2089
2097
|
# then the collection’s default waitForSync behavior is applied.
|
|
2090
2098
|
sync_val = f"waitForSync: {sync}" if sync is not None else ""
|
|
2091
2099
|
|
|
2100
|
+
filter_conditions, filter_bind_vars = build_filter_conditions(filters)
|
|
2092
2101
|
query = f"""
|
|
2093
2102
|
FOR doc IN @@collection
|
|
2094
|
-
{
|
|
2103
|
+
{filter_conditions}
|
|
2095
2104
|
{f"LIMIT {limit}" if limit is not None else ""}
|
|
2096
2105
|
REPLACE doc WITH @body IN @@collection
|
|
2097
2106
|
{f"OPTIONS {{ {sync_val} }}" if sync_val else ""}
|
|
2098
2107
|
""" # noqa: E201 E202
|
|
2099
2108
|
|
|
2100
|
-
bind_vars = {
|
|
2109
|
+
bind_vars = {
|
|
2110
|
+
"@collection": self.name,
|
|
2111
|
+
"body": body,
|
|
2112
|
+
**filter_bind_vars,
|
|
2113
|
+
}
|
|
2101
2114
|
|
|
2102
2115
|
request = Request(
|
|
2103
2116
|
method="post",
|
|
@@ -2248,15 +2261,16 @@ class Collection(ApiGroup):
|
|
|
2248
2261
|
# then the collection’s default waitForSync behavior is applied.
|
|
2249
2262
|
sync_val = f"waitForSync: {sync}" if sync is not None else ""
|
|
2250
2263
|
|
|
2264
|
+
filter_conditions, filter_bind_vars = build_filter_conditions(filters)
|
|
2251
2265
|
query = f"""
|
|
2252
2266
|
FOR doc IN @@collection
|
|
2253
|
-
{
|
|
2267
|
+
{filter_conditions}
|
|
2254
2268
|
{f"LIMIT {limit}" if limit is not None else ""}
|
|
2255
2269
|
REMOVE doc IN @@collection
|
|
2256
2270
|
{f"OPTIONS {{ {sync_val} }}" if sync_val else ""}
|
|
2257
2271
|
""" # noqa: E201 E202
|
|
2258
2272
|
|
|
2259
|
-
bind_vars = {"@collection": self.name}
|
|
2273
|
+
bind_vars = {"@collection": self.name, **filter_bind_vars}
|
|
2260
2274
|
|
|
2261
2275
|
request = Request(
|
|
2262
2276
|
method="post",
|
|
@@ -1128,6 +1128,20 @@ class Database(ApiGroup):
|
|
|
1128
1128
|
|
|
1129
1129
|
return self._execute(request, response_handler)
|
|
1130
1130
|
|
|
1131
|
+
def request(self, request: Request) -> Result[Response]:
|
|
1132
|
+
"""Execute a custom request.
|
|
1133
|
+
|
|
1134
|
+
:param request: Request object to be executed.
|
|
1135
|
+
:type request: Request
|
|
1136
|
+
:return: Response object containing the result of the request.
|
|
1137
|
+
:rtype: Response
|
|
1138
|
+
"""
|
|
1139
|
+
|
|
1140
|
+
def response_handler(resp: Response) -> Response:
|
|
1141
|
+
return resp
|
|
1142
|
+
|
|
1143
|
+
return self._executor.execute(request, response_handler)
|
|
1144
|
+
|
|
1131
1145
|
def metrics(self) -> Result[str]:
|
|
1132
1146
|
"""Return server metrics in Prometheus format.
|
|
1133
1147
|
|
|
@@ -18,7 +18,6 @@ from arango.exceptions import (
|
|
|
18
18
|
ReplicationInventoryError,
|
|
19
19
|
ReplicationLoggerFirstTickError,
|
|
20
20
|
ReplicationLoggerStateError,
|
|
21
|
-
ReplicationMakeSlaveError,
|
|
22
21
|
ReplicationServerIDError,
|
|
23
22
|
ReplicationSyncError,
|
|
24
23
|
)
|
|
@@ -209,7 +208,9 @@ class Replication(ApiGroup):
|
|
|
209
208
|
restrict_collections: Optional[Sequence[str]] = None,
|
|
210
209
|
initial_sync_wait_time: Optional[int] = None,
|
|
211
210
|
) -> Result[Json]: # pragma: no cover
|
|
212
|
-
"""
|
|
211
|
+
"""**Removed** in ArangoDB v3.12.10.
|
|
212
|
+
|
|
213
|
+
Synchronize data from a remote endpoint.
|
|
213
214
|
|
|
214
215
|
:param endpoint: Master endpoint (e.g. "tcp://192.168.173.13:8529").
|
|
215
216
|
:type endpoint: str
|
|
@@ -247,6 +248,9 @@ class Replication(ApiGroup):
|
|
|
247
248
|
:rtype: dict
|
|
248
249
|
:raise arango.exceptions.ReplicationSyncError: If sync fails.
|
|
249
250
|
"""
|
|
251
|
+
m = "/_api/replication/sync was removed in ArangoDB v3.12.10."
|
|
252
|
+
warn(m, DeprecationWarning, stacklevel=2)
|
|
253
|
+
|
|
250
254
|
data: Json = {"endpoint": endpoint}
|
|
251
255
|
|
|
252
256
|
if database is not None:
|
|
@@ -320,13 +324,18 @@ class Replication(ApiGroup):
|
|
|
320
324
|
return self._execute(request, response_handler)
|
|
321
325
|
|
|
322
326
|
def logger_first_tick(self) -> Result[str]:
|
|
323
|
-
"""
|
|
327
|
+
"""**Removed** in ArangoDB v3.12.10.
|
|
328
|
+
|
|
329
|
+
Return the first available tick value from the server.
|
|
324
330
|
|
|
325
331
|
:return: First tick value.
|
|
326
332
|
:rtype: str
|
|
327
333
|
:raise arango.exceptions.ReplicationLoggerFirstTickError: If retrieval fails.
|
|
328
334
|
"""
|
|
329
|
-
m =
|
|
335
|
+
m = (
|
|
336
|
+
"/_api/replication/logger-first-tick endpoint is removed in "
|
|
337
|
+
"ArangoDB v3.12.10."
|
|
338
|
+
)
|
|
330
339
|
warn(m, DeprecationWarning, stacklevel=2)
|
|
331
340
|
|
|
332
341
|
request = Request(
|
|
@@ -342,12 +351,17 @@ class Replication(ApiGroup):
|
|
|
342
351
|
return self._execute(request, response_handler)
|
|
343
352
|
|
|
344
353
|
def applier_config(self) -> Result[Json]:
|
|
345
|
-
"""
|
|
354
|
+
"""**Removed** in ArangoDB v3.12.10.
|
|
355
|
+
|
|
356
|
+
Return the configuration of the replication applier.
|
|
346
357
|
|
|
347
358
|
:return: Configuration of the replication applier.
|
|
348
359
|
:rtype: dict
|
|
349
360
|
:raise arango.exceptions.ReplicationApplierConfigError: If retrieval fails.
|
|
350
361
|
"""
|
|
362
|
+
m = "/_api/replication/applier-config was removed in ArangoDB v3.12.10."
|
|
363
|
+
warn(m, DeprecationWarning, stacklevel=2)
|
|
364
|
+
|
|
351
365
|
request = Request(
|
|
352
366
|
method="get",
|
|
353
367
|
endpoint="/_api/replication/applier-config",
|
|
@@ -384,7 +398,9 @@ class Replication(ApiGroup):
|
|
|
384
398
|
restrict_type: Optional[str] = None,
|
|
385
399
|
restrict_collections: Optional[Sequence[str]] = None,
|
|
386
400
|
) -> Result[Json]:
|
|
387
|
-
"""
|
|
401
|
+
"""**Removed** in ArangoDB v3.12.10.
|
|
402
|
+
|
|
403
|
+
Set configuration values of the replication applier.
|
|
388
404
|
|
|
389
405
|
:param endpoint: Server endpoint (e.g. "tcp://192.168.173.13:8529").
|
|
390
406
|
:type endpoint: str
|
|
@@ -477,6 +493,9 @@ class Replication(ApiGroup):
|
|
|
477
493
|
:rtype: dict
|
|
478
494
|
:raise arango.exceptions.ReplicationApplierConfigSetError: If update fails.
|
|
479
495
|
"""
|
|
496
|
+
m = "/_api/replication/applier-config was removed in ArangoDB v3.12.10."
|
|
497
|
+
warn(m, DeprecationWarning, stacklevel=2)
|
|
498
|
+
|
|
480
499
|
data: Json = {"endpoint": endpoint}
|
|
481
500
|
|
|
482
501
|
if database is not None:
|
|
@@ -532,12 +551,17 @@ class Replication(ApiGroup):
|
|
|
532
551
|
return self._execute(request, response_handler)
|
|
533
552
|
|
|
534
553
|
def applier_state(self) -> Result[Json]:
|
|
535
|
-
"""
|
|
554
|
+
"""**Removed** in ArangoDB v3.12.10.
|
|
555
|
+
|
|
556
|
+
Return the state of the replication applier
|
|
536
557
|
|
|
537
558
|
:return: Applier state and details.
|
|
538
559
|
:rtype: dict
|
|
539
560
|
:raise arango.exceptions.ReplicationApplierStateError: If retrieval fails.
|
|
540
561
|
"""
|
|
562
|
+
m = "/_api/replication/applier-state was removed in ArangoDB v3.12.10."
|
|
563
|
+
warn(m, DeprecationWarning, stacklevel=2)
|
|
564
|
+
|
|
541
565
|
request = Request(
|
|
542
566
|
method="get",
|
|
543
567
|
endpoint="/_api/replication/applier-state",
|
|
@@ -551,7 +575,9 @@ class Replication(ApiGroup):
|
|
|
551
575
|
return self._execute(request, response_handler)
|
|
552
576
|
|
|
553
577
|
def start_applier(self, last_tick: Optional[str] = None) -> Result[Json]:
|
|
554
|
-
"""
|
|
578
|
+
"""**Removed** in ArangoDB v3.12.10.
|
|
579
|
+
|
|
580
|
+
Start the replication applier.
|
|
555
581
|
|
|
556
582
|
:param last_tick: The remote last log tick value from which to start
|
|
557
583
|
applying replication. If not specified, the last saved tick from
|
|
@@ -563,6 +589,9 @@ class Replication(ApiGroup):
|
|
|
563
589
|
:rtype: dict
|
|
564
590
|
:raise arango.exceptions.ReplicationApplierStartError: If operation fails.
|
|
565
591
|
"""
|
|
592
|
+
m = "/_api/replication/applier-start was removed in ArangoDB v3.12.10."
|
|
593
|
+
warn(m, DeprecationWarning, stacklevel=2)
|
|
594
|
+
|
|
566
595
|
request = Request(
|
|
567
596
|
method="put",
|
|
568
597
|
endpoint="/_api/replication/applier-start",
|
|
@@ -577,12 +606,15 @@ class Replication(ApiGroup):
|
|
|
577
606
|
return self._execute(request, response_handler)
|
|
578
607
|
|
|
579
608
|
def stop_applier(self) -> Result[Json]:
|
|
580
|
-
"""
|
|
609
|
+
"""**Removed** in ArangoDB v3.12.10.
|
|
581
610
|
|
|
582
611
|
:return: Applier state and details.
|
|
583
612
|
:rtype: dict
|
|
584
613
|
:raise arango.exceptions.ReplicationApplierStopError: If operation fails.
|
|
585
614
|
"""
|
|
615
|
+
m = "/_api/replication/applier-stop was removed in ArangoDB v3.12.10."
|
|
616
|
+
warn(m, DeprecationWarning, stacklevel=2)
|
|
617
|
+
|
|
586
618
|
request = Request(
|
|
587
619
|
method="put",
|
|
588
620
|
endpoint="/_api/replication/applier-stop",
|
|
@@ -595,178 +627,18 @@ class Replication(ApiGroup):
|
|
|
595
627
|
|
|
596
628
|
return self._execute(request, response_handler)
|
|
597
629
|
|
|
598
|
-
def make_slave(
|
|
599
|
-
self,
|
|
600
|
-
endpoint: str,
|
|
601
|
-
database: Optional[str] = None,
|
|
602
|
-
username: Optional[str] = None,
|
|
603
|
-
password: Optional[str] = None,
|
|
604
|
-
restrict_type: Optional[str] = None,
|
|
605
|
-
restrict_collections: Optional[Sequence[str]] = None,
|
|
606
|
-
include_system: Optional[bool] = None,
|
|
607
|
-
max_connect_retries: Optional[int] = None,
|
|
608
|
-
connect_timeout: Optional[int] = None,
|
|
609
|
-
request_timeout: Optional[int] = None,
|
|
610
|
-
chunk_size: Optional[int] = None,
|
|
611
|
-
adaptive_polling: Optional[bool] = None,
|
|
612
|
-
auto_resync: Optional[bool] = None,
|
|
613
|
-
auto_resync_retries: Optional[int] = None,
|
|
614
|
-
initial_sync_max_wait_time: Optional[int] = None,
|
|
615
|
-
connection_retry_wait_time: Optional[int] = None,
|
|
616
|
-
idle_min_wait_time: Optional[int] = None,
|
|
617
|
-
idle_max_wait_time: Optional[int] = None,
|
|
618
|
-
require_from_present: Optional[bool] = None,
|
|
619
|
-
verbose: Optional[bool] = None,
|
|
620
|
-
) -> Result[Json]: # pragma: no cover
|
|
621
|
-
"""Change the server role to slave.
|
|
622
|
-
|
|
623
|
-
:param endpoint: Master endpoint (e.g. "tcp://192.168.173.13:8529").
|
|
624
|
-
:type endpoint: str
|
|
625
|
-
:param database: Database name.
|
|
626
|
-
:type database: str | None
|
|
627
|
-
:param username: Username.
|
|
628
|
-
:type username: str | None
|
|
629
|
-
:param password: Password.
|
|
630
|
-
:type password: str | None
|
|
631
|
-
:param restrict_type: Optional string value for collection filtering.
|
|
632
|
-
Allowed values are "include" or "exclude".
|
|
633
|
-
:type restrict_type: str | None
|
|
634
|
-
:param restrict_collections: Optional list of collections for use with
|
|
635
|
-
argument **restrict_type**. If **restrict_type** set to "include",
|
|
636
|
-
only the specified collections are included. Otherwise, only the
|
|
637
|
-
specified collections are excluded.
|
|
638
|
-
:type restrict_collections: [str] | None
|
|
639
|
-
:param include_system: Whether system collection operations are
|
|
640
|
-
applied.
|
|
641
|
-
:type include_system: bool | None
|
|
642
|
-
:param max_connect_retries: Maximum number of connection attempts the
|
|
643
|
-
applier makes in a row before stopping itself.
|
|
644
|
-
:type max_connect_retries: int | None
|
|
645
|
-
:param connect_timeout: Timeout in seconds when attempting to connect
|
|
646
|
-
to the endpoint. This value is used for each connection attempt.
|
|
647
|
-
:type connect_timeout: int | None
|
|
648
|
-
:param request_timeout: Timeout in seconds for individual requests to
|
|
649
|
-
the endpoint.
|
|
650
|
-
:type request_timeout: int | None
|
|
651
|
-
:param chunk_size: Requested maximum size in bytes for log transfer
|
|
652
|
-
packets when the endpoint is contacted.
|
|
653
|
-
:type chunk_size: int | None
|
|
654
|
-
:param adaptive_polling: If set to True, replication applier sleeps
|
|
655
|
-
for an increasingly long period in case the logger server at the
|
|
656
|
-
endpoint has no replication events to apply. Using adaptive polling
|
|
657
|
-
reduces the amount of work done by both the applier and the logger
|
|
658
|
-
server when there are infrequent changes. The downside is that it
|
|
659
|
-
might take longer for the replication applier to detect new events.
|
|
660
|
-
:type adaptive_polling: bool | None
|
|
661
|
-
:param auto_resync: Whether the slave should perform a full automatic
|
|
662
|
-
resynchronization with the master in case the master cannot serve
|
|
663
|
-
log data requested by the slave, or when the replication is started
|
|
664
|
-
and no tick value can be found.
|
|
665
|
-
:type auto_resync: bool | None
|
|
666
|
-
:param auto_resync_retries: Max number of resynchronization retries.
|
|
667
|
-
Setting this to 0 disables it.
|
|
668
|
-
:type auto_resync_retries: int | None
|
|
669
|
-
:param initial_sync_max_wait_time: Max wait time in seconds the initial
|
|
670
|
-
synchronization waits for master on collection data. This value
|
|
671
|
-
is relevant even for continuous replication when **auto_resync** is
|
|
672
|
-
set to True because this may restart the initial synchronization
|
|
673
|
-
when master cannot provide log data slave requires. This value is
|
|
674
|
-
ignored if set to 0.
|
|
675
|
-
:type initial_sync_max_wait_time: int | None
|
|
676
|
-
:param connection_retry_wait_time: Time in seconds the applier idles
|
|
677
|
-
before trying to connect to master in case of connection problems.
|
|
678
|
-
This value is ignored if set to 0.
|
|
679
|
-
:type connection_retry_wait_time: int | None
|
|
680
|
-
:param idle_min_wait_time: Minimum wait time in seconds the applier
|
|
681
|
-
idles before fetching more log data from the master in case the
|
|
682
|
-
master has already sent all its log data. This wait time can be
|
|
683
|
-
used to control the frequency with which the replication applier
|
|
684
|
-
sends HTTP log fetch requests to the master in case there is no
|
|
685
|
-
write activity on the master. This value is ignored if set to 0.
|
|
686
|
-
:type idle_min_wait_time: int | None
|
|
687
|
-
:param idle_max_wait_time: Maximum wait time in seconds the applier
|
|
688
|
-
idles before fetching more log data from the master in case the
|
|
689
|
-
master has already sent all its log data. This wait time can be
|
|
690
|
-
used to control the maximum frequency with which the replication
|
|
691
|
-
applier sends HTTP log fetch requests to the master in case there
|
|
692
|
-
is no write activity on the master. Applies only when argument
|
|
693
|
-
**adaptive_polling** is set to True. This value is ignored if set
|
|
694
|
-
to 0.
|
|
695
|
-
:type idle_max_wait_time: int | None
|
|
696
|
-
:param require_from_present: If set to True, replication applier checks
|
|
697
|
-
at start whether the start tick from which it starts or resumes
|
|
698
|
-
replication is still present on the master. If not, then there
|
|
699
|
-
would be data loss. If set to True, the replication applier aborts
|
|
700
|
-
with an appropriate error message. If set to False, the applier
|
|
701
|
-
still starts and ignores the data loss.
|
|
702
|
-
:type require_from_present: bool | None
|
|
703
|
-
:param verbose: If set to True, a log line is emitted for all
|
|
704
|
-
operations performed by the replication applier. This should be
|
|
705
|
-
used for debugging replication problems only.
|
|
706
|
-
:type verbose: bool | None
|
|
707
|
-
:return: Replication details.
|
|
708
|
-
:rtype: dict
|
|
709
|
-
:raise arango.exceptions.ReplicationApplierStopError: If operation fails.
|
|
710
|
-
"""
|
|
711
|
-
data: Json = {"endpoint": endpoint}
|
|
712
|
-
|
|
713
|
-
if database is not None:
|
|
714
|
-
data["database"] = database
|
|
715
|
-
if username is not None:
|
|
716
|
-
data["username"] = username
|
|
717
|
-
if password is not None:
|
|
718
|
-
data["password"] = password
|
|
719
|
-
if restrict_type is not None:
|
|
720
|
-
data["restrictType"] = restrict_type
|
|
721
|
-
if restrict_collections is not None:
|
|
722
|
-
data["restrictCollections"] = restrict_collections
|
|
723
|
-
if include_system is not None:
|
|
724
|
-
data["includeSystem"] = include_system
|
|
725
|
-
if max_connect_retries is not None:
|
|
726
|
-
data["maxConnectRetries"] = max_connect_retries
|
|
727
|
-
if connect_timeout is not None:
|
|
728
|
-
data["connectTimeout"] = connect_timeout
|
|
729
|
-
if request_timeout is not None:
|
|
730
|
-
data["requestTimeout"] = request_timeout
|
|
731
|
-
if chunk_size is not None:
|
|
732
|
-
data["chunkSize"] = chunk_size
|
|
733
|
-
if adaptive_polling is not None:
|
|
734
|
-
data["adaptivePolling"] = adaptive_polling
|
|
735
|
-
if auto_resync is not None:
|
|
736
|
-
data["autoResync"] = auto_resync
|
|
737
|
-
if auto_resync_retries is not None:
|
|
738
|
-
data["autoResyncRetries"] = auto_resync_retries
|
|
739
|
-
if initial_sync_max_wait_time is not None:
|
|
740
|
-
data["initialSyncMaxWaitTime"] = initial_sync_max_wait_time
|
|
741
|
-
if connection_retry_wait_time is not None:
|
|
742
|
-
data["connectionRetryWaitTime"] = connection_retry_wait_time
|
|
743
|
-
if idle_min_wait_time is not None:
|
|
744
|
-
data["idleMinWaitTime"] = idle_min_wait_time
|
|
745
|
-
if idle_max_wait_time is not None:
|
|
746
|
-
data["idleMaxWaitTime"] = idle_max_wait_time
|
|
747
|
-
if require_from_present is not None:
|
|
748
|
-
data["requireFromPresent"] = require_from_present
|
|
749
|
-
if verbose is not None:
|
|
750
|
-
data["verbose"] = verbose
|
|
751
|
-
|
|
752
|
-
request = Request(
|
|
753
|
-
method="put", endpoint="/_api/replication/make-slave", data=data
|
|
754
|
-
)
|
|
755
|
-
|
|
756
|
-
def response_handler(resp: Response) -> Json:
|
|
757
|
-
if resp.is_success:
|
|
758
|
-
return format_replication_applier_state(resp.body)
|
|
759
|
-
raise ReplicationMakeSlaveError(resp, request)
|
|
760
|
-
|
|
761
|
-
return self._execute(request, response_handler)
|
|
762
|
-
|
|
763
630
|
def server_id(self) -> Result[str]:
|
|
764
|
-
"""
|
|
631
|
+
"""**Removed** in ArangoDB v3.12.10.
|
|
632
|
+
|
|
633
|
+
Return this server's ID.
|
|
765
634
|
|
|
766
635
|
:return: Server ID.
|
|
767
636
|
:rtype: str
|
|
768
637
|
:raise arango.exceptions.ReplicationServerIDError: If retrieval fails.
|
|
769
638
|
"""
|
|
639
|
+
m = "/_api/replication/server-id was removed in ArangoDB v3.12.10."
|
|
640
|
+
warn(m, DeprecationWarning, stacklevel=2)
|
|
641
|
+
|
|
770
642
|
request = Request(
|
|
771
643
|
method="get",
|
|
772
644
|
endpoint="/_api/replication/server-id",
|