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.
Files changed (148) hide show
  1. lockss/pyclient/__init__.py +67 -0
  2. lockss/pyclient/config/__init__.py +42 -0
  3. lockss/pyclient/config/api/__init__.py +12 -0
  4. lockss/pyclient/config/api/aus_api.py +2195 -0
  5. lockss/pyclient/config/api/config_api.py +718 -0
  6. lockss/pyclient/config/api/plugins_api.py +128 -0
  7. lockss/pyclient/config/api/status_api.py +120 -0
  8. lockss/pyclient/config/api/tdb_api.py +318 -0
  9. lockss/pyclient/config/api/users_api.py +516 -0
  10. lockss/pyclient/config/api/utils_api.py +128 -0
  11. lockss/pyclient/config/api_client.py +632 -0
  12. lockss/pyclient/config/configuration.py +254 -0
  13. lockss/pyclient/config/models/__init__.py +30 -0
  14. lockss/pyclient/config/models/api_status.py +344 -0
  15. lockss/pyclient/config/models/au_configuration.py +142 -0
  16. lockss/pyclient/config/models/au_status.py +113 -0
  17. lockss/pyclient/config/models/au_ws_result.py +113 -0
  18. lockss/pyclient/config/models/auids_body.py +168 -0
  19. lockss/pyclient/config/models/check_substance_result.py +212 -0
  20. lockss/pyclient/config/models/content_configuration_result.py +200 -0
  21. lockss/pyclient/config/models/file_section_name_body.py +113 -0
  22. lockss/pyclient/config/models/platform_configuration_ws_result.py +113 -0
  23. lockss/pyclient/config/models/plugin_ws_result.py +345 -0
  24. lockss/pyclient/config/models/request_au_control_result.py +171 -0
  25. lockss/pyclient/config/models/tdb_au_ws_result.py +360 -0
  26. lockss/pyclient/config/models/tdb_publisher_ws_result.py +113 -0
  27. lockss/pyclient/config/models/tdb_title_ws_result.py +390 -0
  28. lockss/pyclient/config/rest.py +317 -0
  29. lockss/pyclient/crawler/__init__.py +45 -0
  30. lockss/pyclient/crawler/api/__init__.py +10 -0
  31. lockss/pyclient/crawler/api/crawlers_api.py +215 -0
  32. lockss/pyclient/crawler/api/crawls_api.py +952 -0
  33. lockss/pyclient/crawler/api/jobs_api.py +504 -0
  34. lockss/pyclient/crawler/api/status_api.py +120 -0
  35. lockss/pyclient/crawler/api/ws_api.py +128 -0
  36. lockss/pyclient/crawler/api_client.py +632 -0
  37. lockss/pyclient/crawler/configuration.py +254 -0
  38. lockss/pyclient/crawler/models/__init__.py +35 -0
  39. lockss/pyclient/crawler/models/api_status.py +344 -0
  40. lockss/pyclient/crawler/models/counter.py +142 -0
  41. lockss/pyclient/crawler/models/crawl_desc.py +344 -0
  42. lockss/pyclient/crawler/models/crawl_job.py +280 -0
  43. lockss/pyclient/crawler/models/crawl_pager.py +140 -0
  44. lockss/pyclient/crawler/models/crawl_status.py +780 -0
  45. lockss/pyclient/crawler/models/crawl_ws_result.py +814 -0
  46. lockss/pyclient/crawler/models/crawl_ws_result_pages_with_errors.py +162 -0
  47. lockss/pyclient/crawler/models/crawler_config.py +142 -0
  48. lockss/pyclient/crawler/models/crawler_status.py +279 -0
  49. lockss/pyclient/crawler/models/crawler_statuses.py +112 -0
  50. lockss/pyclient/crawler/models/error_result.py +164 -0
  51. lockss/pyclient/crawler/models/job_pager.py +140 -0
  52. lockss/pyclient/crawler/models/job_status.py +147 -0
  53. lockss/pyclient/crawler/models/mime_counter.py +169 -0
  54. lockss/pyclient/crawler/models/page_info.py +228 -0
  55. lockss/pyclient/crawler/models/url_error.py +148 -0
  56. lockss/pyclient/crawler/models/url_info.py +167 -0
  57. lockss/pyclient/crawler/models/url_pager.py +140 -0
  58. lockss/pyclient/crawler/rest.py +317 -0
  59. lockss/pyclient/md/__init__.py +36 -0
  60. lockss/pyclient/md/api/__init__.py +9 -0
  61. lockss/pyclient/md/api/mdupdates_api.py +508 -0
  62. lockss/pyclient/md/api/metadata_api.py +136 -0
  63. lockss/pyclient/md/api/status_api.py +120 -0
  64. lockss/pyclient/md/api/urls_api.py +224 -0
  65. lockss/pyclient/md/api_client.py +632 -0
  66. lockss/pyclient/md/configuration.py +254 -0
  67. lockss/pyclient/md/models/__init__.py +27 -0
  68. lockss/pyclient/md/models/api_status.py +344 -0
  69. lockss/pyclient/md/models/au.py +169 -0
  70. lockss/pyclient/md/models/au_metadata_page_info.py +140 -0
  71. lockss/pyclient/md/models/error_result.py +164 -0
  72. lockss/pyclient/md/models/item_metadata.py +196 -0
  73. lockss/pyclient/md/models/job.py +280 -0
  74. lockss/pyclient/md/models/job_page_info.py +140 -0
  75. lockss/pyclient/md/models/metadata_update_spec.py +142 -0
  76. lockss/pyclient/md/models/page_info.py +228 -0
  77. lockss/pyclient/md/models/status.py +142 -0
  78. lockss/pyclient/md/models/url_info.py +142 -0
  79. lockss/pyclient/md/rest.py +317 -0
  80. lockss/pyclient/poller/__init__.py +54 -0
  81. lockss/pyclient/poller/api/__init__.py +13 -0
  82. lockss/pyclient/poller/api/export_api.py +156 -0
  83. lockss/pyclient/poller/api/hash_api.py +413 -0
  84. lockss/pyclient/poller/api/import_api.py +157 -0
  85. lockss/pyclient/poller/api/poll_detail_api.py +374 -0
  86. lockss/pyclient/poller/api/poller_polls_api.py +223 -0
  87. lockss/pyclient/poller/api/repo_api.py +223 -0
  88. lockss/pyclient/poller/api/service_api.py +694 -0
  89. lockss/pyclient/poller/api/voter_polls_api.py +223 -0
  90. lockss/pyclient/poller/api_client.py +632 -0
  91. lockss/pyclient/poller/configuration.py +254 -0
  92. lockss/pyclient/poller/models/__init__.py +41 -0
  93. lockss/pyclient/poller/models/api_status.py +344 -0
  94. lockss/pyclient/poller/models/aus_import_body.py +199 -0
  95. lockss/pyclient/poller/models/cached_uri_set_spec.py +169 -0
  96. lockss/pyclient/poller/models/error_result.py +164 -0
  97. lockss/pyclient/poller/models/hasher_ws_params.py +432 -0
  98. lockss/pyclient/poller/models/link_desc.py +141 -0
  99. lockss/pyclient/poller/models/page_desc.py +227 -0
  100. lockss/pyclient/poller/models/peer_data.py +638 -0
  101. lockss/pyclient/poller/models/peer_ws_result.py +113 -0
  102. lockss/pyclient/poller/models/poll_desc.py +285 -0
  103. lockss/pyclient/poller/models/poll_ws_result.py +142 -0
  104. lockss/pyclient/poller/models/poller_detail.py +613 -0
  105. lockss/pyclient/poller/models/poller_pager.py +139 -0
  106. lockss/pyclient/poller/models/poller_summary.py +452 -0
  107. lockss/pyclient/poller/models/repair_data.py +176 -0
  108. lockss/pyclient/poller/models/repair_pager.py +139 -0
  109. lockss/pyclient/poller/models/repair_queue.py +249 -0
  110. lockss/pyclient/poller/models/repository_space_ws_result.py +113 -0
  111. lockss/pyclient/poller/models/repository_ws_result.py +113 -0
  112. lockss/pyclient/poller/models/tally_data.py +471 -0
  113. lockss/pyclient/poller/models/url_pager.py +139 -0
  114. lockss/pyclient/poller/models/vote_ws_result.py +142 -0
  115. lockss/pyclient/poller/models/voter_detail.py +701 -0
  116. lockss/pyclient/poller/models/voter_pager.py +139 -0
  117. lockss/pyclient/poller/models/voter_summary.py +284 -0
  118. lockss/pyclient/poller/rest.py +317 -0
  119. lockss/pyclient/rs/__init__.py +41 -0
  120. lockss/pyclient/rs/api/__init__.py +10 -0
  121. lockss/pyclient/rs/api/artifacts_api.py +988 -0
  122. lockss/pyclient/rs/api/aus_api.py +334 -0
  123. lockss/pyclient/rs/api/repo_api.py +379 -0
  124. lockss/pyclient/rs/api/status_api.py +120 -0
  125. lockss/pyclient/rs/api/wayback_api.py +386 -0
  126. lockss/pyclient/rs/api_client.py +632 -0
  127. lockss/pyclient/rs/configuration.py +247 -0
  128. lockss/pyclient/rs/models/__init__.py +31 -0
  129. lockss/pyclient/rs/models/api_status.py +344 -0
  130. lockss/pyclient/rs/models/archives_body.py +142 -0
  131. lockss/pyclient/rs/models/artifact.py +344 -0
  132. lockss/pyclient/rs/models/artifact_page_info.py +140 -0
  133. lockss/pyclient/rs/models/artifact_properties.py +344 -0
  134. lockss/pyclient/rs/models/artifacts_body.py +170 -0
  135. lockss/pyclient/rs/models/au_size.py +162 -0
  136. lockss/pyclient/rs/models/auid_page_info.py +140 -0
  137. lockss/pyclient/rs/models/error_result.py +164 -0
  138. lockss/pyclient/rs/models/import_status.py +298 -0
  139. lockss/pyclient/rs/models/page_info.py +229 -0
  140. lockss/pyclient/rs/models/repository_info.py +164 -0
  141. lockss/pyclient/rs/models/repository_statistics.py +112 -0
  142. lockss/pyclient/rs/models/storage_info.py +287 -0
  143. lockss/pyclient/rs/models/streaming_response_body.py +84 -0
  144. lockss/pyclient/rs/rest.py +317 -0
  145. lockss_pyclient-0.1.0.dev1.dist-info/LICENSE +27 -0
  146. lockss_pyclient-0.1.0.dev1.dist-info/METADATA +29 -0
  147. lockss_pyclient-0.1.0.dev1.dist-info/RECORD +148 -0
  148. lockss_pyclient-0.1.0.dev1.dist-info/WHEEL +4 -0
