lockss-pyclient 0.1.0.dev1__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 +67 -0
- lockss/pyclient/config/__init__.py +42 -0
- lockss/pyclient/config/api/__init__.py +12 -0
- lockss/pyclient/config/api/aus_api.py +2195 -0
- lockss/pyclient/config/api/config_api.py +718 -0
- lockss/pyclient/config/api/plugins_api.py +128 -0
- lockss/pyclient/config/api/status_api.py +120 -0
- lockss/pyclient/config/api/tdb_api.py +318 -0
- lockss/pyclient/config/api/users_api.py +516 -0
- lockss/pyclient/config/api/utils_api.py +128 -0
- lockss/pyclient/config/api_client.py +632 -0
- lockss/pyclient/config/configuration.py +254 -0
- lockss/pyclient/config/models/__init__.py +30 -0
- lockss/pyclient/config/models/api_status.py +344 -0
- lockss/pyclient/config/models/au_configuration.py +142 -0
- lockss/pyclient/config/models/au_status.py +113 -0
- lockss/pyclient/config/models/au_ws_result.py +113 -0
- lockss/pyclient/config/models/auids_body.py +168 -0
- lockss/pyclient/config/models/check_substance_result.py +212 -0
- lockss/pyclient/config/models/content_configuration_result.py +200 -0
- lockss/pyclient/config/models/file_section_name_body.py +113 -0
- lockss/pyclient/config/models/platform_configuration_ws_result.py +113 -0
- lockss/pyclient/config/models/plugin_ws_result.py +345 -0
- lockss/pyclient/config/models/request_au_control_result.py +171 -0
- lockss/pyclient/config/models/tdb_au_ws_result.py +360 -0
- lockss/pyclient/config/models/tdb_publisher_ws_result.py +113 -0
- lockss/pyclient/config/models/tdb_title_ws_result.py +390 -0
- lockss/pyclient/config/rest.py +317 -0
- lockss/pyclient/crawler/__init__.py +45 -0
- lockss/pyclient/crawler/api/__init__.py +10 -0
- lockss/pyclient/crawler/api/crawlers_api.py +215 -0
- lockss/pyclient/crawler/api/crawls_api.py +952 -0
- lockss/pyclient/crawler/api/jobs_api.py +504 -0
- lockss/pyclient/crawler/api/status_api.py +120 -0
- lockss/pyclient/crawler/api/ws_api.py +128 -0
- lockss/pyclient/crawler/api_client.py +632 -0
- lockss/pyclient/crawler/configuration.py +254 -0
- lockss/pyclient/crawler/models/__init__.py +35 -0
- lockss/pyclient/crawler/models/api_status.py +344 -0
- lockss/pyclient/crawler/models/counter.py +142 -0
- lockss/pyclient/crawler/models/crawl_desc.py +344 -0
- lockss/pyclient/crawler/models/crawl_job.py +280 -0
- lockss/pyclient/crawler/models/crawl_pager.py +140 -0
- lockss/pyclient/crawler/models/crawl_status.py +780 -0
- lockss/pyclient/crawler/models/crawl_ws_result.py +814 -0
- lockss/pyclient/crawler/models/crawl_ws_result_pages_with_errors.py +162 -0
- lockss/pyclient/crawler/models/crawler_config.py +142 -0
- lockss/pyclient/crawler/models/crawler_status.py +279 -0
- lockss/pyclient/crawler/models/crawler_statuses.py +112 -0
- lockss/pyclient/crawler/models/error_result.py +164 -0
- lockss/pyclient/crawler/models/job_pager.py +140 -0
- lockss/pyclient/crawler/models/job_status.py +147 -0
- lockss/pyclient/crawler/models/mime_counter.py +169 -0
- lockss/pyclient/crawler/models/page_info.py +228 -0
- lockss/pyclient/crawler/models/url_error.py +148 -0
- lockss/pyclient/crawler/models/url_info.py +167 -0
- lockss/pyclient/crawler/models/url_pager.py +140 -0
- lockss/pyclient/crawler/rest.py +317 -0
- lockss/pyclient/md/__init__.py +36 -0
- lockss/pyclient/md/api/__init__.py +9 -0
- lockss/pyclient/md/api/mdupdates_api.py +508 -0
- lockss/pyclient/md/api/metadata_api.py +136 -0
- lockss/pyclient/md/api/status_api.py +120 -0
- lockss/pyclient/md/api/urls_api.py +224 -0
- lockss/pyclient/md/api_client.py +632 -0
- lockss/pyclient/md/configuration.py +254 -0
- lockss/pyclient/md/models/__init__.py +27 -0
- lockss/pyclient/md/models/api_status.py +344 -0
- lockss/pyclient/md/models/au.py +169 -0
- lockss/pyclient/md/models/au_metadata_page_info.py +140 -0
- lockss/pyclient/md/models/error_result.py +164 -0
- lockss/pyclient/md/models/item_metadata.py +196 -0
- lockss/pyclient/md/models/job.py +280 -0
- lockss/pyclient/md/models/job_page_info.py +140 -0
- lockss/pyclient/md/models/metadata_update_spec.py +142 -0
- lockss/pyclient/md/models/page_info.py +228 -0
- lockss/pyclient/md/models/status.py +142 -0
- lockss/pyclient/md/models/url_info.py +142 -0
- lockss/pyclient/md/rest.py +317 -0
- lockss/pyclient/poller/__init__.py +54 -0
- lockss/pyclient/poller/api/__init__.py +13 -0
- lockss/pyclient/poller/api/export_api.py +156 -0
- lockss/pyclient/poller/api/hash_api.py +413 -0
- lockss/pyclient/poller/api/import_api.py +157 -0
- lockss/pyclient/poller/api/poll_detail_api.py +374 -0
- lockss/pyclient/poller/api/poller_polls_api.py +223 -0
- lockss/pyclient/poller/api/repo_api.py +223 -0
- lockss/pyclient/poller/api/service_api.py +694 -0
- lockss/pyclient/poller/api/voter_polls_api.py +223 -0
- lockss/pyclient/poller/api_client.py +632 -0
- lockss/pyclient/poller/configuration.py +254 -0
- lockss/pyclient/poller/models/__init__.py +41 -0
- lockss/pyclient/poller/models/api_status.py +344 -0
- lockss/pyclient/poller/models/aus_import_body.py +199 -0
- lockss/pyclient/poller/models/cached_uri_set_spec.py +169 -0
- lockss/pyclient/poller/models/error_result.py +164 -0
- lockss/pyclient/poller/models/hasher_ws_params.py +432 -0
- lockss/pyclient/poller/models/link_desc.py +141 -0
- lockss/pyclient/poller/models/page_desc.py +227 -0
- lockss/pyclient/poller/models/peer_data.py +638 -0
- lockss/pyclient/poller/models/peer_ws_result.py +113 -0
- lockss/pyclient/poller/models/poll_desc.py +285 -0
- lockss/pyclient/poller/models/poll_ws_result.py +142 -0
- lockss/pyclient/poller/models/poller_detail.py +613 -0
- lockss/pyclient/poller/models/poller_pager.py +139 -0
- lockss/pyclient/poller/models/poller_summary.py +452 -0
- lockss/pyclient/poller/models/repair_data.py +176 -0
- lockss/pyclient/poller/models/repair_pager.py +139 -0
- lockss/pyclient/poller/models/repair_queue.py +249 -0
- lockss/pyclient/poller/models/repository_space_ws_result.py +113 -0
- lockss/pyclient/poller/models/repository_ws_result.py +113 -0
- lockss/pyclient/poller/models/tally_data.py +471 -0
- lockss/pyclient/poller/models/url_pager.py +139 -0
- lockss/pyclient/poller/models/vote_ws_result.py +142 -0
- lockss/pyclient/poller/models/voter_detail.py +701 -0
- lockss/pyclient/poller/models/voter_pager.py +139 -0
- lockss/pyclient/poller/models/voter_summary.py +284 -0
- lockss/pyclient/poller/rest.py +317 -0
- lockss/pyclient/rs/__init__.py +41 -0
- lockss/pyclient/rs/api/__init__.py +10 -0
- lockss/pyclient/rs/api/artifacts_api.py +988 -0
- lockss/pyclient/rs/api/aus_api.py +334 -0
- lockss/pyclient/rs/api/repo_api.py +379 -0
- lockss/pyclient/rs/api/status_api.py +120 -0
- lockss/pyclient/rs/api/wayback_api.py +386 -0
- lockss/pyclient/rs/api_client.py +632 -0
- lockss/pyclient/rs/configuration.py +247 -0
- lockss/pyclient/rs/models/__init__.py +31 -0
- lockss/pyclient/rs/models/api_status.py +344 -0
- lockss/pyclient/rs/models/archives_body.py +142 -0
- lockss/pyclient/rs/models/artifact.py +344 -0
- lockss/pyclient/rs/models/artifact_page_info.py +140 -0
- lockss/pyclient/rs/models/artifact_properties.py +344 -0
- lockss/pyclient/rs/models/artifacts_body.py +170 -0
- lockss/pyclient/rs/models/au_size.py +162 -0
- lockss/pyclient/rs/models/auid_page_info.py +140 -0
- lockss/pyclient/rs/models/error_result.py +164 -0
- lockss/pyclient/rs/models/import_status.py +298 -0
- lockss/pyclient/rs/models/page_info.py +229 -0
- lockss/pyclient/rs/models/repository_info.py +164 -0
- lockss/pyclient/rs/models/repository_statistics.py +112 -0
- lockss/pyclient/rs/models/storage_info.py +287 -0
- lockss/pyclient/rs/models/streaming_response_body.py +84 -0
- lockss/pyclient/rs/rest.py +317 -0
- lockss_pyclient-0.1.0.dev1.dist-info/LICENSE +27 -0
- lockss_pyclient-0.1.0.dev1.dist-info/METADATA +29 -0
- lockss_pyclient-0.1.0.dev1.dist-info/RECORD +148 -0
- lockss_pyclient-0.1.0.dev1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
LOCKSS Poller Service REST API
|
|
5
|
+
|
|
6
|
+
REST API of the LOCKSS Poller Service # noqa: E501
|
|
7
|
+
|
|
8
|
+
OpenAPI spec version: 2.0.0
|
|
9
|
+
Contact: lockss-support@lockss.org
|
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import absolute_import
|
|
14
|
+
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
|
|
17
|
+
# python 2 and python 3 compatibility library
|
|
18
|
+
import six
|
|
19
|
+
|
|
20
|
+
from lockss.pyclient.poller.api_client import ApiClient
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class PollDetailApi(object):
|
|
24
|
+
"""NOTE: This class is auto generated by the swagger code generator program.
|
|
25
|
+
|
|
26
|
+
Do not edit the class manually.
|
|
27
|
+
Ref: https://github.com/swagger-api/swagger-codegen
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
def __init__(self, api_client=None):
|
|
31
|
+
if api_client is None:
|
|
32
|
+
api_client = ApiClient()
|
|
33
|
+
self.api_client = api_client
|
|
34
|
+
|
|
35
|
+
def get_poll_peer_vote_urls(self, poll_key, peer_id, urls, **kwargs): # noqa: E501
|
|
36
|
+
"""Poll Peer Data # noqa: E501
|
|
37
|
+
|
|
38
|
+
Return the list of urls of vote type for a given peer in a specific poll. # noqa: E501
|
|
39
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
40
|
+
asynchronous HTTP request, please pass async_req=True
|
|
41
|
+
>>> thread = api.get_poll_peer_vote_urls(poll_key, peer_id, urls, async_req=True)
|
|
42
|
+
>>> result = thread.get()
|
|
43
|
+
|
|
44
|
+
:param async_req bool
|
|
45
|
+
:param str poll_key: The pollKey from the PollDetail. (required)
|
|
46
|
+
:param str peer_id: The peerId from the Poll Detail.PeerData. (required)
|
|
47
|
+
:param str urls: The voter urls to return. (required)
|
|
48
|
+
:param int page: The page number
|
|
49
|
+
:param int size: The page size
|
|
50
|
+
:return: UrlPager
|
|
51
|
+
If the method is called asynchronously,
|
|
52
|
+
returns the request thread.
|
|
53
|
+
"""
|
|
54
|
+
kwargs['_return_http_data_only'] = True
|
|
55
|
+
if kwargs.get('async_req'):
|
|
56
|
+
return self.get_poll_peer_vote_urls_with_http_info(poll_key, peer_id, urls, **kwargs) # noqa: E501
|
|
57
|
+
else:
|
|
58
|
+
(data) = self.get_poll_peer_vote_urls_with_http_info(poll_key, peer_id, urls, **kwargs) # noqa: E501
|
|
59
|
+
return data
|
|
60
|
+
|
|
61
|
+
def get_poll_peer_vote_urls_with_http_info(self, poll_key, peer_id, urls, **kwargs): # noqa: E501
|
|
62
|
+
"""Poll Peer Data # noqa: E501
|
|
63
|
+
|
|
64
|
+
Return the list of urls of vote type for a given peer in a specific poll. # noqa: E501
|
|
65
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
66
|
+
asynchronous HTTP request, please pass async_req=True
|
|
67
|
+
>>> thread = api.get_poll_peer_vote_urls_with_http_info(poll_key, peer_id, urls, async_req=True)
|
|
68
|
+
>>> result = thread.get()
|
|
69
|
+
|
|
70
|
+
:param async_req bool
|
|
71
|
+
:param str poll_key: The pollKey from the PollDetail. (required)
|
|
72
|
+
:param str peer_id: The peerId from the Poll Detail.PeerData. (required)
|
|
73
|
+
:param str urls: The voter urls to return. (required)
|
|
74
|
+
:param int page: The page number
|
|
75
|
+
:param int size: The page size
|
|
76
|
+
:return: UrlPager
|
|
77
|
+
If the method is called asynchronously,
|
|
78
|
+
returns the request thread.
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
all_params = ['poll_key', 'peer_id', 'urls', 'page', 'size'] # noqa: E501
|
|
82
|
+
all_params.append('async_req')
|
|
83
|
+
all_params.append('_return_http_data_only')
|
|
84
|
+
all_params.append('_preload_content')
|
|
85
|
+
all_params.append('_request_timeout')
|
|
86
|
+
|
|
87
|
+
params = locals()
|
|
88
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
89
|
+
if key not in all_params:
|
|
90
|
+
raise TypeError(
|
|
91
|
+
"Got an unexpected keyword argument '%s'"
|
|
92
|
+
" to method get_poll_peer_vote_urls" % key
|
|
93
|
+
)
|
|
94
|
+
params[key] = val
|
|
95
|
+
del params['kwargs']
|
|
96
|
+
# verify the required parameter 'poll_key' is set
|
|
97
|
+
if ('poll_key' not in params or
|
|
98
|
+
params['poll_key'] is None):
|
|
99
|
+
raise ValueError("Missing the required parameter `poll_key` when calling `get_poll_peer_vote_urls`") # noqa: E501
|
|
100
|
+
# verify the required parameter 'peer_id' is set
|
|
101
|
+
if ('peer_id' not in params or
|
|
102
|
+
params['peer_id'] is None):
|
|
103
|
+
raise ValueError("Missing the required parameter `peer_id` when calling `get_poll_peer_vote_urls`") # noqa: E501
|
|
104
|
+
# verify the required parameter 'urls' is set
|
|
105
|
+
if ('urls' not in params or
|
|
106
|
+
params['urls'] is None):
|
|
107
|
+
raise ValueError("Missing the required parameter `urls` when calling `get_poll_peer_vote_urls`") # noqa: E501
|
|
108
|
+
|
|
109
|
+
collection_formats = {}
|
|
110
|
+
|
|
111
|
+
path_params = {}
|
|
112
|
+
if 'poll_key' in params:
|
|
113
|
+
path_params['pollKey'] = params['poll_key'] # noqa: E501
|
|
114
|
+
if 'peer_id' in params:
|
|
115
|
+
path_params['peerId'] = params['peer_id'] # noqa: E501
|
|
116
|
+
|
|
117
|
+
query_params = []
|
|
118
|
+
if 'urls' in params:
|
|
119
|
+
query_params.append(('urls', params['urls'])) # noqa: E501
|
|
120
|
+
if 'page' in params:
|
|
121
|
+
query_params.append(('page', params['page'])) # noqa: E501
|
|
122
|
+
if 'size' in params:
|
|
123
|
+
query_params.append(('size', params['size'])) # noqa: E501
|
|
124
|
+
|
|
125
|
+
header_params = {}
|
|
126
|
+
|
|
127
|
+
form_params = []
|
|
128
|
+
local_var_files = {}
|
|
129
|
+
|
|
130
|
+
body_params = None
|
|
131
|
+
# HTTP header `Accept`
|
|
132
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
133
|
+
['application/json']) # noqa: E501
|
|
134
|
+
|
|
135
|
+
# Authentication setting
|
|
136
|
+
auth_settings = ['basicAuth'] # noqa: E501
|
|
137
|
+
|
|
138
|
+
return self.api_client.call_api(
|
|
139
|
+
'/polls/{pollKey}/peer/{peerId}', 'GET',
|
|
140
|
+
path_params,
|
|
141
|
+
query_params,
|
|
142
|
+
header_params,
|
|
143
|
+
body=body_params,
|
|
144
|
+
post_params=form_params,
|
|
145
|
+
files=local_var_files,
|
|
146
|
+
response_type='UrlPager', # noqa: E501
|
|
147
|
+
auth_settings=auth_settings,
|
|
148
|
+
async_req=params.get('async_req'),
|
|
149
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
150
|
+
_preload_content=params.get('_preload_content', True),
|
|
151
|
+
_request_timeout=params.get('_request_timeout'),
|
|
152
|
+
collection_formats=collection_formats)
|
|
153
|
+
|
|
154
|
+
def get_repair_queue_data(self, poll_key, repair, **kwargs): # noqa: E501
|
|
155
|
+
"""Poll Repairs # noqa: E501
|
|
156
|
+
|
|
157
|
+
Return the repair status for a specific poll. # noqa: E501
|
|
158
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
159
|
+
asynchronous HTTP request, please pass async_req=True
|
|
160
|
+
>>> thread = api.get_repair_queue_data(poll_key, repair, async_req=True)
|
|
161
|
+
>>> result = thread.get()
|
|
162
|
+
|
|
163
|
+
:param async_req bool
|
|
164
|
+
:param str poll_key: The pollKey as listed in the PollDetail object. (required)
|
|
165
|
+
:param str repair: The repair queue elements to return. (required)
|
|
166
|
+
:param int page: The page number.
|
|
167
|
+
:param int size: The size of the page.
|
|
168
|
+
:return: RepairPager
|
|
169
|
+
If the method is called asynchronously,
|
|
170
|
+
returns the request thread.
|
|
171
|
+
"""
|
|
172
|
+
kwargs['_return_http_data_only'] = True
|
|
173
|
+
if kwargs.get('async_req'):
|
|
174
|
+
return self.get_repair_queue_data_with_http_info(poll_key, repair, **kwargs) # noqa: E501
|
|
175
|
+
else:
|
|
176
|
+
(data) = self.get_repair_queue_data_with_http_info(poll_key, repair, **kwargs) # noqa: E501
|
|
177
|
+
return data
|
|
178
|
+
|
|
179
|
+
def get_repair_queue_data_with_http_info(self, poll_key, repair, **kwargs): # noqa: E501
|
|
180
|
+
"""Poll Repairs # noqa: E501
|
|
181
|
+
|
|
182
|
+
Return the repair status for a specific poll. # noqa: E501
|
|
183
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
184
|
+
asynchronous HTTP request, please pass async_req=True
|
|
185
|
+
>>> thread = api.get_repair_queue_data_with_http_info(poll_key, repair, async_req=True)
|
|
186
|
+
>>> result = thread.get()
|
|
187
|
+
|
|
188
|
+
:param async_req bool
|
|
189
|
+
:param str poll_key: The pollKey as listed in the PollDetail object. (required)
|
|
190
|
+
:param str repair: The repair queue elements to return. (required)
|
|
191
|
+
:param int page: The page number.
|
|
192
|
+
:param int size: The size of the page.
|
|
193
|
+
:return: RepairPager
|
|
194
|
+
If the method is called asynchronously,
|
|
195
|
+
returns the request thread.
|
|
196
|
+
"""
|
|
197
|
+
|
|
198
|
+
all_params = ['poll_key', 'repair', 'page', 'size'] # noqa: E501
|
|
199
|
+
all_params.append('async_req')
|
|
200
|
+
all_params.append('_return_http_data_only')
|
|
201
|
+
all_params.append('_preload_content')
|
|
202
|
+
all_params.append('_request_timeout')
|
|
203
|
+
|
|
204
|
+
params = locals()
|
|
205
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
206
|
+
if key not in all_params:
|
|
207
|
+
raise TypeError(
|
|
208
|
+
"Got an unexpected keyword argument '%s'"
|
|
209
|
+
" to method get_repair_queue_data" % key
|
|
210
|
+
)
|
|
211
|
+
params[key] = val
|
|
212
|
+
del params['kwargs']
|
|
213
|
+
# verify the required parameter 'poll_key' is set
|
|
214
|
+
if ('poll_key' not in params or
|
|
215
|
+
params['poll_key'] is None):
|
|
216
|
+
raise ValueError("Missing the required parameter `poll_key` when calling `get_repair_queue_data`") # noqa: E501
|
|
217
|
+
# verify the required parameter 'repair' is set
|
|
218
|
+
if ('repair' not in params or
|
|
219
|
+
params['repair'] is None):
|
|
220
|
+
raise ValueError("Missing the required parameter `repair` when calling `get_repair_queue_data`") # noqa: E501
|
|
221
|
+
|
|
222
|
+
collection_formats = {}
|
|
223
|
+
|
|
224
|
+
path_params = {}
|
|
225
|
+
if 'poll_key' in params:
|
|
226
|
+
path_params['pollKey'] = params['poll_key'] # noqa: E501
|
|
227
|
+
|
|
228
|
+
query_params = []
|
|
229
|
+
if 'repair' in params:
|
|
230
|
+
query_params.append(('repair', params['repair'])) # noqa: E501
|
|
231
|
+
if 'page' in params:
|
|
232
|
+
query_params.append(('page', params['page'])) # noqa: E501
|
|
233
|
+
if 'size' in params:
|
|
234
|
+
query_params.append(('size', params['size'])) # noqa: E501
|
|
235
|
+
|
|
236
|
+
header_params = {}
|
|
237
|
+
|
|
238
|
+
form_params = []
|
|
239
|
+
local_var_files = {}
|
|
240
|
+
|
|
241
|
+
body_params = None
|
|
242
|
+
# HTTP header `Accept`
|
|
243
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
244
|
+
['application/json']) # noqa: E501
|
|
245
|
+
|
|
246
|
+
# Authentication setting
|
|
247
|
+
auth_settings = ['basicAuth'] # noqa: E501
|
|
248
|
+
|
|
249
|
+
return self.api_client.call_api(
|
|
250
|
+
'/polls/{pollKey}/repairs', 'GET',
|
|
251
|
+
path_params,
|
|
252
|
+
query_params,
|
|
253
|
+
header_params,
|
|
254
|
+
body=body_params,
|
|
255
|
+
post_params=form_params,
|
|
256
|
+
files=local_var_files,
|
|
257
|
+
response_type='RepairPager', # noqa: E501
|
|
258
|
+
auth_settings=auth_settings,
|
|
259
|
+
async_req=params.get('async_req'),
|
|
260
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
261
|
+
_preload_content=params.get('_preload_content', True),
|
|
262
|
+
_request_timeout=params.get('_request_timeout'),
|
|
263
|
+
collection_formats=collection_formats)
|
|
264
|
+
|
|
265
|
+
def get_tally_urls(self, poll_key, tally, **kwargs): # noqa: E501
|
|
266
|
+
"""Page Tally # noqa: E501
|
|
267
|
+
|
|
268
|
+
Return the vote tallies for a specific poll. # noqa: E501
|
|
269
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
270
|
+
asynchronous HTTP request, please pass async_req=True
|
|
271
|
+
>>> thread = api.get_tally_urls(poll_key, tally, async_req=True)
|
|
272
|
+
>>> result = thread.get()
|
|
273
|
+
|
|
274
|
+
:param async_req bool
|
|
275
|
+
:param str poll_key: The pollKey as listed in the PollDetail object. (required)
|
|
276
|
+
:param str tally: The kind of tally element to return. (required)
|
|
277
|
+
:param int page: The page number.
|
|
278
|
+
:param int size: The size of the page.
|
|
279
|
+
:return: UrlPager
|
|
280
|
+
If the method is called asynchronously,
|
|
281
|
+
returns the request thread.
|
|
282
|
+
"""
|
|
283
|
+
kwargs['_return_http_data_only'] = True
|
|
284
|
+
if kwargs.get('async_req'):
|
|
285
|
+
return self.get_tally_urls_with_http_info(poll_key, tally, **kwargs) # noqa: E501
|
|
286
|
+
else:
|
|
287
|
+
(data) = self.get_tally_urls_with_http_info(poll_key, tally, **kwargs) # noqa: E501
|
|
288
|
+
return data
|
|
289
|
+
|
|
290
|
+
def get_tally_urls_with_http_info(self, poll_key, tally, **kwargs): # noqa: E501
|
|
291
|
+
"""Page Tally # noqa: E501
|
|
292
|
+
|
|
293
|
+
Return the vote tallies for a specific poll. # noqa: E501
|
|
294
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
295
|
+
asynchronous HTTP request, please pass async_req=True
|
|
296
|
+
>>> thread = api.get_tally_urls_with_http_info(poll_key, tally, async_req=True)
|
|
297
|
+
>>> result = thread.get()
|
|
298
|
+
|
|
299
|
+
:param async_req bool
|
|
300
|
+
:param str poll_key: The pollKey as listed in the PollDetail object. (required)
|
|
301
|
+
:param str tally: The kind of tally element to return. (required)
|
|
302
|
+
:param int page: The page number.
|
|
303
|
+
:param int size: The size of the page.
|
|
304
|
+
:return: UrlPager
|
|
305
|
+
If the method is called asynchronously,
|
|
306
|
+
returns the request thread.
|
|
307
|
+
"""
|
|
308
|
+
|
|
309
|
+
all_params = ['poll_key', 'tally', 'page', 'size'] # noqa: E501
|
|
310
|
+
all_params.append('async_req')
|
|
311
|
+
all_params.append('_return_http_data_only')
|
|
312
|
+
all_params.append('_preload_content')
|
|
313
|
+
all_params.append('_request_timeout')
|
|
314
|
+
|
|
315
|
+
params = locals()
|
|
316
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
317
|
+
if key not in all_params:
|
|
318
|
+
raise TypeError(
|
|
319
|
+
"Got an unexpected keyword argument '%s'"
|
|
320
|
+
" to method get_tally_urls" % key
|
|
321
|
+
)
|
|
322
|
+
params[key] = val
|
|
323
|
+
del params['kwargs']
|
|
324
|
+
# verify the required parameter 'poll_key' is set
|
|
325
|
+
if ('poll_key' not in params or
|
|
326
|
+
params['poll_key'] is None):
|
|
327
|
+
raise ValueError("Missing the required parameter `poll_key` when calling `get_tally_urls`") # noqa: E501
|
|
328
|
+
# verify the required parameter 'tally' is set
|
|
329
|
+
if ('tally' not in params or
|
|
330
|
+
params['tally'] is None):
|
|
331
|
+
raise ValueError("Missing the required parameter `tally` when calling `get_tally_urls`") # noqa: E501
|
|
332
|
+
|
|
333
|
+
collection_formats = {}
|
|
334
|
+
|
|
335
|
+
path_params = {}
|
|
336
|
+
if 'poll_key' in params:
|
|
337
|
+
path_params['pollKey'] = params['poll_key'] # noqa: E501
|
|
338
|
+
|
|
339
|
+
query_params = []
|
|
340
|
+
if 'tally' in params:
|
|
341
|
+
query_params.append(('tally', params['tally'])) # noqa: E501
|
|
342
|
+
if 'page' in params:
|
|
343
|
+
query_params.append(('page', params['page'])) # noqa: E501
|
|
344
|
+
if 'size' in params:
|
|
345
|
+
query_params.append(('size', params['size'])) # noqa: E501
|
|
346
|
+
|
|
347
|
+
header_params = {}
|
|
348
|
+
|
|
349
|
+
form_params = []
|
|
350
|
+
local_var_files = {}
|
|
351
|
+
|
|
352
|
+
body_params = None
|
|
353
|
+
# HTTP header `Accept`
|
|
354
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
355
|
+
['application/json']) # noqa: E501
|
|
356
|
+
|
|
357
|
+
# Authentication setting
|
|
358
|
+
auth_settings = ['basicAuth'] # noqa: E501
|
|
359
|
+
|
|
360
|
+
return self.api_client.call_api(
|
|
361
|
+
'/polls/{pollKey}/tallies', 'GET',
|
|
362
|
+
path_params,
|
|
363
|
+
query_params,
|
|
364
|
+
header_params,
|
|
365
|
+
body=body_params,
|
|
366
|
+
post_params=form_params,
|
|
367
|
+
files=local_var_files,
|
|
368
|
+
response_type='UrlPager', # noqa: E501
|
|
369
|
+
auth_settings=auth_settings,
|
|
370
|
+
async_req=params.get('async_req'),
|
|
371
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
372
|
+
_preload_content=params.get('_preload_content', True),
|
|
373
|
+
_request_timeout=params.get('_request_timeout'),
|
|
374
|
+
collection_formats=collection_formats)
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
LOCKSS Poller Service REST API
|
|
5
|
+
|
|
6
|
+
REST API of the LOCKSS Poller Service # noqa: E501
|
|
7
|
+
|
|
8
|
+
OpenAPI spec version: 2.0.0
|
|
9
|
+
Contact: lockss-support@lockss.org
|
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import absolute_import
|
|
14
|
+
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
|
|
17
|
+
# python 2 and python 3 compatibility library
|
|
18
|
+
import six
|
|
19
|
+
|
|
20
|
+
from lockss.pyclient.poller.api_client import ApiClient
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class PollerPollsApi(object):
|
|
24
|
+
"""NOTE: This class is auto generated by the swagger code generator program.
|
|
25
|
+
|
|
26
|
+
Do not edit the class manually.
|
|
27
|
+
Ref: https://github.com/swagger-api/swagger-codegen
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
def __init__(self, api_client=None):
|
|
31
|
+
if api_client is None:
|
|
32
|
+
api_client = ApiClient()
|
|
33
|
+
self.api_client = api_client
|
|
34
|
+
|
|
35
|
+
def get_poller_poll_details(self, poll_key, **kwargs): # noqa: E501
|
|
36
|
+
"""PollerDetails # noqa: E501
|
|
37
|
+
|
|
38
|
+
Return the detailed information about a poll. # noqa: E501
|
|
39
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
40
|
+
asynchronous HTTP request, please pass async_req=True
|
|
41
|
+
>>> thread = api.get_poller_poll_details(poll_key, async_req=True)
|
|
42
|
+
>>> result = thread.get()
|
|
43
|
+
|
|
44
|
+
:param async_req bool
|
|
45
|
+
:param str poll_key: The key assigned by the PollManager. (required)
|
|
46
|
+
:return: PollerDetail
|
|
47
|
+
If the method is called asynchronously,
|
|
48
|
+
returns the request thread.
|
|
49
|
+
"""
|
|
50
|
+
kwargs['_return_http_data_only'] = True
|
|
51
|
+
if kwargs.get('async_req'):
|
|
52
|
+
return self.get_poller_poll_details_with_http_info(poll_key, **kwargs) # noqa: E501
|
|
53
|
+
else:
|
|
54
|
+
(data) = self.get_poller_poll_details_with_http_info(poll_key, **kwargs) # noqa: E501
|
|
55
|
+
return data
|
|
56
|
+
|
|
57
|
+
def get_poller_poll_details_with_http_info(self, poll_key, **kwargs): # noqa: E501
|
|
58
|
+
"""PollerDetails # noqa: E501
|
|
59
|
+
|
|
60
|
+
Return the detailed information about a poll. # noqa: E501
|
|
61
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
62
|
+
asynchronous HTTP request, please pass async_req=True
|
|
63
|
+
>>> thread = api.get_poller_poll_details_with_http_info(poll_key, async_req=True)
|
|
64
|
+
>>> result = thread.get()
|
|
65
|
+
|
|
66
|
+
:param async_req bool
|
|
67
|
+
:param str poll_key: The key assigned by the PollManager. (required)
|
|
68
|
+
:return: PollerDetail
|
|
69
|
+
If the method is called asynchronously,
|
|
70
|
+
returns the request thread.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
all_params = ['poll_key'] # noqa: E501
|
|
74
|
+
all_params.append('async_req')
|
|
75
|
+
all_params.append('_return_http_data_only')
|
|
76
|
+
all_params.append('_preload_content')
|
|
77
|
+
all_params.append('_request_timeout')
|
|
78
|
+
|
|
79
|
+
params = locals()
|
|
80
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
81
|
+
if key not in all_params:
|
|
82
|
+
raise TypeError(
|
|
83
|
+
"Got an unexpected keyword argument '%s'"
|
|
84
|
+
" to method get_poller_poll_details" % key
|
|
85
|
+
)
|
|
86
|
+
params[key] = val
|
|
87
|
+
del params['kwargs']
|
|
88
|
+
# verify the required parameter 'poll_key' is set
|
|
89
|
+
if ('poll_key' not in params or
|
|
90
|
+
params['poll_key'] is None):
|
|
91
|
+
raise ValueError("Missing the required parameter `poll_key` when calling `get_poller_poll_details`") # noqa: E501
|
|
92
|
+
|
|
93
|
+
collection_formats = {}
|
|
94
|
+
|
|
95
|
+
path_params = {}
|
|
96
|
+
if 'poll_key' in params:
|
|
97
|
+
path_params['pollKey'] = params['poll_key'] # noqa: E501
|
|
98
|
+
|
|
99
|
+
query_params = []
|
|
100
|
+
|
|
101
|
+
header_params = {}
|
|
102
|
+
|
|
103
|
+
form_params = []
|
|
104
|
+
local_var_files = {}
|
|
105
|
+
|
|
106
|
+
body_params = None
|
|
107
|
+
# HTTP header `Accept`
|
|
108
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
109
|
+
['application/json']) # noqa: E501
|
|
110
|
+
|
|
111
|
+
# Authentication setting
|
|
112
|
+
auth_settings = ['basicAuth'] # noqa: E501
|
|
113
|
+
|
|
114
|
+
return self.api_client.call_api(
|
|
115
|
+
'/polls/poller/{pollKey}', 'GET',
|
|
116
|
+
path_params,
|
|
117
|
+
query_params,
|
|
118
|
+
header_params,
|
|
119
|
+
body=body_params,
|
|
120
|
+
post_params=form_params,
|
|
121
|
+
files=local_var_files,
|
|
122
|
+
response_type='PollerDetail', # noqa: E501
|
|
123
|
+
auth_settings=auth_settings,
|
|
124
|
+
async_req=params.get('async_req'),
|
|
125
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
126
|
+
_preload_content=params.get('_preload_content', True),
|
|
127
|
+
_request_timeout=params.get('_request_timeout'),
|
|
128
|
+
collection_formats=collection_formats)
|
|
129
|
+
|
|
130
|
+
def get_polls_as_poller(self, **kwargs): # noqa: E501
|
|
131
|
+
"""Get the list of recent polls as poller. # noqa: E501
|
|
132
|
+
|
|
133
|
+
Get the list of recent polls as poller from the poll queue. if size and page are passed in use those arguments to limit return data. # noqa: E501
|
|
134
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
135
|
+
asynchronous HTTP request, please pass async_req=True
|
|
136
|
+
>>> thread = api.get_polls_as_poller(async_req=True)
|
|
137
|
+
>>> result = thread.get()
|
|
138
|
+
|
|
139
|
+
:param async_req bool
|
|
140
|
+
:param int size: Size of the page to retrieve.
|
|
141
|
+
:param int page: Number of the page to retrieve.
|
|
142
|
+
:return: PollerPager
|
|
143
|
+
If the method is called asynchronously,
|
|
144
|
+
returns the request thread.
|
|
145
|
+
"""
|
|
146
|
+
kwargs['_return_http_data_only'] = True
|
|
147
|
+
if kwargs.get('async_req'):
|
|
148
|
+
return self.get_polls_as_poller_with_http_info(**kwargs) # noqa: E501
|
|
149
|
+
else:
|
|
150
|
+
(data) = self.get_polls_as_poller_with_http_info(**kwargs) # noqa: E501
|
|
151
|
+
return data
|
|
152
|
+
|
|
153
|
+
def get_polls_as_poller_with_http_info(self, **kwargs): # noqa: E501
|
|
154
|
+
"""Get the list of recent polls as poller. # noqa: E501
|
|
155
|
+
|
|
156
|
+
Get the list of recent polls as poller from the poll queue. if size and page are passed in use those arguments to limit return data. # noqa: E501
|
|
157
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
158
|
+
asynchronous HTTP request, please pass async_req=True
|
|
159
|
+
>>> thread = api.get_polls_as_poller_with_http_info(async_req=True)
|
|
160
|
+
>>> result = thread.get()
|
|
161
|
+
|
|
162
|
+
:param async_req bool
|
|
163
|
+
:param int size: Size of the page to retrieve.
|
|
164
|
+
:param int page: Number of the page to retrieve.
|
|
165
|
+
:return: PollerPager
|
|
166
|
+
If the method is called asynchronously,
|
|
167
|
+
returns the request thread.
|
|
168
|
+
"""
|
|
169
|
+
|
|
170
|
+
all_params = ['size', 'page'] # noqa: E501
|
|
171
|
+
all_params.append('async_req')
|
|
172
|
+
all_params.append('_return_http_data_only')
|
|
173
|
+
all_params.append('_preload_content')
|
|
174
|
+
all_params.append('_request_timeout')
|
|
175
|
+
|
|
176
|
+
params = locals()
|
|
177
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
178
|
+
if key not in all_params:
|
|
179
|
+
raise TypeError(
|
|
180
|
+
"Got an unexpected keyword argument '%s'"
|
|
181
|
+
" to method get_polls_as_poller" % key
|
|
182
|
+
)
|
|
183
|
+
params[key] = val
|
|
184
|
+
del params['kwargs']
|
|
185
|
+
|
|
186
|
+
collection_formats = {}
|
|
187
|
+
|
|
188
|
+
path_params = {}
|
|
189
|
+
|
|
190
|
+
query_params = []
|
|
191
|
+
if 'size' in params:
|
|
192
|
+
query_params.append(('size', params['size'])) # noqa: E501
|
|
193
|
+
if 'page' in params:
|
|
194
|
+
query_params.append(('page', params['page'])) # noqa: E501
|
|
195
|
+
|
|
196
|
+
header_params = {}
|
|
197
|
+
|
|
198
|
+
form_params = []
|
|
199
|
+
local_var_files = {}
|
|
200
|
+
|
|
201
|
+
body_params = None
|
|
202
|
+
# HTTP header `Accept`
|
|
203
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
204
|
+
['application/json']) # noqa: E501
|
|
205
|
+
|
|
206
|
+
# Authentication setting
|
|
207
|
+
auth_settings = ['basicAuth'] # noqa: E501
|
|
208
|
+
|
|
209
|
+
return self.api_client.call_api(
|
|
210
|
+
'/polls/poller', 'GET',
|
|
211
|
+
path_params,
|
|
212
|
+
query_params,
|
|
213
|
+
header_params,
|
|
214
|
+
body=body_params,
|
|
215
|
+
post_params=form_params,
|
|
216
|
+
files=local_var_files,
|
|
217
|
+
response_type='PollerPager', # noqa: E501
|
|
218
|
+
auth_settings=auth_settings,
|
|
219
|
+
async_req=params.get('async_req'),
|
|
220
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
221
|
+
_preload_content=params.get('_preload_content', True),
|
|
222
|
+
_request_timeout=params.get('_request_timeout'),
|
|
223
|
+
collection_formats=collection_formats)
|