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,413 @@
|
|
|
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 HashApi(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 delete_hash(self, request_id, **kwargs): # noqa: E501
|
|
36
|
+
"""Remove an asynchronous hashing operation # noqa: E501
|
|
37
|
+
|
|
38
|
+
Remove from the system an asynchronous hashing operation, terminating it if it's still running # 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.delete_hash(request_id, async_req=True)
|
|
42
|
+
>>> result = thread.get()
|
|
43
|
+
|
|
44
|
+
:param async_req bool
|
|
45
|
+
:param str request_id: Identifier of the asynchronous hashing operation (required)
|
|
46
|
+
:return: str
|
|
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.delete_hash_with_http_info(request_id, **kwargs) # noqa: E501
|
|
53
|
+
else:
|
|
54
|
+
(data) = self.delete_hash_with_http_info(request_id, **kwargs) # noqa: E501
|
|
55
|
+
return data
|
|
56
|
+
|
|
57
|
+
def delete_hash_with_http_info(self, request_id, **kwargs): # noqa: E501
|
|
58
|
+
"""Remove an asynchronous hashing operation # noqa: E501
|
|
59
|
+
|
|
60
|
+
Remove from the system an asynchronous hashing operation, terminating it if it's still running # 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.delete_hash_with_http_info(request_id, async_req=True)
|
|
64
|
+
>>> result = thread.get()
|
|
65
|
+
|
|
66
|
+
:param async_req bool
|
|
67
|
+
:param str request_id: Identifier of the asynchronous hashing operation (required)
|
|
68
|
+
:return: str
|
|
69
|
+
If the method is called asynchronously,
|
|
70
|
+
returns the request thread.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
all_params = ['request_id'] # 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 delete_hash" % key
|
|
85
|
+
)
|
|
86
|
+
params[key] = val
|
|
87
|
+
del params['kwargs']
|
|
88
|
+
# verify the required parameter 'request_id' is set
|
|
89
|
+
if ('request_id' not in params or
|
|
90
|
+
params['request_id'] is None):
|
|
91
|
+
raise ValueError("Missing the required parameter `request_id` when calling `delete_hash`") # noqa: E501
|
|
92
|
+
|
|
93
|
+
collection_formats = {}
|
|
94
|
+
|
|
95
|
+
path_params = {}
|
|
96
|
+
if 'request_id' in params:
|
|
97
|
+
path_params['requestId'] = params['request_id'] # 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
|
+
'/ws/hashes/requests/{requestId}', 'DELETE',
|
|
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='str', # 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_all_hashes(self, **kwargs): # noqa: E501
|
|
131
|
+
"""Get the results of all the asynchronous hashing operations # noqa: E501
|
|
132
|
+
|
|
133
|
+
Get the results of all the asynchronous hashing operations # 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_all_hashes(async_req=True)
|
|
137
|
+
>>> result = thread.get()
|
|
138
|
+
|
|
139
|
+
:param async_req bool
|
|
140
|
+
:return: str
|
|
141
|
+
If the method is called asynchronously,
|
|
142
|
+
returns the request thread.
|
|
143
|
+
"""
|
|
144
|
+
kwargs['_return_http_data_only'] = True
|
|
145
|
+
if kwargs.get('async_req'):
|
|
146
|
+
return self.get_all_hashes_with_http_info(**kwargs) # noqa: E501
|
|
147
|
+
else:
|
|
148
|
+
(data) = self.get_all_hashes_with_http_info(**kwargs) # noqa: E501
|
|
149
|
+
return data
|
|
150
|
+
|
|
151
|
+
def get_all_hashes_with_http_info(self, **kwargs): # noqa: E501
|
|
152
|
+
"""Get the results of all the asynchronous hashing operations # noqa: E501
|
|
153
|
+
|
|
154
|
+
Get the results of all the asynchronous hashing operations # noqa: E501
|
|
155
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
156
|
+
asynchronous HTTP request, please pass async_req=True
|
|
157
|
+
>>> thread = api.get_all_hashes_with_http_info(async_req=True)
|
|
158
|
+
>>> result = thread.get()
|
|
159
|
+
|
|
160
|
+
:param async_req bool
|
|
161
|
+
:return: str
|
|
162
|
+
If the method is called asynchronously,
|
|
163
|
+
returns the request thread.
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
all_params = [] # noqa: E501
|
|
167
|
+
all_params.append('async_req')
|
|
168
|
+
all_params.append('_return_http_data_only')
|
|
169
|
+
all_params.append('_preload_content')
|
|
170
|
+
all_params.append('_request_timeout')
|
|
171
|
+
|
|
172
|
+
params = locals()
|
|
173
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
174
|
+
if key not in all_params:
|
|
175
|
+
raise TypeError(
|
|
176
|
+
"Got an unexpected keyword argument '%s'"
|
|
177
|
+
" to method get_all_hashes" % key
|
|
178
|
+
)
|
|
179
|
+
params[key] = val
|
|
180
|
+
del params['kwargs']
|
|
181
|
+
|
|
182
|
+
collection_formats = {}
|
|
183
|
+
|
|
184
|
+
path_params = {}
|
|
185
|
+
|
|
186
|
+
query_params = []
|
|
187
|
+
|
|
188
|
+
header_params = {}
|
|
189
|
+
|
|
190
|
+
form_params = []
|
|
191
|
+
local_var_files = {}
|
|
192
|
+
|
|
193
|
+
body_params = None
|
|
194
|
+
# HTTP header `Accept`
|
|
195
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
196
|
+
['multipart/form-data', 'application/json']) # noqa: E501
|
|
197
|
+
|
|
198
|
+
# Authentication setting
|
|
199
|
+
auth_settings = ['basicAuth'] # noqa: E501
|
|
200
|
+
|
|
201
|
+
return self.api_client.call_api(
|
|
202
|
+
'/ws/hashes', 'GET',
|
|
203
|
+
path_params,
|
|
204
|
+
query_params,
|
|
205
|
+
header_params,
|
|
206
|
+
body=body_params,
|
|
207
|
+
post_params=form_params,
|
|
208
|
+
files=local_var_files,
|
|
209
|
+
response_type='str', # noqa: E501
|
|
210
|
+
auth_settings=auth_settings,
|
|
211
|
+
async_req=params.get('async_req'),
|
|
212
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
213
|
+
_preload_content=params.get('_preload_content', True),
|
|
214
|
+
_request_timeout=params.get('_request_timeout'),
|
|
215
|
+
collection_formats=collection_formats)
|
|
216
|
+
|
|
217
|
+
def get_hash(self, request_id, **kwargs): # noqa: E501
|
|
218
|
+
"""Get the result of an asynchronous hashing operation # noqa: E501
|
|
219
|
+
|
|
220
|
+
Get the result of an asynchronous hashing operation # noqa: E501
|
|
221
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
222
|
+
asynchronous HTTP request, please pass async_req=True
|
|
223
|
+
>>> thread = api.get_hash(request_id, async_req=True)
|
|
224
|
+
>>> result = thread.get()
|
|
225
|
+
|
|
226
|
+
:param async_req bool
|
|
227
|
+
:param str request_id: Identifier of the asynchronous hashing operation (required)
|
|
228
|
+
:return: str
|
|
229
|
+
If the method is called asynchronously,
|
|
230
|
+
returns the request thread.
|
|
231
|
+
"""
|
|
232
|
+
kwargs['_return_http_data_only'] = True
|
|
233
|
+
if kwargs.get('async_req'):
|
|
234
|
+
return self.get_hash_with_http_info(request_id, **kwargs) # noqa: E501
|
|
235
|
+
else:
|
|
236
|
+
(data) = self.get_hash_with_http_info(request_id, **kwargs) # noqa: E501
|
|
237
|
+
return data
|
|
238
|
+
|
|
239
|
+
def get_hash_with_http_info(self, request_id, **kwargs): # noqa: E501
|
|
240
|
+
"""Get the result of an asynchronous hashing operation # noqa: E501
|
|
241
|
+
|
|
242
|
+
Get the result of an asynchronous hashing operation # noqa: E501
|
|
243
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
244
|
+
asynchronous HTTP request, please pass async_req=True
|
|
245
|
+
>>> thread = api.get_hash_with_http_info(request_id, async_req=True)
|
|
246
|
+
>>> result = thread.get()
|
|
247
|
+
|
|
248
|
+
:param async_req bool
|
|
249
|
+
:param str request_id: Identifier of the asynchronous hashing operation (required)
|
|
250
|
+
:return: str
|
|
251
|
+
If the method is called asynchronously,
|
|
252
|
+
returns the request thread.
|
|
253
|
+
"""
|
|
254
|
+
|
|
255
|
+
all_params = ['request_id'] # noqa: E501
|
|
256
|
+
all_params.append('async_req')
|
|
257
|
+
all_params.append('_return_http_data_only')
|
|
258
|
+
all_params.append('_preload_content')
|
|
259
|
+
all_params.append('_request_timeout')
|
|
260
|
+
|
|
261
|
+
params = locals()
|
|
262
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
263
|
+
if key not in all_params:
|
|
264
|
+
raise TypeError(
|
|
265
|
+
"Got an unexpected keyword argument '%s'"
|
|
266
|
+
" to method get_hash" % key
|
|
267
|
+
)
|
|
268
|
+
params[key] = val
|
|
269
|
+
del params['kwargs']
|
|
270
|
+
# verify the required parameter 'request_id' is set
|
|
271
|
+
if ('request_id' not in params or
|
|
272
|
+
params['request_id'] is None):
|
|
273
|
+
raise ValueError("Missing the required parameter `request_id` when calling `get_hash`") # noqa: E501
|
|
274
|
+
|
|
275
|
+
collection_formats = {}
|
|
276
|
+
|
|
277
|
+
path_params = {}
|
|
278
|
+
if 'request_id' in params:
|
|
279
|
+
path_params['requestId'] = params['request_id'] # noqa: E501
|
|
280
|
+
|
|
281
|
+
query_params = []
|
|
282
|
+
|
|
283
|
+
header_params = {}
|
|
284
|
+
|
|
285
|
+
form_params = []
|
|
286
|
+
local_var_files = {}
|
|
287
|
+
|
|
288
|
+
body_params = None
|
|
289
|
+
# HTTP header `Accept`
|
|
290
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
291
|
+
['multipart/form-data', 'application/json']) # noqa: E501
|
|
292
|
+
|
|
293
|
+
# Authentication setting
|
|
294
|
+
auth_settings = ['basicAuth'] # noqa: E501
|
|
295
|
+
|
|
296
|
+
return self.api_client.call_api(
|
|
297
|
+
'/ws/hashes/requests/{requestId}', 'GET',
|
|
298
|
+
path_params,
|
|
299
|
+
query_params,
|
|
300
|
+
header_params,
|
|
301
|
+
body=body_params,
|
|
302
|
+
post_params=form_params,
|
|
303
|
+
files=local_var_files,
|
|
304
|
+
response_type='str', # noqa: E501
|
|
305
|
+
auth_settings=auth_settings,
|
|
306
|
+
async_req=params.get('async_req'),
|
|
307
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
308
|
+
_preload_content=params.get('_preload_content', True),
|
|
309
|
+
_request_timeout=params.get('_request_timeout'),
|
|
310
|
+
collection_formats=collection_formats)
|
|
311
|
+
|
|
312
|
+
def put_hash(self, body, **kwargs): # noqa: E501
|
|
313
|
+
"""Perform a hashing operation # noqa: E501
|
|
314
|
+
|
|
315
|
+
Perform the hashing of an AU or a URL # noqa: E501
|
|
316
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
317
|
+
asynchronous HTTP request, please pass async_req=True
|
|
318
|
+
>>> thread = api.put_hash(body, async_req=True)
|
|
319
|
+
>>> result = thread.get()
|
|
320
|
+
|
|
321
|
+
:param async_req bool
|
|
322
|
+
:param HasherWsParams body: The parameters needed to define a hash. (required)
|
|
323
|
+
:param bool is_asynchronous: Indication of whether the operation should be done synchronously
|
|
324
|
+
:return: str
|
|
325
|
+
If the method is called asynchronously,
|
|
326
|
+
returns the request thread.
|
|
327
|
+
"""
|
|
328
|
+
kwargs['_return_http_data_only'] = True
|
|
329
|
+
if kwargs.get('async_req'):
|
|
330
|
+
return self.put_hash_with_http_info(body, **kwargs) # noqa: E501
|
|
331
|
+
else:
|
|
332
|
+
(data) = self.put_hash_with_http_info(body, **kwargs) # noqa: E501
|
|
333
|
+
return data
|
|
334
|
+
|
|
335
|
+
def put_hash_with_http_info(self, body, **kwargs): # noqa: E501
|
|
336
|
+
"""Perform a hashing operation # noqa: E501
|
|
337
|
+
|
|
338
|
+
Perform the hashing of an AU or a URL # noqa: E501
|
|
339
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
340
|
+
asynchronous HTTP request, please pass async_req=True
|
|
341
|
+
>>> thread = api.put_hash_with_http_info(body, async_req=True)
|
|
342
|
+
>>> result = thread.get()
|
|
343
|
+
|
|
344
|
+
:param async_req bool
|
|
345
|
+
:param HasherWsParams body: The parameters needed to define a hash. (required)
|
|
346
|
+
:param bool is_asynchronous: Indication of whether the operation should be done synchronously
|
|
347
|
+
:return: str
|
|
348
|
+
If the method is called asynchronously,
|
|
349
|
+
returns the request thread.
|
|
350
|
+
"""
|
|
351
|
+
|
|
352
|
+
all_params = ['body', 'is_asynchronous'] # noqa: E501
|
|
353
|
+
all_params.append('async_req')
|
|
354
|
+
all_params.append('_return_http_data_only')
|
|
355
|
+
all_params.append('_preload_content')
|
|
356
|
+
all_params.append('_request_timeout')
|
|
357
|
+
|
|
358
|
+
params = locals()
|
|
359
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
360
|
+
if key not in all_params:
|
|
361
|
+
raise TypeError(
|
|
362
|
+
"Got an unexpected keyword argument '%s'"
|
|
363
|
+
" to method put_hash" % key
|
|
364
|
+
)
|
|
365
|
+
params[key] = val
|
|
366
|
+
del params['kwargs']
|
|
367
|
+
# verify the required parameter 'body' is set
|
|
368
|
+
if ('body' not in params or
|
|
369
|
+
params['body'] is None):
|
|
370
|
+
raise ValueError("Missing the required parameter `body` when calling `put_hash`") # noqa: E501
|
|
371
|
+
|
|
372
|
+
collection_formats = {}
|
|
373
|
+
|
|
374
|
+
path_params = {}
|
|
375
|
+
|
|
376
|
+
query_params = []
|
|
377
|
+
if 'is_asynchronous' in params:
|
|
378
|
+
query_params.append(('isAsynchronous', params['is_asynchronous'])) # noqa: E501
|
|
379
|
+
|
|
380
|
+
header_params = {}
|
|
381
|
+
|
|
382
|
+
form_params = []
|
|
383
|
+
local_var_files = {}
|
|
384
|
+
|
|
385
|
+
body_params = None
|
|
386
|
+
if 'body' in params:
|
|
387
|
+
body_params = params['body']
|
|
388
|
+
# HTTP header `Accept`
|
|
389
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
390
|
+
['multipart/form-data', 'application/json']) # noqa: E501
|
|
391
|
+
|
|
392
|
+
# HTTP header `Content-Type`
|
|
393
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
|
394
|
+
['*/*']) # noqa: E501
|
|
395
|
+
|
|
396
|
+
# Authentication setting
|
|
397
|
+
auth_settings = ['basicAuth'] # noqa: E501
|
|
398
|
+
|
|
399
|
+
return self.api_client.call_api(
|
|
400
|
+
'/ws/hashes', 'PUT',
|
|
401
|
+
path_params,
|
|
402
|
+
query_params,
|
|
403
|
+
header_params,
|
|
404
|
+
body=body_params,
|
|
405
|
+
post_params=form_params,
|
|
406
|
+
files=local_var_files,
|
|
407
|
+
response_type='str', # noqa: E501
|
|
408
|
+
auth_settings=auth_settings,
|
|
409
|
+
async_req=params.get('async_req'),
|
|
410
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
411
|
+
_preload_content=params.get('_preload_content', True),
|
|
412
|
+
_request_timeout=params.get('_request_timeout'),
|
|
413
|
+
collection_formats=collection_formats)
|
|
@@ -0,0 +1,157 @@
|
|
|
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 ImportApi(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 put_import_file(self, target_base_url_path, target_url, file, user_properties, **kwargs): # noqa: E501
|
|
36
|
+
"""Import a file into an Archival Unit # noqa: E501
|
|
37
|
+
|
|
38
|
+
Import a file as an artifact in an Archival Unit # 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.put_import_file(target_base_url_path, target_url, file, user_properties, async_req=True)
|
|
42
|
+
>>> result = thread.get()
|
|
43
|
+
|
|
44
|
+
:param async_req bool
|
|
45
|
+
:param str target_base_url_path: (required)
|
|
46
|
+
:param str target_url: (required)
|
|
47
|
+
:param str file: (required)
|
|
48
|
+
:param list[str] user_properties: (required)
|
|
49
|
+
:return: None
|
|
50
|
+
If the method is called asynchronously,
|
|
51
|
+
returns the request thread.
|
|
52
|
+
"""
|
|
53
|
+
kwargs['_return_http_data_only'] = True
|
|
54
|
+
if kwargs.get('async_req'):
|
|
55
|
+
return self.put_import_file_with_http_info(target_base_url_path, target_url, file, user_properties, **kwargs) # noqa: E501
|
|
56
|
+
else:
|
|
57
|
+
(data) = self.put_import_file_with_http_info(target_base_url_path, target_url, file, user_properties, **kwargs) # noqa: E501
|
|
58
|
+
return data
|
|
59
|
+
|
|
60
|
+
def put_import_file_with_http_info(self, target_base_url_path, target_url, file, user_properties, **kwargs): # noqa: E501
|
|
61
|
+
"""Import a file into an Archival Unit # noqa: E501
|
|
62
|
+
|
|
63
|
+
Import a file as an artifact in an Archival Unit # noqa: E501
|
|
64
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
65
|
+
asynchronous HTTP request, please pass async_req=True
|
|
66
|
+
>>> thread = api.put_import_file_with_http_info(target_base_url_path, target_url, file, user_properties, async_req=True)
|
|
67
|
+
>>> result = thread.get()
|
|
68
|
+
|
|
69
|
+
:param async_req bool
|
|
70
|
+
:param str target_base_url_path: (required)
|
|
71
|
+
:param str target_url: (required)
|
|
72
|
+
:param str file: (required)
|
|
73
|
+
:param list[str] user_properties: (required)
|
|
74
|
+
:return: None
|
|
75
|
+
If the method is called asynchronously,
|
|
76
|
+
returns the request thread.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
all_params = ['target_base_url_path', 'target_url', 'file', 'user_properties'] # noqa: E501
|
|
80
|
+
all_params.append('async_req')
|
|
81
|
+
all_params.append('_return_http_data_only')
|
|
82
|
+
all_params.append('_preload_content')
|
|
83
|
+
all_params.append('_request_timeout')
|
|
84
|
+
|
|
85
|
+
params = locals()
|
|
86
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
87
|
+
if key not in all_params:
|
|
88
|
+
raise TypeError(
|
|
89
|
+
"Got an unexpected keyword argument '%s'"
|
|
90
|
+
" to method put_import_file" % key
|
|
91
|
+
)
|
|
92
|
+
params[key] = val
|
|
93
|
+
del params['kwargs']
|
|
94
|
+
# verify the required parameter 'target_base_url_path' is set
|
|
95
|
+
if ('target_base_url_path' not in params or
|
|
96
|
+
params['target_base_url_path'] is None):
|
|
97
|
+
raise ValueError("Missing the required parameter `target_base_url_path` when calling `put_import_file`") # noqa: E501
|
|
98
|
+
# verify the required parameter 'target_url' is set
|
|
99
|
+
if ('target_url' not in params or
|
|
100
|
+
params['target_url'] is None):
|
|
101
|
+
raise ValueError("Missing the required parameter `target_url` when calling `put_import_file`") # noqa: E501
|
|
102
|
+
# verify the required parameter 'file' is set
|
|
103
|
+
if ('file' not in params or
|
|
104
|
+
params['file'] is None):
|
|
105
|
+
raise ValueError("Missing the required parameter `file` when calling `put_import_file`") # noqa: E501
|
|
106
|
+
# verify the required parameter 'user_properties' is set
|
|
107
|
+
if ('user_properties' not in params or
|
|
108
|
+
params['user_properties'] is None):
|
|
109
|
+
raise ValueError("Missing the required parameter `user_properties` when calling `put_import_file`") # noqa: E501
|
|
110
|
+
|
|
111
|
+
collection_formats = {}
|
|
112
|
+
|
|
113
|
+
path_params = {}
|
|
114
|
+
|
|
115
|
+
query_params = []
|
|
116
|
+
|
|
117
|
+
header_params = {}
|
|
118
|
+
|
|
119
|
+
form_params = []
|
|
120
|
+
local_var_files = {}
|
|
121
|
+
if 'target_base_url_path' in params:
|
|
122
|
+
form_params.append(('targetBaseUrlPath', params['target_base_url_path'])) # noqa: E501
|
|
123
|
+
if 'target_url' in params:
|
|
124
|
+
form_params.append(('targetUrl', params['target_url'])) # noqa: E501
|
|
125
|
+
if 'file' in params:
|
|
126
|
+
local_var_files['file'] = params['file'] # noqa: E501
|
|
127
|
+
if 'user_properties' in params:
|
|
128
|
+
form_params.append(('userProperties', params['user_properties'])) # noqa: E501
|
|
129
|
+
collection_formats['userProperties'] = 'multi' # noqa: E501
|
|
130
|
+
|
|
131
|
+
body_params = None
|
|
132
|
+
# HTTP header `Accept`
|
|
133
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
134
|
+
['application/json']) # noqa: E501
|
|
135
|
+
|
|
136
|
+
# HTTP header `Content-Type`
|
|
137
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
|
138
|
+
['multipart/form-data']) # noqa: E501
|
|
139
|
+
|
|
140
|
+
# Authentication setting
|
|
141
|
+
auth_settings = ['basicAuth'] # noqa: E501
|
|
142
|
+
|
|
143
|
+
return self.api_client.call_api(
|
|
144
|
+
'/ws/aus/import', 'PUT',
|
|
145
|
+
path_params,
|
|
146
|
+
query_params,
|
|
147
|
+
header_params,
|
|
148
|
+
body=body_params,
|
|
149
|
+
post_params=form_params,
|
|
150
|
+
files=local_var_files,
|
|
151
|
+
response_type=None, # noqa: E501
|
|
152
|
+
auth_settings=auth_settings,
|
|
153
|
+
async_req=params.get('async_req'),
|
|
154
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
155
|
+
_preload_content=params.get('_preload_content', True),
|
|
156
|
+
_request_timeout=params.get('_request_timeout'),
|
|
157
|
+
collection_formats=collection_formats)
|