lockss-pyclient 0.1.0.dev1__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.
Files changed (93) hide show
  1. lockss/pyclient/__init__.py +8 -29
  2. lockss/pyclient/__main__.py +37 -0
  3. lockss/pyclient/_internal_common.py +395 -0
  4. lockss/pyclient/_internal_config.py +207 -0
  5. lockss/pyclient/_internal_crawler.py +251 -0
  6. lockss/pyclient/_internal_md.py +111 -0
  7. lockss/pyclient/_internal_poller.py +174 -0
  8. lockss/pyclient/_internal_rs.py +232 -0
  9. lockss/pyclient/cli.py +839 -0
  10. lockss/pyclient/config/__init__.py +15 -0
  11. lockss/pyclient/config/api/aus_api.py +14 -6
  12. lockss/pyclient/config/api/config_api.py +12 -12
  13. lockss/pyclient/config/api/utils_api.py +2 -2
  14. lockss/pyclient/config/configuration.py +1 -1
  15. lockss/pyclient/config/models/__init__.py +15 -0
  16. lockss/pyclient/config/models/access_type.py +90 -0
  17. lockss/pyclient/config/models/au_agreements.py +136 -0
  18. lockss/pyclient/config/models/au_config_page_info.py +140 -0
  19. lockss/pyclient/config/models/au_state_bean.py +942 -0
  20. lockss/pyclient/config/models/au_status.py +837 -8
  21. lockss/pyclient/config/models/au_suspect_url_versions.py +136 -0
  22. lockss/pyclient/config/models/check_substance_result.py +6 -22
  23. lockss/pyclient/config/models/dated_peer_id_set_impl.py +162 -0
  24. lockss/pyclient/config/models/hash_result.py +136 -0
  25. lockss/pyclient/config/models/page_info.py +226 -0
  26. lockss/pyclient/config/models/peer_agreement.py +188 -0
  27. lockss/pyclient/config/models/peer_agreements.py +136 -0
  28. lockss/pyclient/config/models/platform_configuration_ws_result.py +421 -8
  29. lockss/pyclient/config/models/platform_configuration_ws_result_daemon_version.py +188 -0
  30. lockss/pyclient/config/models/platform_configuration_ws_result_java_version.py +188 -0
  31. lockss/pyclient/config/models/platform_configuration_ws_result_platform.py +162 -0
  32. lockss/pyclient/config/models/substance_checker_state.py +91 -0
  33. lockss/pyclient/config/models/suspect_url_version.py +214 -0
  34. lockss/pyclient/config/swagger.yaml +2031 -0
  35. lockss/pyclient/crawler/__init__.py +1 -0
  36. lockss/pyclient/crawler/api/crawls_api.py +2 -2
  37. lockss/pyclient/crawler/configuration.py +1 -1
  38. lockss/pyclient/crawler/models/__init__.py +1 -0
  39. lockss/pyclient/crawler/models/crawl_desc.py +4 -12
  40. lockss/pyclient/crawler/models/crawl_kind_enum.py +90 -0
  41. lockss/pyclient/crawler/models/page_info.py +22 -24
  42. lockss/pyclient/crawler/swagger.yaml +1197 -0
  43. lockss/pyclient/md/configuration.py +1 -1
  44. lockss/pyclient/md/models/page_info.py +22 -24
  45. lockss/pyclient/md/swagger.yaml +583 -0
  46. lockss/pyclient/output.py +131 -0
  47. lockss/pyclient/poller/__init__.py +11 -5
  48. lockss/pyclient/poller/api/export_api.py +5 -5
  49. lockss/pyclient/poller/api/hash_api.py +3 -3
  50. lockss/pyclient/poller/api/poll_detail_api.py +42 -42
  51. lockss/pyclient/poller/api/poller_polls_api.py +18 -18
  52. lockss/pyclient/poller/api/service_api.py +2 -2
  53. lockss/pyclient/poller/api/voter_polls_api.py +18 -18
  54. lockss/pyclient/poller/configuration.py +1 -1
  55. lockss/pyclient/poller/models/__init__.py +11 -5
  56. lockss/pyclient/poller/models/export_file_type_enum.py +93 -0
  57. lockss/pyclient/poller/models/export_filename_translation_enum.py +91 -0
  58. lockss/pyclient/poller/models/page_info.py +226 -0
  59. lockss/pyclient/poller/models/poll_desc.py +3 -11
  60. lockss/pyclient/poller/models/poll_variant_enum.py +92 -0
  61. lockss/pyclient/poller/models/poller_page_info.py +140 -0
  62. lockss/pyclient/poller/models/repair_page_info.py +140 -0
  63. lockss/pyclient/poller/models/repair_type_enum.py +91 -0
  64. lockss/pyclient/poller/models/tally_type_enum.py +93 -0
  65. lockss/pyclient/poller/models/url_page_info.py +140 -0
  66. lockss/pyclient/poller/models/voter_page_info.py +140 -0
  67. lockss/pyclient/poller/models/voter_urls_enum.py +92 -0
  68. lockss/pyclient/poller/swagger.yaml +1658 -0
  69. lockss/pyclient/rs/__init__.py +6 -0
  70. lockss/pyclient/rs/api/artifacts_api.py +20 -20
  71. lockss/pyclient/rs/api/aus_api.py +5 -5
  72. lockss/pyclient/rs/api/repo_api.py +4 -4
  73. lockss/pyclient/rs/api/status_api.py +1 -1
  74. lockss/pyclient/rs/api/wayback_api.py +12 -12
  75. lockss/pyclient/rs/configuration.py +8 -1
  76. lockss/pyclient/rs/models/__init__.py +6 -0
  77. lockss/pyclient/rs/models/artifact.py +111 -81
  78. lockss/pyclient/rs/models/au_size.py +6 -0
  79. lockss/pyclient/rs/models/auid_page_info.py +2 -2
  80. lockss/pyclient/rs/models/bulk_au_op_enum.py +90 -0
  81. lockss/pyclient/rs/models/include_content_enum.py +91 -0
  82. lockss/pyclient/rs/models/page_info.py +26 -29
  83. lockss/pyclient/rs/models/pywb_match_enum.py +93 -0
  84. lockss/pyclient/rs/models/pywb_output_enum.py +90 -0
  85. lockss/pyclient/rs/models/pywb_sort_enum.py +91 -0
  86. lockss/pyclient/rs/models/storage_info.py +131 -80
  87. lockss/pyclient/rs/models/versions_enum.py +90 -0
  88. lockss/pyclient/rs/swagger.yaml +1306 -0
  89. {lockss_pyclient-0.1.0.dev1.dist-info → lockss_pyclient-0.1.0.dev3.dist-info}/METADATA +14 -7
  90. {lockss_pyclient-0.1.0.dev1.dist-info → lockss_pyclient-0.1.0.dev3.dist-info}/RECORD +93 -45
  91. {lockss_pyclient-0.1.0.dev1.dist-info → lockss_pyclient-0.1.0.dev3.dist-info}/WHEEL +1 -1
  92. lockss_pyclient-0.1.0.dev3.dist-info/entry_points.txt +3 -0
  93. {lockss_pyclient-0.1.0.dev1.dist-info → lockss_pyclient-0.1.0.dev3.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,251 @@
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 (crawler service).
33
+ """
34
+
35
+ from collections.abc import Iterator
36
+ from typing import Optional
37
+
38
+ from ._internal_common import Node, _paged_request_iterator_template, _single_request_template
39
+ from . import crawler
40
+
41
+
42
+ @_single_request_template(Node.make_crawler_conf,
43
+ crawler.ApiClient,
44
+ crawler.CrawlsApi,
45
+ crawler.CrawlsApi.get_crawl_by_id)
46
+ def crawler_get_crawl(node: Node,
47
+ job_id: str) -> crawler.CrawlStatus:
48
+ pass
49
+
50
+
51
+ @_single_request_template(Node.make_crawler_conf,
52
+ crawler.ApiClient,
53
+ crawler.CrawlsApi,
54
+ crawler.CrawlsApi.get_crawls)
55
+ def crawler_get_crawls_page(node: Node,
56
+ limit: Optional[int] = None,
57
+ continuation_token: Optional[str] = None) -> crawler.CrawlPager:
58
+ pass
59
+
60
+
61
+ @_paged_request_iterator_template(crawler_get_crawls_page,
62
+ lambda x: x.crawls)
63
+ def crawler_get_crawls(node: Node,
64
+ limit: Optional[int] = None) -> Iterator[crawler.CrawlStatus]:
65
+ pass
66
+
67
+ @_single_request_template(Node.make_crawler_conf,
68
+ crawler.ApiClient,
69
+ crawler.CrawlsApi,
70
+ crawler.CrawlsApi.get_crawl_by_mime_type)
71
+ def crawler_get_crawl_by_media_type_page(node: Node,
72
+ job_id: str,
73
+ media_type: str,
74
+ limit: Optional[int] = None,
75
+ continuation_token: Optional[str] = None) -> crawler.UrlPager:
76
+ pass
77
+
78
+
79
+ @_paged_request_iterator_template(crawler_get_crawl_by_media_type_page,
80
+ lambda x: x.urls)
81
+ def crawler_get_crawl_by_media_type(node: Node,
82
+ job_id: str,
83
+ media_type: str,
84
+ limit: Optional[int] = None) -> Iterator[crawler.UrlInfo]:
85
+ pass
86
+
87
+
88
+ @_single_request_template(Node.make_crawler_conf,
89
+ crawler.ApiClient,
90
+ crawler.CrawlsApi,
91
+ crawler.CrawlsApi.get_crawl_errors)
92
+ def crawler_get_crawl_errors_page(node: Node,
93
+ job_id: str,
94
+ limit: Optional[int] = None,
95
+ continuation_token: Optional[str] = None) -> crawler.UrlPager:
96
+ pass
97
+
98
+
99
+ @_paged_request_iterator_template(crawler_get_crawl_errors_page,
100
+ lambda x: x.urls)
101
+ def crawler_get_crawl_errors(node: Node,
102
+ job_id: str,
103
+ limit: Optional[int] = None) -> Iterator[crawler.UrlInfo]:
104
+ pass
105
+
106
+
107
+ @_single_request_template(Node.make_crawler_conf,
108
+ crawler.ApiClient,
109
+ crawler.CrawlsApi,
110
+ crawler.CrawlsApi.get_crawl_excluded)
111
+ def crawler_get_crawl_excluded_page(node: Node,
112
+ job_id: str,
113
+ limit: Optional[int] = None,
114
+ continuation_token: Optional[str] = None) -> crawler.UrlPager:
115
+ pass
116
+
117
+
118
+ @_paged_request_iterator_template(crawler_get_crawl_excluded_page,
119
+ lambda x: x.urls)
120
+ def crawler_get_crawl_excluded(node: Node,
121
+ job_id: str,
122
+ limit: Optional[int] = None) -> Iterator[crawler.UrlInfo]:
123
+ pass
124
+
125
+
126
+ @_single_request_template(Node.make_crawler_conf,
127
+ crawler.ApiClient,
128
+ crawler.CrawlsApi,
129
+ crawler.CrawlsApi.get_crawl_fetched)
130
+ def crawler_get_crawl_fetched_page(node: Node,
131
+ job_id: str,
132
+ limit: Optional[int] = None,
133
+ continuation_token: Optional[str] = None) -> crawler.UrlPager:
134
+ pass
135
+
136
+
137
+ @_paged_request_iterator_template(crawler_get_crawl_fetched_page,
138
+ lambda x: x.urls)
139
+ def crawler_get_crawl_fetched(node: Node,
140
+ job_id: str,
141
+ limit: Optional[int] = None) -> Iterator[crawler.UrlInfo]:
142
+ pass
143
+
144
+
145
+ @_single_request_template(Node.make_crawler_conf,
146
+ crawler.ApiClient,
147
+ crawler.CrawlsApi,
148
+ crawler.CrawlsApi.get_crawl_not_modified)
149
+ def crawler_get_crawl_not_modified_page(node: Node,
150
+ job_id: str,
151
+ limit: Optional[int] = None,
152
+ continuation_token: Optional[str] = None) -> crawler.UrlPager:
153
+ pass
154
+
155
+
156
+ @_paged_request_iterator_template(crawler_get_crawl_not_modified_page,
157
+ lambda x: x.urls)
158
+ def crawler_get_crawl_not_modified(node: Node,
159
+ job_id: str,
160
+ limit: Optional[int] = None) -> Iterator[crawler.UrlInfo]:
161
+ pass
162
+
163
+
164
+ @_single_request_template(Node.make_crawler_conf,
165
+ crawler.ApiClient,
166
+ crawler.CrawlsApi,
167
+ crawler.CrawlsApi.get_crawl_parsed)
168
+ def crawler_get_crawl_parsed_page(node: Node,
169
+ job_id: str,
170
+ limit: Optional[int] = None,
171
+ continuation_token: Optional[str] = None) -> crawler.UrlPager:
172
+ pass
173
+
174
+
175
+ @_paged_request_iterator_template(crawler_get_crawl_parsed_page,
176
+ lambda x: x.urls)
177
+ def crawler_get_crawl_parsed(node: Node,
178
+ job_id: str,
179
+ limit: Optional[int] = None) -> Iterator[crawler.UrlInfo]:
180
+ pass
181
+
182
+
183
+ @_single_request_template(Node.make_crawler_conf,
184
+ crawler.ApiClient,
185
+ crawler.CrawlsApi,
186
+ crawler.CrawlsApi.get_crawl_pending)
187
+ def crawler_get_crawl_pending_page(node: Node,
188
+ job_id: str,
189
+ limit: Optional[int] = None,
190
+ continuation_token: Optional[str] = None) -> crawler.UrlPager:
191
+ pass
192
+
193
+
194
+ @_paged_request_iterator_template(crawler_get_crawl_pending_page,
195
+ lambda x: x.urls)
196
+ def crawler_get_crawl_pending(node: Node,
197
+ job_id: str,
198
+ limit: Optional[int] = None) -> Iterator[crawler.UrlInfo]:
199
+ pass
200
+
201
+
202
+ @_single_request_template(Node.make_crawler_conf,
203
+ crawler.ApiClient,
204
+ crawler.CrawlersApi,
205
+ crawler.CrawlersApi.get_crawler_config)
206
+ def crawler_get_crawler(node: Node,
207
+ crawler_id: str) -> crawler.CrawlerConfig:
208
+ pass
209
+
210
+
211
+ @_single_request_template(Node.make_crawler_conf,
212
+ crawler.ApiClient,
213
+ crawler.CrawlersApi,
214
+ crawler.CrawlersApi.get_crawlers)
215
+ def crawler_get_crawlers(node: Node) -> crawler.CrawlerStatuses:
216
+ pass
217
+
218
+
219
+ @_single_request_template(Node.make_crawler_conf,
220
+ crawler.ApiClient,
221
+ crawler.JobsApi,
222
+ crawler.JobsApi.get_crawl_job)
223
+ def crawler_get_job(node: Node,
224
+ job_id: str) -> crawler.CrawlJob:
225
+ pass
226
+
227
+
228
+ @_single_request_template(Node.make_crawler_conf,
229
+ crawler.ApiClient,
230
+ crawler.JobsApi,
231
+ crawler.JobsApi.get_jobs)
232
+ def crawler_get_jobs_page(node: Node,
233
+ limit: Optional[int] = None,
234
+ continuation_token: Optional[str] = None) -> crawler.JobPager:
235
+ pass
236
+
237
+
238
+ @_paged_request_iterator_template(crawler_get_jobs_page,
239
+ lambda x: x.jobs)
240
+ def crawler_get_jobs(node: Node,
241
+ limit: Optional[int] = None) -> Iterator[crawler.CrawlJob]:
242
+ pass
243
+
244
+
245
+ @_single_request_template(Node.make_crawler_conf,
246
+ crawler.ApiClient,
247
+ crawler.StatusApi,
248
+ crawler.StatusApi.get_status,
249
+ needs_auth=False)
250
+ def crawler_get_status(node: Node) -> crawler.ApiStatus:
251
+ pass
@@ -0,0 +1,111 @@
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 (metadata service).
33
+ """
34
+
35
+ from collections.abc import Iterator
36
+ from typing import Optional
37
+
38
+ from ._internal_common import Node, _paged_request_iterator_template, _single_request_template
39
+ from . import md
40
+
41
+
42
+ @_single_request_template(Node.make_md_conf,
43
+ md.ApiClient,
44
+ md.UrlsApi,
45
+ md.UrlsApi.get_urls_doi)
46
+ def md_doi_query(node: Node,
47
+ doi: str) -> md.UrlInfo:
48
+ pass
49
+
50
+
51
+ @_single_request_template(Node.make_md_conf,
52
+ md.ApiClient,
53
+ md.MdupdatesApi,
54
+ md.MdupdatesApi.get_mdupdates_jobid)
55
+ def md_get_job(node: Node,
56
+ jobid: str) -> md.Status:
57
+ pass
58
+
59
+
60
+ @_single_request_template(Node.make_md_conf,
61
+ md.ApiClient,
62
+ md.MdupdatesApi,
63
+ md.MdupdatesApi.get_mdupdates)
64
+ def md_get_jobs_page(node: Node,
65
+ limit: Optional[int] = None,
66
+ continuation_token: Optional[str] = None) -> md.JobPageInfo:
67
+ pass
68
+
69
+
70
+ @_paged_request_iterator_template(md_get_jobs_page,
71
+ lambda x: x.jobs)
72
+ def md_get_jobs(node: Node,
73
+ limit: Optional[int] = None) -> Iterator[md.Job]:
74
+ pass
75
+
76
+
77
+ @_single_request_template(Node.make_md_conf,
78
+ md.ApiClient,
79
+ md.MetadataApi,
80
+ md.MetadataApi.get_metadata_aus_auid)
81
+ def md_get_metadata_page(node: Node,
82
+ auid: str,
83
+ limit: Optional[int] = None,
84
+ continuation_token: Optional[str] = None) -> md.AuMetadataPageInfo:
85
+ pass
86
+
87
+
88
+ @_paged_request_iterator_template(md_get_metadata_page,
89
+ lambda x: x.items)
90
+ def md_get_metadata(node: Node,
91
+ auid: str,
92
+ limit: Optional[int] = None) -> Iterator[md.ItemMetadata]:
93
+ pass
94
+
95
+
96
+ @_single_request_template(Node.make_md_conf,
97
+ md.ApiClient,
98
+ md.StatusApi,
99
+ md.StatusApi.get_status,
100
+ needs_auth=False)
101
+ def md_get_status(node: Node) -> md.ApiStatus:
102
+ pass
103
+
104
+
105
+ @_single_request_template(Node.make_md_conf,
106
+ md.ApiClient,
107
+ md.UrlsApi,
108
+ md.UrlsApi.get_urls_open_url)
109
+ def md_openurl_query(node: Node,
110
+ params: list[str]) -> md.UrlInfo:
111
+ pass
@@ -0,0 +1,174 @@
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 (poller service).
33
+ """
34
+
35
+ from collections.abc import Iterator
36
+ from typing import Optional
37
+
38
+ from ._internal_common import Node, _single_request_template, _paged_request_iterator_template
39
+ from . import poller
40
+
41
+
42
+ @_single_request_template(Node.make_poller_conf,
43
+ poller.ApiClient,
44
+ poller.PollDetailApi,
45
+ poller.PollDetailApi.get_poll_peer_vote_urls)
46
+ def poller_get_peer_data_page(node: Node,
47
+ poll_key: str,
48
+ peer_id: str,
49
+ url_type: poller.VoterUrlsEnum,
50
+ limit: Optional[int] = None,
51
+ continuation_token: Optional[str] = None) -> poller.UrlPageInfo:
52
+ pass
53
+
54
+
55
+ @_paged_request_iterator_template(poller_get_peer_data_page,
56
+ lambda x: x.urls)
57
+ def poller_get_peer_data(node: Node,
58
+ poll_key: str,
59
+ peer_id: str,
60
+ url_type: poller.VoterUrlsEnum,
61
+ limit: Optional[int] = None) -> Iterator[str]:
62
+ pass
63
+
64
+
65
+ @_single_request_template(Node.make_poller_conf,
66
+ poller.ApiClient,
67
+ poller.ServiceApi,
68
+ poller.ServiceApi.get_poll_status)
69
+ def poller_get_poll_status(node: Node,
70
+ job_id: str) -> poller.PollerSummary:
71
+ pass
72
+
73
+
74
+ @_single_request_template(Node.make_poller_conf,
75
+ poller.ApiClient,
76
+ poller.PollerPollsApi,
77
+ poller.PollerPollsApi.get_poller_poll_details)
78
+ def poller_get_poller_poll(node: Node,
79
+ poll_key: str) -> poller.PollerDetail:
80
+ pass
81
+
82
+
83
+ @_single_request_template(Node.make_poller_conf,
84
+ poller.ApiClient,
85
+ poller.PollerPollsApi,
86
+ poller.PollerPollsApi.get_polls_as_poller)
87
+ def poller_get_poller_polls_page(node: Node,
88
+ limit: Optional[int] = None,
89
+ continuation_token: Optional[str] = None) -> poller.PollerPageInfo:
90
+ pass
91
+
92
+
93
+ @_paged_request_iterator_template(poller_get_poller_polls_page,
94
+ lambda x: x.polls)
95
+ def poller_get_poller_polls(node: Node,
96
+ limit: Optional[int] = None) -> Iterator[poller.PollerSummary]:
97
+ pass
98
+
99
+
100
+ @_single_request_template(Node.make_poller_conf,
101
+ poller.ApiClient,
102
+ poller.PollDetailApi,
103
+ poller.PollDetailApi.get_repair_queue_data)
104
+ def poller_get_repair_data_page(node: Node,
105
+ poll_key: str,
106
+ repair_type: poller.RepairTypeEnum,
107
+ limit: Optional[int] = None,
108
+ continuation_token: Optional[str] = None) -> poller.RepairPageInfo:
109
+ pass
110
+
111
+
112
+ @_paged_request_iterator_template(poller_get_repair_data_page,
113
+ lambda x: x.repairs)
114
+ def poller_get_repair_data(node: Node,
115
+ poll_key: str,
116
+ repair_type: poller.RepairTypeEnum,
117
+ limit: Optional[int] = None) -> Iterator[poller.RepairData]:
118
+ pass
119
+
120
+
121
+ @_single_request_template(Node.make_poller_conf,
122
+ poller.ApiClient,
123
+ poller.ServiceApi,
124
+ poller.ServiceApi.get_status,
125
+ needs_auth=False)
126
+ def poller_get_status(node: Node) -> poller.ApiStatus:
127
+ pass
128
+
129
+
130
+ @_single_request_template(Node.make_poller_conf,
131
+ poller.ApiClient,
132
+ poller.PollDetailApi,
133
+ poller.PollDetailApi.get_tally_urls)
134
+ def poller_get_tally_urls_page(node: Node,
135
+ poll_key: str,
136
+ tally_type: poller.TallyTypeEnum,
137
+ limit: Optional[int] = None,
138
+ continuation_token: Optional[str] = None) -> poller.UrlPageInfo:
139
+ pass
140
+
141
+
142
+ @_paged_request_iterator_template(poller_get_tally_urls_page,
143
+ lambda x: x.urls)
144
+ def poller_get_tally_urls(node: Node,
145
+ poll_key: str,
146
+ tally_type: poller.TallyTypeEnum,
147
+ limit: Optional[int] = None) -> Iterator[str]:
148
+ pass
149
+
150
+
151
+ @_single_request_template(Node.make_poller_conf,
152
+ poller.ApiClient,
153
+ poller.VoterPollsApi,
154
+ poller.VoterPollsApi.get_voter_poll_details)
155
+ def poller_get_voter_poll(node: Node,
156
+ poll_key: str) -> poller.VoterDetail:
157
+ pass
158
+
159
+
160
+ @_single_request_template(Node.make_poller_conf,
161
+ poller.ApiClient,
162
+ poller.VoterPollsApi,
163
+ poller.VoterPollsApi.get_polls_as_voter)
164
+ def poller_get_voter_polls_page(node: Node,
165
+ limit: Optional[int] = None,
166
+ continuation_token: Optional[str] = None) -> poller.PollerPageInfo:
167
+ pass
168
+
169
+
170
+ @_paged_request_iterator_template(poller_get_voter_polls_page,
171
+ lambda x: x.polls)
172
+ def poller_get_voter_polls(node: Node,
173
+ limit: Optional[int] = None) -> Iterator[poller.PollerSummary]:
174
+ pass