lockss-pyclient 0.1.0.dev2__py3-none-any.whl → 0.1.0.dev3__py3-none-any.whl
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.
- lockss/pyclient/__init__.py +8 -29
- lockss/pyclient/__main__.py +37 -0
- lockss/pyclient/_internal_common.py +395 -0
- lockss/pyclient/_internal_config.py +207 -0
- lockss/pyclient/_internal_crawler.py +251 -0
- lockss/pyclient/_internal_md.py +111 -0
- lockss/pyclient/_internal_poller.py +174 -0
- lockss/pyclient/_internal_rs.py +232 -0
- lockss/pyclient/cli.py +839 -0
- lockss/pyclient/config/__init__.py +15 -0
- lockss/pyclient/config/api/aus_api.py +14 -6
- lockss/pyclient/config/api/config_api.py +12 -12
- lockss/pyclient/config/api/utils_api.py +2 -2
- lockss/pyclient/config/configuration.py +1 -1
- lockss/pyclient/config/models/__init__.py +15 -0
- lockss/pyclient/config/models/access_type.py +90 -0
- lockss/pyclient/config/models/au_agreements.py +136 -0
- lockss/pyclient/config/models/au_config_page_info.py +140 -0
- lockss/pyclient/config/models/au_state_bean.py +942 -0
- lockss/pyclient/config/models/au_status.py +837 -8
- lockss/pyclient/config/models/au_suspect_url_versions.py +136 -0
- lockss/pyclient/config/models/check_substance_result.py +6 -22
- lockss/pyclient/config/models/dated_peer_id_set_impl.py +162 -0
- lockss/pyclient/config/models/hash_result.py +136 -0
- lockss/pyclient/config/models/page_info.py +226 -0
- lockss/pyclient/config/models/peer_agreement.py +188 -0
- lockss/pyclient/config/models/peer_agreements.py +136 -0
- lockss/pyclient/config/models/platform_configuration_ws_result.py +421 -8
- lockss/pyclient/config/models/platform_configuration_ws_result_daemon_version.py +188 -0
- lockss/pyclient/config/models/platform_configuration_ws_result_java_version.py +188 -0
- lockss/pyclient/config/models/platform_configuration_ws_result_platform.py +162 -0
- lockss/pyclient/config/models/substance_checker_state.py +91 -0
- lockss/pyclient/config/models/suspect_url_version.py +214 -0
- lockss/pyclient/config/swagger.yaml +2031 -0
- lockss/pyclient/crawler/__init__.py +1 -0
- lockss/pyclient/crawler/api/crawls_api.py +2 -2
- lockss/pyclient/crawler/configuration.py +1 -1
- lockss/pyclient/crawler/models/__init__.py +1 -0
- lockss/pyclient/crawler/models/crawl_desc.py +4 -12
- lockss/pyclient/crawler/models/crawl_kind_enum.py +90 -0
- lockss/pyclient/crawler/models/page_info.py +22 -24
- lockss/pyclient/crawler/swagger.yaml +1197 -0
- lockss/pyclient/md/configuration.py +1 -1
- lockss/pyclient/md/models/page_info.py +22 -24
- lockss/pyclient/md/swagger.yaml +583 -0
- lockss/pyclient/output.py +131 -0
- lockss/pyclient/poller/__init__.py +11 -5
- lockss/pyclient/poller/api/export_api.py +5 -5
- lockss/pyclient/poller/api/hash_api.py +3 -3
- lockss/pyclient/poller/api/poll_detail_api.py +42 -42
- lockss/pyclient/poller/api/poller_polls_api.py +18 -18
- lockss/pyclient/poller/api/service_api.py +2 -2
- lockss/pyclient/poller/api/voter_polls_api.py +18 -18
- lockss/pyclient/poller/configuration.py +1 -1
- lockss/pyclient/poller/models/__init__.py +11 -5
- lockss/pyclient/poller/models/export_file_type_enum.py +93 -0
- lockss/pyclient/poller/models/export_filename_translation_enum.py +91 -0
- lockss/pyclient/poller/models/page_info.py +226 -0
- lockss/pyclient/poller/models/poll_desc.py +3 -11
- lockss/pyclient/poller/models/poll_variant_enum.py +92 -0
- lockss/pyclient/poller/models/poller_page_info.py +140 -0
- lockss/pyclient/poller/models/repair_page_info.py +140 -0
- lockss/pyclient/poller/models/repair_type_enum.py +91 -0
- lockss/pyclient/poller/models/tally_type_enum.py +93 -0
- lockss/pyclient/poller/models/url_page_info.py +140 -0
- lockss/pyclient/poller/models/voter_page_info.py +140 -0
- lockss/pyclient/poller/models/voter_urls_enum.py +92 -0
- lockss/pyclient/poller/swagger.yaml +1658 -0
- lockss/pyclient/rs/__init__.py +6 -0
- lockss/pyclient/rs/api/artifacts_api.py +20 -20
- lockss/pyclient/rs/api/aus_api.py +5 -5
- lockss/pyclient/rs/api/repo_api.py +4 -4
- lockss/pyclient/rs/api/status_api.py +1 -1
- lockss/pyclient/rs/api/wayback_api.py +12 -12
- lockss/pyclient/rs/configuration.py +8 -1
- lockss/pyclient/rs/models/__init__.py +6 -0
- lockss/pyclient/rs/models/artifact.py +111 -81
- lockss/pyclient/rs/models/au_size.py +6 -0
- lockss/pyclient/rs/models/auid_page_info.py +2 -2
- lockss/pyclient/rs/models/bulk_au_op_enum.py +90 -0
- lockss/pyclient/rs/models/include_content_enum.py +91 -0
- lockss/pyclient/rs/models/page_info.py +26 -29
- lockss/pyclient/rs/models/pywb_match_enum.py +93 -0
- lockss/pyclient/rs/models/pywb_output_enum.py +90 -0
- lockss/pyclient/rs/models/pywb_sort_enum.py +91 -0
- lockss/pyclient/rs/models/storage_info.py +131 -80
- lockss/pyclient/rs/models/versions_enum.py +90 -0
- lockss/pyclient/rs/swagger.yaml +1306 -0
- {lockss_pyclient-0.1.0.dev2.dist-info → lockss_pyclient-0.1.0.dev3.dist-info}/METADATA +10 -3
- {lockss_pyclient-0.1.0.dev2.dist-info → lockss_pyclient-0.1.0.dev3.dist-info}/RECORD +93 -45
- {lockss_pyclient-0.1.0.dev2.dist-info → lockss_pyclient-0.1.0.dev3.dist-info}/WHEEL +1 -1
- lockss_pyclient-0.1.0.dev3.dist-info/entry_points.txt +3 -0
- {lockss_pyclient-0.1.0.dev2.dist-info → lockss_pyclient-0.1.0.dev3.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2000-2025, Board of Trustees of Leland Stanford Jr. University
|
|
4
|
+
#
|
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
|
7
|
+
#
|
|
8
|
+
# 1. Redistributions of source code must retain the above copyright notice,
|
|
9
|
+
# this list of conditions and the following disclaimer.
|
|
10
|
+
#
|
|
11
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
# and/or other materials provided with the distribution.
|
|
14
|
+
#
|
|
15
|
+
# 3. Neither the name of the copyright holder nor the names of its contributors
|
|
16
|
+
# may be used to endorse or promote products derived from this software without
|
|
17
|
+
# specific prior written permission.
|
|
18
|
+
#
|
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
23
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
24
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
25
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
26
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
27
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
28
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
29
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
+
|
|
31
|
+
"""
|
|
32
|
+
Base of the lockss.pyclient package (repository service).
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
from collections.abc import Iterator
|
|
36
|
+
from typing import Optional, Union
|
|
37
|
+
|
|
38
|
+
from multipart import MultipartParser
|
|
39
|
+
|
|
40
|
+
from ._internal_common import Node, bytes_repr_to_multipart, bytes_repr_to_string, _param_default, _schema_default, _single_request_template, _paged_request_iterator_template, _RS
|
|
41
|
+
from . import rs
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@_single_request_template(Node.make_rs_conf,
|
|
45
|
+
rs.ApiClient,
|
|
46
|
+
rs.ArtifactsApi,
|
|
47
|
+
rs.ArtifactsApi.delete_artifact)
|
|
48
|
+
def repo_delete_artifact(node: Node,
|
|
49
|
+
uuid: str,
|
|
50
|
+
namespace: str = _param_default(_RS, '/artifacts/{uuid}', 'delete', 'namespace')) -> None:
|
|
51
|
+
pass
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@_single_request_template(Node.make_rs_conf,
|
|
55
|
+
rs.ApiClient,
|
|
56
|
+
rs.ArtifactsApi,
|
|
57
|
+
rs.ArtifactsApi.get_artifact_data_by_multipart,
|
|
58
|
+
transform_result=bytes_repr_to_multipart)
|
|
59
|
+
def repo_get_artifact_by_uuid(node: Node,
|
|
60
|
+
uuid: str,
|
|
61
|
+
namespace: str = _param_default(_RS, '/artifacts/{uuid}', 'get', 'namespace'),
|
|
62
|
+
include_content: rs.IncludeContentEnum = _schema_default(_RS, 'includeContentEnum')) -> MultipartParser:
|
|
63
|
+
pass
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@_single_request_template(Node.make_rs_conf,
|
|
67
|
+
rs.ApiClient,
|
|
68
|
+
rs.ArtifactsApi,
|
|
69
|
+
rs.ArtifactsApi.get_artifact_data_by_response,
|
|
70
|
+
transform_result=bytes_repr_to_string)
|
|
71
|
+
def repo_get_artifact_response_by_uuid(node: Node,
|
|
72
|
+
uuid: str,
|
|
73
|
+
namespace: str = _param_default(_RS, '/artifacts/{uuid}/response', 'get', 'namespace'),
|
|
74
|
+
include_content: rs.IncludeContentEnum = _schema_default(_RS, 'includeContentEnum')) -> str:
|
|
75
|
+
pass
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@_single_request_template(Node.make_rs_conf,
|
|
79
|
+
rs.ApiClient,
|
|
80
|
+
rs.ArtifactsApi,
|
|
81
|
+
rs.ArtifactsApi.get_artifact_data_by_payload,
|
|
82
|
+
transform_result=eval)
|
|
83
|
+
def repo_get_artifact_payload_by_uuid(node: Node,
|
|
84
|
+
uuid: str,
|
|
85
|
+
namespace: str = _param_default(_RS, '/artifacts/{uuid}/payload', 'get', 'namespace'),
|
|
86
|
+
include_content: rs.IncludeContentEnum = _schema_default(_RS, 'includeContentEnum')) -> bytes:
|
|
87
|
+
pass
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@_single_request_template(Node.make_rs_conf,
|
|
91
|
+
rs.ApiClient,
|
|
92
|
+
rs.ArtifactsApi,
|
|
93
|
+
rs.ArtifactsApi.get_artifacts,
|
|
94
|
+
remove_kwargs=['url', 'url_prefix'])
|
|
95
|
+
def repo_get_artifacts_by_auid_page(node: Node,
|
|
96
|
+
auid: str,
|
|
97
|
+
url: Optional[str] = None,
|
|
98
|
+
url_prefix: Optional[str] = None,
|
|
99
|
+
namespace: str = _param_default(_RS, '/aus/{auid}/artifacts', 'get', 'namespace'),
|
|
100
|
+
versions: Optional[Union[int, rs.VersionsEnum]] = None,
|
|
101
|
+
include_uncommitted: Optional[bool] = None,
|
|
102
|
+
limit: Optional[int] = None,
|
|
103
|
+
continuation_token: Optional[str] = None) -> rs.ArtifactPageInfo:
|
|
104
|
+
pass
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@_paged_request_iterator_template(repo_get_artifacts_by_auid_page,
|
|
108
|
+
lambda x: x.artifacts)
|
|
109
|
+
def repo_get_artifacts_by_auid(node: Node,
|
|
110
|
+
auid: str,
|
|
111
|
+
url: Optional[str] = None,
|
|
112
|
+
url_prefix: Optional[str] = None,
|
|
113
|
+
namespace: str = _param_default(_RS, '/aus/{auid}/artifacts', 'get', 'namespace'),
|
|
114
|
+
versions: Optional[Union[int, rs.VersionsEnum]] = None,
|
|
115
|
+
include_uncommitted: Optional[bool] = None,
|
|
116
|
+
limit: Optional[int] = None) -> Iterator[rs.Artifact]:
|
|
117
|
+
pass
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@_single_request_template(Node.make_rs_conf,
|
|
121
|
+
rs.ApiClient,
|
|
122
|
+
rs.ArtifactsApi,
|
|
123
|
+
rs.ArtifactsApi.get_artifacts_from_all_aus,
|
|
124
|
+
remove_kwargs=['url', 'url_prefix'])
|
|
125
|
+
def repo_get_artifacts_by_url_page(node: Node,
|
|
126
|
+
url: Optional[str] = None,
|
|
127
|
+
url_prefix: Optional[str] = None,
|
|
128
|
+
namespace: str = _param_default(_RS, '/artifacts', 'get', 'namespace'),
|
|
129
|
+
versions: rs.VersionsEnum = _schema_default(_RS, 'versionsEnum'),
|
|
130
|
+
limit: Optional[int] = None,
|
|
131
|
+
continuation_token: Optional[str] = None) -> rs.ArtifactPageInfo:
|
|
132
|
+
pass
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
@_paged_request_iterator_template(repo_get_artifacts_by_url_page,
|
|
136
|
+
lambda x: x.artifacts)
|
|
137
|
+
def repo_get_artifacts_by_url(node: Node,
|
|
138
|
+
url: Optional[str] = None,
|
|
139
|
+
url_prefix: Optional[str] = None,
|
|
140
|
+
namespace: str = _param_default(_RS, '/artifacts', 'get', 'namespace'),
|
|
141
|
+
versions: rs.VersionsEnum = _schema_default(_RS, 'versionsEnum'),
|
|
142
|
+
limit: Optional[int] = None) -> Iterator[rs.Artifact]:
|
|
143
|
+
pass
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
@_single_request_template(Node.make_rs_conf,
|
|
147
|
+
rs.ApiClient,
|
|
148
|
+
rs.AusApi,
|
|
149
|
+
rs.AusApi.get_artifacts_size)
|
|
150
|
+
def repo_get_au_size(node: Node,
|
|
151
|
+
auid: str,
|
|
152
|
+
namespace: str = _param_default(_RS, '/aus/{auid}/size', 'get', 'namespace')) -> rs.AuSize:
|
|
153
|
+
pass
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
@_single_request_template(Node.make_rs_conf,
|
|
157
|
+
rs.ApiClient,
|
|
158
|
+
rs.AusApi,
|
|
159
|
+
rs.AusApi.get_aus)
|
|
160
|
+
def repo_get_auids_page(node: Node,
|
|
161
|
+
namespace: str = _param_default(_RS, '/aus', 'get', 'namespace'),
|
|
162
|
+
limit: Optional[int] = None,
|
|
163
|
+
continuation_token: Optional[str] = None) -> rs.AuidPageInfo:
|
|
164
|
+
pass
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
@_paged_request_iterator_template(repo_get_auids_page,
|
|
168
|
+
lambda x: x.auids)
|
|
169
|
+
def repo_get_auids(node: Node,
|
|
170
|
+
namespace: str = _param_default(_RS, '/aus', 'get', 'namespace'),
|
|
171
|
+
limit: Optional[int] = None) -> Iterator[str]:
|
|
172
|
+
pass
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
@_single_request_template(Node.make_rs_conf,
|
|
176
|
+
rs.ApiClient,
|
|
177
|
+
rs.RepoApi,
|
|
178
|
+
rs.RepoApi.get_supported_checksum_algorithms)
|
|
179
|
+
def repo_get_checksum_algorithms(node: Node) -> list[str]:
|
|
180
|
+
pass
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
@_single_request_template(Node.make_rs_conf,
|
|
184
|
+
rs.ApiClient,
|
|
185
|
+
rs.RepoApi,
|
|
186
|
+
rs.RepoApi.get_repository_information)
|
|
187
|
+
def repo_get_info(node: Node) -> rs.RepositoryInfo:
|
|
188
|
+
pass
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
@_single_request_template(Node.make_rs_conf,
|
|
192
|
+
rs.ApiClient,
|
|
193
|
+
rs.RepoApi,
|
|
194
|
+
rs.RepoApi.get_namespaces)
|
|
195
|
+
def repo_get_namespaces(node: Node) -> list[str]:
|
|
196
|
+
pass
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
@_single_request_template(Node.make_rs_conf,
|
|
200
|
+
rs.ApiClient,
|
|
201
|
+
rs.StatusApi,
|
|
202
|
+
rs.StatusApi.get_status,
|
|
203
|
+
needs_auth=False)
|
|
204
|
+
def repo_get_status(node: Node) -> rs.ApiStatus:
|
|
205
|
+
pass
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
@_single_request_template(Node.make_rs_conf,
|
|
209
|
+
rs.ApiClient,
|
|
210
|
+
rs.RepoApi,
|
|
211
|
+
rs.RepoApi.get_storage_info)
|
|
212
|
+
def repo_get_storage_info(node: Node) -> rs.StorageInfo:
|
|
213
|
+
pass
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def repo_update_artifact(node: Node,
|
|
217
|
+
uuid: str,
|
|
218
|
+
committed: bool,
|
|
219
|
+
namespace: str = _param_default(_RS, '/artifacts/{uuid}', 'put', 'namespace')) -> rs.Artifact:
|
|
220
|
+
@_single_request_template(Node.make_rs_conf,
|
|
221
|
+
rs.ApiClient,
|
|
222
|
+
rs.ArtifactsApi,
|
|
223
|
+
rs.ArtifactsApi.update_artifact)
|
|
224
|
+
def _repo_update_artifact(node: Node,
|
|
225
|
+
committed: bool,
|
|
226
|
+
uuid: str,
|
|
227
|
+
namespace: str = _param_default(_RS, '/artifacts/{uuid}', 'put', 'namespace')) -> rs.Artifact:
|
|
228
|
+
pass
|
|
229
|
+
return _repo_update_artifact(node,
|
|
230
|
+
committed,
|
|
231
|
+
uuid,
|
|
232
|
+
namespace=namespace)
|