@@ -0,0 +1,508 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LOCKSS Metadata Service REST API
5
+
6
+ REST API of the LOCKSS Metadata 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.md.api_client import ApiClient
21
+
22
+
23
+ class MdupdatesApi(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_mdupdates(self, **kwargs): # noqa: E501
36
+ """Delete all of the currently queued and active jobs # noqa: E501
37
+
38
+ Delete all of the currently queued and active jobs # 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_mdupdates(async_req=True)
42
+ >>> result = thread.get()
43
+
44
+ :param async_req bool
45
+ :return: int
46
+ If the method is called asynchronously,
47
+ returns the request thread.
48
+ """
49
+ kwargs['_return_http_data_only'] = True
50
+ if kwargs.get('async_req'):
51
+ return self.delete_mdupdates_with_http_info(**kwargs) # noqa: E501
52
+ else:
53
+ (data) = self.delete_mdupdates_with_http_info(**kwargs) # noqa: E501
54
+ return data
55
+
56
+ def delete_mdupdates_with_http_info(self, **kwargs): # noqa: E501
57
+ """Delete all of the currently queued and active jobs # noqa: E501
58
+
59
+ Delete all of the currently queued and active jobs # noqa: E501
60
+ This method makes a synchronous HTTP request by default. To make an
61
+ asynchronous HTTP request, please pass async_req=True
62
+ >>> thread = api.delete_mdupdates_with_http_info(async_req=True)
63
+ >>> result = thread.get()
64
+
65
+ :param async_req bool
66
+ :return: int
67
+ If the method is called asynchronously,
68
+ returns the request thread.
69
+ """
70
+
71
+ all_params = [] # noqa: E501
72
+ all_params.append('async_req')
73
+ all_params.append('_return_http_data_only')
74
+ all_params.append('_preload_content')
75
+ all_params.append('_request_timeout')
76
+
77
+ params = locals()
78
+ for key, val in six.iteritems(params['kwargs']):
79
+ if key not in all_params:
80
+ raise TypeError(
81
+ "Got an unexpected keyword argument '%s'"
82
+ " to method delete_mdupdates" % key
83
+ )
84
+ params[key] = val
85
+ del params['kwargs']
86
+
87
+ collection_formats = {}
88
+
89
+ path_params = {}
90
+
91
+ query_params = []
92
+
93
+ header_params = {}
94
+
95
+ form_params = []
96
+ local_var_files = {}
97
+
98
+ body_params = None
99
+ # HTTP header `Accept`
100
+ header_params['Accept'] = self.api_client.select_header_accept(
101
+ ['application/json']) # noqa: E501
102
+
103
+ # Authentication setting
104
+ auth_settings = ['basicAuth'] # noqa: E501
105
+
106
+ return self.api_client.call_api(
107
+ '/mdupdates', 'DELETE',
108
+ path_params,
109
+ query_params,
110
+ header_params,
111
+ body=body_params,
112
+ post_params=form_params,
113
+ files=local_var_files,
114
+ response_type='int', # noqa: E501
115
+ auth_settings=auth_settings,
116
+ async_req=params.get('async_req'),
117
+ _return_http_data_only=params.get('_return_http_data_only'),
118
+ _preload_content=params.get('_preload_content', True),
119
+ _request_timeout=params.get('_request_timeout'),
120
+ collection_formats=collection_formats)
121
+
122
+ def delete_mdupdates_jobid(self, jobid, **kwargs): # noqa: E501
123
+ """Delete a job # noqa: E501
124
+
125
+ Delete a job given the job identifier, stopping any current processing, if necessary # noqa: E501
126
+ This method makes a synchronous HTTP request by default. To make an
127
+ asynchronous HTTP request, please pass async_req=True
128
+ >>> thread = api.delete_mdupdates_jobid(jobid, async_req=True)
129
+ >>> result = thread.get()
130
+
131
+ :param async_req bool
132
+ :param str jobid: The identifier of the job to be deleted (required)
133
+ :return: Job
134
+ If the method is called asynchronously,
135
+ returns the request thread.
136
+ """
137
+ kwargs['_return_http_data_only'] = True
138
+ if kwargs.get('async_req'):
139
+ return self.delete_mdupdates_jobid_with_http_info(jobid, **kwargs) # noqa: E501
140
+ else:
141
+ (data) = self.delete_mdupdates_jobid_with_http_info(jobid, **kwargs) # noqa: E501
142
+ return data
143
+
144
+ def delete_mdupdates_jobid_with_http_info(self, jobid, **kwargs): # noqa: E501
145
+ """Delete a job # noqa: E501
146
+
147
+ Delete a job given the job identifier, stopping any current processing, if necessary # noqa: E501
148
+ This method makes a synchronous HTTP request by default. To make an
149
+ asynchronous HTTP request, please pass async_req=True
150
+ >>> thread = api.delete_mdupdates_jobid_with_http_info(jobid, async_req=True)
151
+ >>> result = thread.get()
152
+
153
+ :param async_req bool
154
+ :param str jobid: The identifier of the job to be deleted (required)
155
+ :return: Job
156
+ If the method is called asynchronously,
157
+ returns the request thread.
158
+ """
159
+
160
+ all_params = ['jobid'] # noqa: E501
161
+ all_params.append('async_req')
162
+ all_params.append('_return_http_data_only')
163
+ all_params.append('_preload_content')
164
+ all_params.append('_request_timeout')
165
+
166
+ params = locals()
167
+ for key, val in six.iteritems(params['kwargs']):
168
+ if key not in all_params:
169
+ raise TypeError(
170
+ "Got an unexpected keyword argument '%s'"
171
+ " to method delete_mdupdates_jobid" % key
172
+ )
173
+ params[key] = val
174
+ del params['kwargs']
175
+ # verify the required parameter 'jobid' is set
176
+ if ('jobid' not in params or
177
+ params['jobid'] is None):
178
+ raise ValueError("Missing the required parameter `jobid` when calling `delete_mdupdates_jobid`") # noqa: E501
179
+
180
+ collection_formats = {}
181
+
182
+ path_params = {}
183
+ if 'jobid' in params:
184
+ path_params['jobid'] = params['jobid'] # noqa: E501
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
+ ['application/json']) # noqa: E501
197
+
198
+ # Authentication setting
199
+ auth_settings = ['basicAuth'] # noqa: E501
200
+
201
+ return self.api_client.call_api(
202
+ '/mdupdates/{jobid}', 'DELETE',
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='Job', # 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_mdupdates(self, **kwargs): # noqa: E501
218
+ """Get a list of currently active jobs # noqa: E501
219
+
220
+ Get a list of all currently active jobs or a pageful of the list defined by the continuation token and size # 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_mdupdates(async_req=True)
224
+ >>> result = thread.get()
225
+
226
+ :param async_req bool
227
+ :param int limit: The number of jobs per page
228
+ :param str continuation_token: The continuation token of the next page of jobs to be returned
229
+ :return: JobPageInfo
230
+ If the method is called asynchronously,
231
+ returns the request thread.
232
+ """
233
+ kwargs['_return_http_data_only'] = True
234
+ if kwargs.get('async_req'):
235
+ return self.get_mdupdates_with_http_info(**kwargs) # noqa: E501
236
+ else:
237
+ (data) = self.get_mdupdates_with_http_info(**kwargs) # noqa: E501
238
+ return data
239
+
240
+ def get_mdupdates_with_http_info(self, **kwargs): # noqa: E501
241
+ """Get a list of currently active jobs # noqa: E501
242
+
243
+ Get a list of all currently active jobs or a pageful of the list defined by the continuation token and size # noqa: E501
244
+ This method makes a synchronous HTTP request by default. To make an
245
+ asynchronous HTTP request, please pass async_req=True
246
+ >>> thread = api.get_mdupdates_with_http_info(async_req=True)
247
+ >>> result = thread.get()
248
+
249
+ :param async_req bool
250
+ :param int limit: The number of jobs per page
251
+ :param str continuation_token: The continuation token of the next page of jobs to be returned
252
+ :return: JobPageInfo
253
+ If the method is called asynchronously,
254
+ returns the request thread.
255
+ """
256
+
257
+ all_params = ['limit', 'continuation_token'] # noqa: E501
258
+ all_params.append('async_req')
259
+ all_params.append('_return_http_data_only')
260
+ all_params.append('_preload_content')
261
+ all_params.append('_request_timeout')
262
+
263
+ params = locals()
264
+ for key, val in six.iteritems(params['kwargs']):
265
+ if key not in all_params:
266
+ raise TypeError(
267
+ "Got an unexpected keyword argument '%s'"
268
+ " to method get_mdupdates" % key
269
+ )
270
+ params[key] = val
271
+ del params['kwargs']
272
+
273
+ collection_formats = {}
274
+
275
+ path_params = {}
276
+
277
+ query_params = []
278
+ if 'limit' in params:
279
+ query_params.append(('limit', params['limit'])) # noqa: E501
280
+ if 'continuation_token' in params:
281
+ query_params.append(('continuationToken', params['continuation_token'])) # noqa: E501
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
+ ['application/json']) # noqa: E501
292
+
293
+ # Authentication setting
294
+ auth_settings = ['basicAuth'] # noqa: E501
295
+
296
+ return self.api_client.call_api(
297
+ '/mdupdates', '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='JobPageInfo', # 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 get_mdupdates_jobid(self, jobid, **kwargs): # noqa: E501
313
+ """Get a job # noqa: E501
314
+
315
+ Get a job given the job identifier # 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.get_mdupdates_jobid(jobid, async_req=True)
319
+ >>> result = thread.get()
320
+
321
+ :param async_req bool
322
+ :param str jobid: The identifier of the requested job (required)
323
+ :return: Status
324
+ If the method is called asynchronously,
325
+ returns the request thread.
326
+ """
327
+ kwargs['_return_http_data_only'] = True
328
+ if kwargs.get('async_req'):
329
+ return self.get_mdupdates_jobid_with_http_info(jobid, **kwargs) # noqa: E501
330
+ else:
331
+ (data) = self.get_mdupdates_jobid_with_http_info(jobid, **kwargs) # noqa: E501
332
+ return data
333
+
334
+ def get_mdupdates_jobid_with_http_info(self, jobid, **kwargs): # noqa: E501
335
+ """Get a job # noqa: E501
336
+
337
+ Get a job given the job identifier # noqa: E501
338
+ This method makes a synchronous HTTP request by default. To make an
339
+ asynchronous HTTP request, please pass async_req=True
340
+ >>> thread = api.get_mdupdates_jobid_with_http_info(jobid, async_req=True)
341
+ >>> result = thread.get()
342
+
343
+ :param async_req bool
344
+ :param str jobid: The identifier of the requested job (required)
345
+ :return: Status
346
+ If the method is called asynchronously,
347
+ returns the request thread.
348
+ """
349
+
350
+ all_params = ['jobid'] # noqa: E501
351
+ all_params.append('async_req')
352
+ all_params.append('_return_http_data_only')
353
+ all_params.append('_preload_content')
354
+ all_params.append('_request_timeout')
355
+
356
+ params = locals()
357
+ for key, val in six.iteritems(params['kwargs']):
358
+ if key not in all_params:
359
+ raise TypeError(
360
+ "Got an unexpected keyword argument '%s'"
361
+ " to method get_mdupdates_jobid" % key
362
+ )
363
+ params[key] = val
364
+ del params['kwargs']
365
+ # verify the required parameter 'jobid' is set
366
+ if ('jobid' not in params or
367
+ params['jobid'] is None):
368
+ raise ValueError("Missing the required parameter `jobid` when calling `get_mdupdates_jobid`") # noqa: E501
369
+
370
+ collection_formats = {}
371
+
372
+ path_params = {}
373
+ if 'jobid' in params:
374
+ path_params['jobid'] = params['jobid'] # noqa: E501
375
+
376
+ query_params = []
377
+
378
+ header_params = {}
379
+
380
+ form_params = []
381
+ local_var_files = {}
382
+
383
+ body_params = None
384
+ # HTTP header `Accept`
385
+ header_params['Accept'] = self.api_client.select_header_accept(
386
+ ['application/json']) # noqa: E501
387
+
388
+ # Authentication setting
389
+ auth_settings = ['basicAuth'] # noqa: E501
390
+
391
+ return self.api_client.call_api(
392
+ '/mdupdates/{jobid}', 'GET',
393
+ path_params,
394
+ query_params,
395
+ header_params,
396
+ body=body_params,
397
+ post_params=form_params,
398
+ files=local_var_files,
399
+ response_type='Status', # noqa: E501
400
+ auth_settings=auth_settings,
401
+ async_req=params.get('async_req'),
402
+ _return_http_data_only=params.get('_return_http_data_only'),
403
+ _preload_content=params.get('_preload_content', True),
404
+ _request_timeout=params.get('_request_timeout'),
405
+ collection_formats=collection_formats)
406
+
407
+ def post_mdupdates(self, body, **kwargs): # noqa: E501
408
+ """Perform an AU metadata update operation # noqa: E501
409
+
410
+ Perform an AU metadata update operation given the update specification # noqa: E501
411
+ This method makes a synchronous HTTP request by default. To make an
412
+ asynchronous HTTP request, please pass async_req=True
413
+ >>> thread = api.post_mdupdates(body, async_req=True)
414
+ >>> result = thread.get()
415
+
416
+ :param async_req bool
417
+ :param MetadataUpdateSpec body: The information defining the AU metadata update operation (required)
418
+ :param bool force: An indication of whether to force the operation regardless of the current state of the AU
419
+ :return: Job
420
+ If the method is called asynchronously,
421
+ returns the request thread.
422
+ """
423
+ kwargs['_return_http_data_only'] = True
424
+ if kwargs.get('async_req'):
425
+ return self.post_mdupdates_with_http_info(body, **kwargs) # noqa: E501
426
+ else:
427
+ (data) = self.post_mdupdates_with_http_info(body, **kwargs) # noqa: E501
428
+ return data
429
+
430
+ def post_mdupdates_with_http_info(self, body, **kwargs): # noqa: E501
431
+ """Perform an AU metadata update operation # noqa: E501
432
+
433
+ Perform an AU metadata update operation given the update specification # noqa: E501
434
+ This method makes a synchronous HTTP request by default. To make an
435
+ asynchronous HTTP request, please pass async_req=True
436
+ >>> thread = api.post_mdupdates_with_http_info(body, async_req=True)
437
+ >>> result = thread.get()
438
+
439
+ :param async_req bool
440
+ :param MetadataUpdateSpec body: The information defining the AU metadata update operation (required)
441
+ :param bool force: An indication of whether to force the operation regardless of the current state of the AU
442
+ :return: Job
443
+ If the method is called asynchronously,
444
+ returns the request thread.
445
+ """
446
+
447
+ all_params = ['body', 'force'] # noqa: E501
448
+ all_params.append('async_req')
449
+ all_params.append('_return_http_data_only')
450
+ all_params.append('_preload_content')
451
+ all_params.append('_request_timeout')
452
+
453
+ params = locals()
454
+ for key, val in six.iteritems(params['kwargs']):
455
+ if key not in all_params:
456
+ raise TypeError(
457
+ "Got an unexpected keyword argument '%s'"
458
+ " to method post_mdupdates" % key
459
+ )
460
+ params[key] = val
461
+ del params['kwargs']
462
+ # verify the required parameter 'body' is set
463
+ if ('body' not in params or
464
+ params['body'] is None):
465
+ raise ValueError("Missing the required parameter `body` when calling `post_mdupdates`") # noqa: E501
466
+
467
+ collection_formats = {}
468
+
469
+ path_params = {}
470
+
471
+ query_params = []
472
+ if 'force' in params:
473
+ query_params.append(('force', params['force'])) # noqa: E501
474
+
475
+ header_params = {}
476
+
477
+ form_params = []
478
+ local_var_files = {}
479
+
480
+ body_params = None
481
+ if 'body' in params:
482
+ body_params = params['body']
483
+ # HTTP header `Accept`
484
+ header_params['Accept'] = self.api_client.select_header_accept(
485
+ ['application/json']) # noqa: E501
486
+
487
+ # HTTP header `Content-Type`
488
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
489
+ ['application/json']) # noqa: E501
490
+
491
+ # Authentication setting
492
+ auth_settings = ['basicAuth'] # noqa: E501
493
+
494
+ return self.api_client.call_api(
495
+ '/mdupdates', 'POST',
496
+ path_params,
497
+ query_params,
498
+ header_params,
499
+ body=body_params,
500
+ post_params=form_params,
501
+ files=local_var_files,
502
+ response_type='Job', # noqa: E501
503
+ auth_settings=auth_settings,
504
+ async_req=params.get('async_req'),
505
+ _return_http_data_only=params.get('_return_http_data_only'),
506
+ _preload_content=params.get('_preload_content', True),
507
+ _request_timeout=params.get('_request_timeout'),
508
+ collection_formats=collection_formats)
@@ -0,0 +1,136 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LOCKSS Metadata Service REST API
5
+
6
+ REST API of the LOCKSS Metadata 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.md.api_client import ApiClient
21
+
22
+
23
+ class MetadataApi(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_metadata_aus_auid(self, auid, **kwargs): # noqa: E501
36
+ """Get the metadata stored for an AU # noqa: E501
37
+
38
+ Get the full metadata stored for an AU given the AU identifier or a pageful of the metadata defined by the continuation token and size # 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_metadata_aus_auid(auid, async_req=True)
42
+ >>> result = thread.get()
43
+
44
+ :param async_req bool
45
+ :param str auid: The identifier of the AU for which the metadata is requested (required)
46
+ :param int limit: The number of items per page
47
+ :param str continuation_token: The continuation token of the next page of metadata to be returned
48
+ :return: AuMetadataPageInfo
49
+ If the method is called asynchronously,
50
+ returns the request thread.
51
+ """
52
+ kwargs['_return_http_data_only'] = True
53
+ if kwargs.get('async_req'):
54
+ return self.get_metadata_aus_auid_with_http_info(auid, **kwargs) # noqa: E501
55
+ else:
56
+ (data) = self.get_metadata_aus_auid_with_http_info(auid, **kwargs) # noqa: E501
57
+ return data
58
+
59
+ def get_metadata_aus_auid_with_http_info(self, auid, **kwargs): # noqa: E501
60
+ """Get the metadata stored for an AU # noqa: E501
61
+
62
+ Get the full metadata stored for an AU given the AU identifier or a pageful of the metadata defined by the continuation token and size # noqa: E501
63
+ This method makes a synchronous HTTP request by default. To make an
64
+ asynchronous HTTP request, please pass async_req=True
65
+ >>> thread = api.get_metadata_aus_auid_with_http_info(auid, async_req=True)
66
+ >>> result = thread.get()
67
+
68
+ :param async_req bool
69
+ :param str auid: The identifier of the AU for which the metadata is requested (required)
70
+ :param int limit: The number of items per page
71
+ :param str continuation_token: The continuation token of the next page of metadata to be returned
72
+ :return: AuMetadataPageInfo
73
+ If the method is called asynchronously,
74
+ returns the request thread.
75
+ """
76
+
77
+ all_params = ['auid', 'limit', 'continuation_token'] # noqa: E501
78
+ all_params.append('async_req')
79
+ all_params.append('_return_http_data_only')
80
+ all_params.append('_preload_content')
81
+ all_params.append('_request_timeout')
82
+
83
+ params = locals()
84
+ for key, val in six.iteritems(params['kwargs']):
85
+ if key not in all_params:
86
+ raise TypeError(
87
+ "Got an unexpected keyword argument '%s'"
88
+ " to method get_metadata_aus_auid" % key
89
+ )
90
+ params[key] = val
91
+ del params['kwargs']
92
+ # verify the required parameter 'auid' is set
93
+ if ('auid' not in params or
94
+ params['auid'] is None):
95
+ raise ValueError("Missing the required parameter `auid` when calling `get_metadata_aus_auid`") # noqa: E501
96
+
97
+ collection_formats = {}
98
+
99
+ path_params = {}
100
+ if 'auid' in params:
101
+ path_params['auid'] = params['auid'] # noqa: E501
102
+
103
+ query_params = []
104
+ if 'limit' in params:
105
+ query_params.append(('limit', params['limit'])) # noqa: E501
106
+ if 'continuation_token' in params:
107
+ query_params.append(('continuationToken', params['continuation_token'])) # noqa: E501
108
+
109
+ header_params = {}
110
+
111
+ form_params = []
112
+ local_var_files = {}
113
+
114
+ body_params = None
115
+ # HTTP header `Accept`
116
+ header_params['Accept'] = self.api_client.select_header_accept(
117
+ ['application/json']) # noqa: E501
118
+
119
+ # Authentication setting
120
+ auth_settings = ['basicAuth'] # noqa: E501
121
+
122
+ return self.api_client.call_api(
123
+ '/metadata/aus/{auid}', 'GET',
124
+ path_params,
125
+ query_params,
126
+ header_params,
127
+ body=body_params,
128
+ post_params=form_params,
129
+ files=local_var_files,
130
+ response_type='AuMetadataPageInfo', # noqa: E501
131
+ auth_settings=auth_settings,
132
+ async_req=params.get('async_req'),
133
+ _return_http_data_only=params.get('_return_http_data_only'),
134
+ _preload_content=params.get('_preload_content', True),
135
+ _request_timeout=params.get('_request_timeout'),
136
+ collection_formats=collection_formats)