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,254 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
LOCKSS Crawler Service REST API
|
|
5
|
+
|
|
6
|
+
REST API of the LOCKSS Crawler 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 copy
|
|
16
|
+
import logging
|
|
17
|
+
import multiprocessing
|
|
18
|
+
import sys
|
|
19
|
+
import urllib3
|
|
20
|
+
|
|
21
|
+
import six
|
|
22
|
+
from six.moves import http_client as httplib
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class TypeWithDefault(type):
|
|
26
|
+
def __init__(cls, name, bases, dct):
|
|
27
|
+
super(TypeWithDefault, cls).__init__(name, bases, dct)
|
|
28
|
+
cls._default = None
|
|
29
|
+
|
|
30
|
+
def __call__(cls):
|
|
31
|
+
if cls._default is None:
|
|
32
|
+
cls._default = type.__call__(cls)
|
|
33
|
+
return copy.copy(cls._default)
|
|
34
|
+
|
|
35
|
+
def set_default(cls, default):
|
|
36
|
+
cls._default = copy.copy(default)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
|
40
|
+
"""NOTE: This class is auto generated by the swagger code generator program.
|
|
41
|
+
|
|
42
|
+
Ref: https://github.com/swagger-api/swagger-codegen
|
|
43
|
+
Do not edit the class manually.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
def __init__(self):
|
|
47
|
+
"""Constructor"""
|
|
48
|
+
# Default Base url
|
|
49
|
+
self.host = "https://laaws.lockss.org:443/"
|
|
50
|
+
# Temp file folder for downloading files
|
|
51
|
+
self.temp_folder_path = None
|
|
52
|
+
|
|
53
|
+
# Authentication Settings
|
|
54
|
+
# dict to store API key(s)
|
|
55
|
+
self.api_key = {}
|
|
56
|
+
# dict to store API prefix (e.g. Bearer)
|
|
57
|
+
self.api_key_prefix = {}
|
|
58
|
+
# function to refresh API key if expired
|
|
59
|
+
self.refresh_api_key_hook = None
|
|
60
|
+
# Username for HTTP basic authentication
|
|
61
|
+
self.username = ""
|
|
62
|
+
# Password for HTTP basic authentication
|
|
63
|
+
self.password = ""
|
|
64
|
+
# Logging Settings
|
|
65
|
+
self.logger = {}
|
|
66
|
+
self.logger["package_logger"] = logging.getLogger("lockss.pyclient.crawler")
|
|
67
|
+
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
|
68
|
+
# Log format
|
|
69
|
+
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
|
70
|
+
# Log stream handler
|
|
71
|
+
self.logger_stream_handler = None
|
|
72
|
+
# Log file handler
|
|
73
|
+
self.logger_file_handler = None
|
|
74
|
+
# Debug file location
|
|
75
|
+
self.logger_file = None
|
|
76
|
+
# Debug switch
|
|
77
|
+
self.debug = False
|
|
78
|
+
|
|
79
|
+
# SSL/TLS verification
|
|
80
|
+
# Set this to false to skip verifying SSL certificate when calling API
|
|
81
|
+
# from https server.
|
|
82
|
+
self.verify_ssl = True
|
|
83
|
+
# Set this to customize the certificate file to verify the peer.
|
|
84
|
+
self.ssl_ca_cert = None
|
|
85
|
+
# client certificate file
|
|
86
|
+
self.cert_file = None
|
|
87
|
+
# client key file
|
|
88
|
+
self.key_file = None
|
|
89
|
+
# Set this to True/False to enable/disable SSL hostname verification.
|
|
90
|
+
self.assert_hostname = None
|
|
91
|
+
|
|
92
|
+
# urllib3 connection pool's maximum number of connections saved
|
|
93
|
+
# per pool. urllib3 uses 1 connection as default value, but this is
|
|
94
|
+
# not the best value when you are making a lot of possibly parallel
|
|
95
|
+
# requests to the same host, which is often the case here.
|
|
96
|
+
# cpu_count * 5 is used as default value to increase performance.
|
|
97
|
+
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
|
|
98
|
+
|
|
99
|
+
# Proxy URL
|
|
100
|
+
self.proxy = None
|
|
101
|
+
# Safe chars for path_param
|
|
102
|
+
self.safe_chars_for_path_param = ''
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def logger_file(self):
|
|
106
|
+
"""The logger file.
|
|
107
|
+
|
|
108
|
+
If the logger_file is None, then add stream handler and remove file
|
|
109
|
+
handler. Otherwise, add file handler and remove stream handler.
|
|
110
|
+
|
|
111
|
+
:param value: The logger_file path.
|
|
112
|
+
:type: str
|
|
113
|
+
"""
|
|
114
|
+
return self.__logger_file
|
|
115
|
+
|
|
116
|
+
@logger_file.setter
|
|
117
|
+
def logger_file(self, value):
|
|
118
|
+
"""The logger file.
|
|
119
|
+
|
|
120
|
+
If the logger_file is None, then add stream handler and remove file
|
|
121
|
+
handler. Otherwise, add file handler and remove stream handler.
|
|
122
|
+
|
|
123
|
+
:param value: The logger_file path.
|
|
124
|
+
:type: str
|
|
125
|
+
"""
|
|
126
|
+
self.__logger_file = value
|
|
127
|
+
if self.__logger_file:
|
|
128
|
+
# If set logging file,
|
|
129
|
+
# then add file handler and remove stream handler.
|
|
130
|
+
self.logger_file_handler = logging.FileHandler(self.__logger_file)
|
|
131
|
+
self.logger_file_handler.setFormatter(self.logger_formatter)
|
|
132
|
+
for _, logger in six.iteritems(self.logger):
|
|
133
|
+
logger.addHandler(self.logger_file_handler)
|
|
134
|
+
if self.logger_stream_handler:
|
|
135
|
+
logger.removeHandler(self.logger_stream_handler)
|
|
136
|
+
else:
|
|
137
|
+
# If not set logging file,
|
|
138
|
+
# then add stream handler and remove file handler.
|
|
139
|
+
self.logger_stream_handler = logging.StreamHandler()
|
|
140
|
+
self.logger_stream_handler.setFormatter(self.logger_formatter)
|
|
141
|
+
for _, logger in six.iteritems(self.logger):
|
|
142
|
+
logger.addHandler(self.logger_stream_handler)
|
|
143
|
+
if self.logger_file_handler:
|
|
144
|
+
logger.removeHandler(self.logger_file_handler)
|
|
145
|
+
|
|
146
|
+
@property
|
|
147
|
+
def debug(self):
|
|
148
|
+
"""Debug status
|
|
149
|
+
|
|
150
|
+
:param value: The debug status, True or False.
|
|
151
|
+
:type: bool
|
|
152
|
+
"""
|
|
153
|
+
return self.__debug
|
|
154
|
+
|
|
155
|
+
@debug.setter
|
|
156
|
+
def debug(self, value):
|
|
157
|
+
"""Debug status
|
|
158
|
+
|
|
159
|
+
:param value: The debug status, True or False.
|
|
160
|
+
:type: bool
|
|
161
|
+
"""
|
|
162
|
+
self.__debug = value
|
|
163
|
+
if self.__debug:
|
|
164
|
+
# if debug status is True, turn on debug logging
|
|
165
|
+
for _, logger in six.iteritems(self.logger):
|
|
166
|
+
logger.setLevel(logging.DEBUG)
|
|
167
|
+
# turn on httplib debug
|
|
168
|
+
httplib.HTTPConnection.debuglevel = 1
|
|
169
|
+
else:
|
|
170
|
+
# if debug status is False, turn off debug logging,
|
|
171
|
+
# setting log level to default `logging.WARNING`
|
|
172
|
+
for _, logger in six.iteritems(self.logger):
|
|
173
|
+
logger.setLevel(logging.WARNING)
|
|
174
|
+
# turn off httplib debug
|
|
175
|
+
httplib.HTTPConnection.debuglevel = 0
|
|
176
|
+
|
|
177
|
+
@property
|
|
178
|
+
def logger_format(self):
|
|
179
|
+
"""The logger format.
|
|
180
|
+
|
|
181
|
+
The logger_formatter will be updated when sets logger_format.
|
|
182
|
+
|
|
183
|
+
:param value: The format string.
|
|
184
|
+
:type: str
|
|
185
|
+
"""
|
|
186
|
+
return self.__logger_format
|
|
187
|
+
|
|
188
|
+
@logger_format.setter
|
|
189
|
+
def logger_format(self, value):
|
|
190
|
+
"""The logger format.
|
|
191
|
+
|
|
192
|
+
The logger_formatter will be updated when sets logger_format.
|
|
193
|
+
|
|
194
|
+
:param value: The format string.
|
|
195
|
+
:type: str
|
|
196
|
+
"""
|
|
197
|
+
self.__logger_format = value
|
|
198
|
+
self.logger_formatter = logging.Formatter(self.__logger_format)
|
|
199
|
+
|
|
200
|
+
def get_api_key_with_prefix(self, identifier):
|
|
201
|
+
"""Gets API key (with prefix if set).
|
|
202
|
+
|
|
203
|
+
:param identifier: The identifier of apiKey.
|
|
204
|
+
:return: The token for api key authentication.
|
|
205
|
+
"""
|
|
206
|
+
if self.refresh_api_key_hook:
|
|
207
|
+
self.refresh_api_key_hook(self)
|
|
208
|
+
|
|
209
|
+
key = self.api_key.get(identifier)
|
|
210
|
+
if key:
|
|
211
|
+
prefix = self.api_key_prefix.get(identifier)
|
|
212
|
+
if prefix:
|
|
213
|
+
return "%s %s" % (prefix, key)
|
|
214
|
+
else:
|
|
215
|
+
return key
|
|
216
|
+
|
|
217
|
+
def get_basic_auth_token(self):
|
|
218
|
+
"""Gets HTTP basic authentication header (string).
|
|
219
|
+
|
|
220
|
+
:return: The token for basic HTTP authentication.
|
|
221
|
+
"""
|
|
222
|
+
token = ""
|
|
223
|
+
if self.username or self.password:
|
|
224
|
+
token = urllib3.util.make_headers(
|
|
225
|
+
basic_auth=self.username + ':' + self.password
|
|
226
|
+
).get('authorization')
|
|
227
|
+
return token
|
|
228
|
+
|
|
229
|
+
def auth_settings(self):
|
|
230
|
+
"""Gets Auth Settings dict for api client.
|
|
231
|
+
|
|
232
|
+
:return: The Auth Settings information dict.
|
|
233
|
+
"""
|
|
234
|
+
return {
|
|
235
|
+
'basicAuth':
|
|
236
|
+
{
|
|
237
|
+
'type': 'basic',
|
|
238
|
+
'in': 'header',
|
|
239
|
+
'key': 'Authorization',
|
|
240
|
+
'value': self.get_basic_auth_token()
|
|
241
|
+
},
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
def to_debug_report(self):
|
|
245
|
+
"""Gets the essential information for debugging.
|
|
246
|
+
|
|
247
|
+
:return: The report for debugging.
|
|
248
|
+
"""
|
|
249
|
+
return "Python SDK Debug Report:\n"\
|
|
250
|
+
"OS: {env}\n"\
|
|
251
|
+
"Python Version: {pyversion}\n"\
|
|
252
|
+
"Version of the API: 2.0.0\n"\
|
|
253
|
+
"SDK Package Version: 1.0.0".\
|
|
254
|
+
format(env=sys.platform, pyversion=sys.version)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
LOCKSS Crawler Service REST API
|
|
6
|
+
|
|
7
|
+
REST API of the LOCKSS Crawler Service # noqa: E501
|
|
8
|
+
|
|
9
|
+
OpenAPI spec version: 2.0.0
|
|
10
|
+
Contact: lockss-support@lockss.org
|
|
11
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import absolute_import
|
|
15
|
+
|
|
16
|
+
# import models into model package
|
|
17
|
+
from lockss.pyclient.crawler.models.api_status import ApiStatus
|
|
18
|
+
from lockss.pyclient.crawler.models.counter import Counter
|
|
19
|
+
from lockss.pyclient.crawler.models.crawl_desc import CrawlDesc
|
|
20
|
+
from lockss.pyclient.crawler.models.crawl_job import CrawlJob
|
|
21
|
+
from lockss.pyclient.crawler.models.crawl_pager import CrawlPager
|
|
22
|
+
from lockss.pyclient.crawler.models.crawl_status import CrawlStatus
|
|
23
|
+
from lockss.pyclient.crawler.models.crawl_ws_result import CrawlWsResult
|
|
24
|
+
from lockss.pyclient.crawler.models.crawl_ws_result_pages_with_errors import CrawlWsResultPagesWithErrors
|
|
25
|
+
from lockss.pyclient.crawler.models.crawler_config import CrawlerConfig
|
|
26
|
+
from lockss.pyclient.crawler.models.crawler_status import CrawlerStatus
|
|
27
|
+
from lockss.pyclient.crawler.models.crawler_statuses import CrawlerStatuses
|
|
28
|
+
from lockss.pyclient.crawler.models.error_result import ErrorResult
|
|
29
|
+
from lockss.pyclient.crawler.models.job_pager import JobPager
|
|
30
|
+
from lockss.pyclient.crawler.models.job_status import JobStatus
|
|
31
|
+
from lockss.pyclient.crawler.models.mime_counter import MimeCounter
|
|
32
|
+
from lockss.pyclient.crawler.models.page_info import PageInfo
|
|
33
|
+
from lockss.pyclient.crawler.models.url_error import UrlError
|
|
34
|
+
from lockss.pyclient.crawler.models.url_info import UrlInfo
|
|
35
|
+
from lockss.pyclient.crawler.models.url_pager import UrlPager
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
LOCKSS Crawler Service REST API
|
|
5
|
+
|
|
6
|
+
REST API of the LOCKSS Crawler 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
|
+
import pprint
|
|
14
|
+
import re # noqa: F401
|
|
15
|
+
|
|
16
|
+
import six
|
|
17
|
+
|
|
18
|
+
class ApiStatus(object):
|
|
19
|
+
"""NOTE: This class is auto generated by the swagger code generator program.
|
|
20
|
+
|
|
21
|
+
Do not edit the class manually.
|
|
22
|
+
"""
|
|
23
|
+
"""
|
|
24
|
+
Attributes:
|
|
25
|
+
swagger_types (dict): The key is attribute name
|
|
26
|
+
and the value is attribute type.
|
|
27
|
+
attribute_map (dict): The key is attribute name
|
|
28
|
+
and the value is json key in definition.
|
|
29
|
+
"""
|
|
30
|
+
swagger_types = {
|
|
31
|
+
'api_version': 'str',
|
|
32
|
+
'component_name': 'str',
|
|
33
|
+
'component_version': 'str',
|
|
34
|
+
'lockss_version': 'str',
|
|
35
|
+
'ready': 'bool',
|
|
36
|
+
'service_name': 'str',
|
|
37
|
+
'ready_time': 'int',
|
|
38
|
+
'reason': 'str',
|
|
39
|
+
'startup_status': 'str'
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
attribute_map = {
|
|
43
|
+
'api_version': 'apiVersion',
|
|
44
|
+
'component_name': 'componentName',
|
|
45
|
+
'component_version': 'componentVersion',
|
|
46
|
+
'lockss_version': 'lockssVersion',
|
|
47
|
+
'ready': 'ready',
|
|
48
|
+
'service_name': 'serviceName',
|
|
49
|
+
'ready_time': 'readyTime',
|
|
50
|
+
'reason': 'reason',
|
|
51
|
+
'startup_status': 'startupStatus'
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
def __init__(self, api_version=None, component_name=None, component_version=None, lockss_version=None, ready=None, service_name=None, ready_time=None, reason=None, startup_status=None): # noqa: E501
|
|
55
|
+
"""ApiStatus - a model defined in Swagger""" # noqa: E501
|
|
56
|
+
self._api_version = None
|
|
57
|
+
self._component_name = None
|
|
58
|
+
self._component_version = None
|
|
59
|
+
self._lockss_version = None
|
|
60
|
+
self._ready = None
|
|
61
|
+
self._service_name = None
|
|
62
|
+
self._ready_time = None
|
|
63
|
+
self._reason = None
|
|
64
|
+
self._startup_status = None
|
|
65
|
+
self.discriminator = None
|
|
66
|
+
self.api_version = api_version
|
|
67
|
+
if component_name is not None:
|
|
68
|
+
self.component_name = component_name
|
|
69
|
+
if component_version is not None:
|
|
70
|
+
self.component_version = component_version
|
|
71
|
+
if lockss_version is not None:
|
|
72
|
+
self.lockss_version = lockss_version
|
|
73
|
+
self.ready = ready
|
|
74
|
+
if service_name is not None:
|
|
75
|
+
self.service_name = service_name
|
|
76
|
+
if ready_time is not None:
|
|
77
|
+
self.ready_time = ready_time
|
|
78
|
+
if reason is not None:
|
|
79
|
+
self.reason = reason
|
|
80
|
+
if startup_status is not None:
|
|
81
|
+
self.startup_status = startup_status
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def api_version(self):
|
|
85
|
+
"""Gets the api_version of this ApiStatus. # noqa: E501
|
|
86
|
+
|
|
87
|
+
The version of the API # noqa: E501
|
|
88
|
+
|
|
89
|
+
:return: The api_version of this ApiStatus. # noqa: E501
|
|
90
|
+
:rtype: str
|
|
91
|
+
"""
|
|
92
|
+
return self._api_version
|
|
93
|
+
|
|
94
|
+
@api_version.setter
|
|
95
|
+
def api_version(self, api_version):
|
|
96
|
+
"""Sets the api_version of this ApiStatus.
|
|
97
|
+
|
|
98
|
+
The version of the API # noqa: E501
|
|
99
|
+
|
|
100
|
+
:param api_version: The api_version of this ApiStatus. # noqa: E501
|
|
101
|
+
:type: str
|
|
102
|
+
"""
|
|
103
|
+
if api_version is None:
|
|
104
|
+
raise ValueError("Invalid value for `api_version`, must not be `None`") # noqa: E501
|
|
105
|
+
|
|
106
|
+
self._api_version = api_version
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def component_name(self):
|
|
110
|
+
"""Gets the component_name of this ApiStatus. # noqa: E501
|
|
111
|
+
|
|
112
|
+
The name of the component # noqa: E501
|
|
113
|
+
|
|
114
|
+
:return: The component_name of this ApiStatus. # noqa: E501
|
|
115
|
+
:rtype: str
|
|
116
|
+
"""
|
|
117
|
+
return self._component_name
|
|
118
|
+
|
|
119
|
+
@component_name.setter
|
|
120
|
+
def component_name(self, component_name):
|
|
121
|
+
"""Sets the component_name of this ApiStatus.
|
|
122
|
+
|
|
123
|
+
The name of the component # noqa: E501
|
|
124
|
+
|
|
125
|
+
:param component_name: The component_name of this ApiStatus. # noqa: E501
|
|
126
|
+
:type: str
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
self._component_name = component_name
|
|
130
|
+
|
|
131
|
+
@property
|
|
132
|
+
def component_version(self):
|
|
133
|
+
"""Gets the component_version of this ApiStatus. # noqa: E501
|
|
134
|
+
|
|
135
|
+
The version of the component software # noqa: E501
|
|
136
|
+
|
|
137
|
+
:return: The component_version of this ApiStatus. # noqa: E501
|
|
138
|
+
:rtype: str
|
|
139
|
+
"""
|
|
140
|
+
return self._component_version
|
|
141
|
+
|
|
142
|
+
@component_version.setter
|
|
143
|
+
def component_version(self, component_version):
|
|
144
|
+
"""Sets the component_version of this ApiStatus.
|
|
145
|
+
|
|
146
|
+
The version of the component software # noqa: E501
|
|
147
|
+
|
|
148
|
+
:param component_version: The component_version of this ApiStatus. # noqa: E501
|
|
149
|
+
:type: str
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
self._component_version = component_version
|
|
153
|
+
|
|
154
|
+
@property
|
|
155
|
+
def lockss_version(self):
|
|
156
|
+
"""Gets the lockss_version of this ApiStatus. # noqa: E501
|
|
157
|
+
|
|
158
|
+
The version of the LOCKSS system # noqa: E501
|
|
159
|
+
|
|
160
|
+
:return: The lockss_version of this ApiStatus. # noqa: E501
|
|
161
|
+
:rtype: str
|
|
162
|
+
"""
|
|
163
|
+
return self._lockss_version
|
|
164
|
+
|
|
165
|
+
@lockss_version.setter
|
|
166
|
+
def lockss_version(self, lockss_version):
|
|
167
|
+
"""Sets the lockss_version of this ApiStatus.
|
|
168
|
+
|
|
169
|
+
The version of the LOCKSS system # noqa: E501
|
|
170
|
+
|
|
171
|
+
:param lockss_version: The lockss_version of this ApiStatus. # noqa: E501
|
|
172
|
+
:type: str
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
self._lockss_version = lockss_version
|
|
176
|
+
|
|
177
|
+
@property
|
|
178
|
+
def ready(self):
|
|
179
|
+
"""Gets the ready of this ApiStatus. # noqa: E501
|
|
180
|
+
|
|
181
|
+
The indication of whether the service is available # noqa: E501
|
|
182
|
+
|
|
183
|
+
:return: The ready of this ApiStatus. # noqa: E501
|
|
184
|
+
:rtype: bool
|
|
185
|
+
"""
|
|
186
|
+
return self._ready
|
|
187
|
+
|
|
188
|
+
@ready.setter
|
|
189
|
+
def ready(self, ready):
|
|
190
|
+
"""Sets the ready of this ApiStatus.
|
|
191
|
+
|
|
192
|
+
The indication of whether the service is available # noqa: E501
|
|
193
|
+
|
|
194
|
+
:param ready: The ready of this ApiStatus. # noqa: E501
|
|
195
|
+
:type: bool
|
|
196
|
+
"""
|
|
197
|
+
if ready is None:
|
|
198
|
+
raise ValueError("Invalid value for `ready`, must not be `None`") # noqa: E501
|
|
199
|
+
|
|
200
|
+
self._ready = ready
|
|
201
|
+
|
|
202
|
+
@property
|
|
203
|
+
def service_name(self):
|
|
204
|
+
"""Gets the service_name of this ApiStatus. # noqa: E501
|
|
205
|
+
|
|
206
|
+
The name of the service # noqa: E501
|
|
207
|
+
|
|
208
|
+
:return: The service_name of this ApiStatus. # noqa: E501
|
|
209
|
+
:rtype: str
|
|
210
|
+
"""
|
|
211
|
+
return self._service_name
|
|
212
|
+
|
|
213
|
+
@service_name.setter
|
|
214
|
+
def service_name(self, service_name):
|
|
215
|
+
"""Sets the service_name of this ApiStatus.
|
|
216
|
+
|
|
217
|
+
The name of the service # noqa: E501
|
|
218
|
+
|
|
219
|
+
:param service_name: The service_name of this ApiStatus. # noqa: E501
|
|
220
|
+
:type: str
|
|
221
|
+
"""
|
|
222
|
+
|
|
223
|
+
self._service_name = service_name
|
|
224
|
+
|
|
225
|
+
@property
|
|
226
|
+
def ready_time(self):
|
|
227
|
+
"""Gets the ready_time of this ApiStatus. # noqa: E501
|
|
228
|
+
|
|
229
|
+
The time the service last became ready. # noqa: E501
|
|
230
|
+
|
|
231
|
+
:return: The ready_time of this ApiStatus. # noqa: E501
|
|
232
|
+
:rtype: int
|
|
233
|
+
"""
|
|
234
|
+
return self._ready_time
|
|
235
|
+
|
|
236
|
+
@ready_time.setter
|
|
237
|
+
def ready_time(self, ready_time):
|
|
238
|
+
"""Sets the ready_time of this ApiStatus.
|
|
239
|
+
|
|
240
|
+
The time the service last became ready. # noqa: E501
|
|
241
|
+
|
|
242
|
+
:param ready_time: The ready_time of this ApiStatus. # noqa: E501
|
|
243
|
+
:type: int
|
|
244
|
+
"""
|
|
245
|
+
|
|
246
|
+
self._ready_time = ready_time
|
|
247
|
+
|
|
248
|
+
@property
|
|
249
|
+
def reason(self):
|
|
250
|
+
"""Gets the reason of this ApiStatus. # noqa: E501
|
|
251
|
+
|
|
252
|
+
The reason the service isn't ready. # noqa: E501
|
|
253
|
+
|
|
254
|
+
:return: The reason of this ApiStatus. # noqa: E501
|
|
255
|
+
:rtype: str
|
|
256
|
+
"""
|
|
257
|
+
return self._reason
|
|
258
|
+
|
|
259
|
+
@reason.setter
|
|
260
|
+
def reason(self, reason):
|
|
261
|
+
"""Sets the reason of this ApiStatus.
|
|
262
|
+
|
|
263
|
+
The reason the service isn't ready. # noqa: E501
|
|
264
|
+
|
|
265
|
+
:param reason: The reason of this ApiStatus. # noqa: E501
|
|
266
|
+
:type: str
|
|
267
|
+
"""
|
|
268
|
+
|
|
269
|
+
self._reason = reason
|
|
270
|
+
|
|
271
|
+
@property
|
|
272
|
+
def startup_status(self):
|
|
273
|
+
"""Gets the startup_status of this ApiStatus. # noqa: E501
|
|
274
|
+
|
|
275
|
+
Enum indicating progress of plugin/AU processing at startup. # noqa: E501
|
|
276
|
+
|
|
277
|
+
:return: The startup_status of this ApiStatus. # noqa: E501
|
|
278
|
+
:rtype: str
|
|
279
|
+
"""
|
|
280
|
+
return self._startup_status
|
|
281
|
+
|
|
282
|
+
@startup_status.setter
|
|
283
|
+
def startup_status(self, startup_status):
|
|
284
|
+
"""Sets the startup_status of this ApiStatus.
|
|
285
|
+
|
|
286
|
+
Enum indicating progress of plugin/AU processing at startup. # noqa: E501
|
|
287
|
+
|
|
288
|
+
:param startup_status: The startup_status of this ApiStatus. # noqa: E501
|
|
289
|
+
:type: str
|
|
290
|
+
"""
|
|
291
|
+
allowed_values = ["NONE", "PLUGINS_CRAWLING", "PLUGINS_COLLECTED", "PLUGINS_LOADING", "PLUGINS_LOADED", "AUS_STARTING", "AUS_STARTED"] # noqa: E501
|
|
292
|
+
if startup_status not in allowed_values:
|
|
293
|
+
raise ValueError(
|
|
294
|
+
"Invalid value for `startup_status` ({0}), must be one of {1}" # noqa: E501
|
|
295
|
+
.format(startup_status, allowed_values)
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
self._startup_status = startup_status
|
|
299
|
+
|
|
300
|
+
def to_dict(self):
|
|
301
|
+
"""Returns the model properties as a dict"""
|
|
302
|
+
result = {}
|
|
303
|
+
|
|
304
|
+
for attr, _ in six.iteritems(self.swagger_types):
|
|
305
|
+
value = getattr(self, attr)
|
|
306
|
+
if isinstance(value, list):
|
|
307
|
+
result[attr] = list(map(
|
|
308
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
309
|
+
value
|
|
310
|
+
))
|
|
311
|
+
elif hasattr(value, "to_dict"):
|
|
312
|
+
result[attr] = value.to_dict()
|
|
313
|
+
elif isinstance(value, dict):
|
|
314
|
+
result[attr] = dict(map(
|
|
315
|
+
lambda item: (item[0], item[1].to_dict())
|
|
316
|
+
if hasattr(item[1], "to_dict") else item,
|
|
317
|
+
value.items()
|
|
318
|
+
))
|
|
319
|
+
else:
|
|
320
|
+
result[attr] = value
|
|
321
|
+
if issubclass(ApiStatus, dict):
|
|
322
|
+
for key, value in self.items():
|
|
323
|
+
result[key] = value
|
|
324
|
+
|
|
325
|
+
return result
|
|
326
|
+
|
|
327
|
+
def to_str(self):
|
|
328
|
+
"""Returns the string representation of the model"""
|
|
329
|
+
return pprint.pformat(self.to_dict())
|
|
330
|
+
|
|
331
|
+
def __repr__(self):
|
|
332
|
+
"""For `print` and `pprint`"""
|
|
333
|
+
return self.to_str()
|
|
334
|
+
|
|
335
|
+
def __eq__(self, other):
|
|
336
|
+
"""Returns true if both objects are equal"""
|
|
337
|
+
if not isinstance(other, ApiStatus):
|
|
338
|
+
return False
|
|
339
|
+
|
|
340
|
+
return self.__dict__ == other.__dict__
|
|
341
|
+
|
|
342
|
+
def __ne__(self, other):
|
|
343
|
+
"""Returns true if both objects are not equal"""
|
|
344
|
+
return not self == other
|