pulpcore_client 3.0.0rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +79 -0
- data/README.md +151 -0
- data/Rakefile +10 -0
- data/docs/Artifact.md +37 -0
- data/docs/ArtifactsApi.md +253 -0
- data/docs/AsyncOperationResponse.md +17 -0
- data/docs/InlineResponse200.md +23 -0
- data/docs/InlineResponse2001.md +23 -0
- data/docs/InlineResponse2002.md +23 -0
- data/docs/InlineResponse2003.md +23 -0
- data/docs/InlineResponse2004.md +23 -0
- data/docs/InlineResponse2005.md +23 -0
- data/docs/OrphansApi.md +58 -0
- data/docs/ProgressReport.md +27 -0
- data/docs/RepositoriesApi.md +584 -0
- data/docs/Repository.md +27 -0
- data/docs/RepositoryVersion.md +25 -0
- data/docs/RepositoryVersionCreate.md +21 -0
- data/docs/StatusApi.md +57 -0
- data/docs/Task.md +41 -0
- data/docs/TasksApi.md +263 -0
- data/docs/Upload.md +25 -0
- data/docs/UploadsApi.md +395 -0
- data/docs/Worker.md +27 -0
- data/docs/WorkersApi.md +136 -0
- data/git_push.sh +55 -0
- data/lib/pulpcore_client/api/artifacts_api.rb +306 -0
- data/lib/pulpcore_client/api/orphans_api.rb +78 -0
- data/lib/pulpcore_client/api/repositories_api.rb +710 -0
- data/lib/pulpcore_client/api/status_api.rb +76 -0
- data/lib/pulpcore_client/api/tasks_api.rb +330 -0
- data/lib/pulpcore_client/api/uploads_api.rb +493 -0
- data/lib/pulpcore_client/api/workers_api.rb +172 -0
- data/lib/pulpcore_client/api_client.rb +387 -0
- data/lib/pulpcore_client/api_error.rb +57 -0
- data/lib/pulpcore_client/configuration.rb +251 -0
- data/lib/pulpcore_client/models/artifact.rb +296 -0
- data/lib/pulpcore_client/models/async_operation_response.rb +202 -0
- data/lib/pulpcore_client/models/inline_response200.rb +235 -0
- data/lib/pulpcore_client/models/inline_response2001.rb +235 -0
- data/lib/pulpcore_client/models/inline_response2002.rb +235 -0
- data/lib/pulpcore_client/models/inline_response2003.rb +235 -0
- data/lib/pulpcore_client/models/inline_response2004.rb +235 -0
- data/lib/pulpcore_client/models/inline_response2005.rb +235 -0
- data/lib/pulpcore_client/models/progress_report.rb +277 -0
- data/lib/pulpcore_client/models/repository.rb +268 -0
- data/lib/pulpcore_client/models/repository_version.rb +235 -0
- data/lib/pulpcore_client/models/repository_version_create.rb +231 -0
- data/lib/pulpcore_client/models/task.rb +360 -0
- data/lib/pulpcore_client/models/upload.rb +257 -0
- data/lib/pulpcore_client/models/worker.rb +261 -0
- data/lib/pulpcore_client/version.rb +15 -0
- data/lib/pulpcore_client.rb +61 -0
- data/pulpcore_client.gemspec +45 -0
- data/spec/api/artifacts_api_spec.rb +96 -0
- data/spec/api/orphans_api_spec.rb +46 -0
- data/spec/api/repositories_api_spec.rb +171 -0
- data/spec/api/status_api_spec.rb +46 -0
- data/spec/api/tasks_api_spec.rb +102 -0
- data/spec/api/uploads_api_spec.rb +123 -0
- data/spec/api/workers_api_spec.rb +68 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/artifact_spec.rb +101 -0
- data/spec/models/async_operation_response_spec.rb +41 -0
- data/spec/models/inline_response2001_spec.rb +59 -0
- data/spec/models/inline_response2002_spec.rb +59 -0
- data/spec/models/inline_response2003_spec.rb +59 -0
- data/spec/models/inline_response2004_spec.rb +59 -0
- data/spec/models/inline_response2005_spec.rb +59 -0
- data/spec/models/inline_response200_spec.rb +59 -0
- data/spec/models/progress_report_spec.rb +71 -0
- data/spec/models/repository_spec.rb +71 -0
- data/spec/models/repository_version_create_spec.rb +53 -0
- data/spec/models/repository_version_spec.rb +65 -0
- data/spec/models/task_spec.rb +113 -0
- data/spec/models/upload_spec.rb +65 -0
- data/spec/models/worker_spec.rb +71 -0
- data/spec/spec_helper.rb +111 -0
- metadata +329 -0
@@ -0,0 +1,493 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module PulpcoreClient
|
16
|
+
class UploadsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Start Upload
|
23
|
+
# Start a chunked upload by uploading the first chunk.
|
24
|
+
# @param file [File] A chunk of a file to upload.
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [Upload]
|
27
|
+
def uploads_create(file, opts = {})
|
28
|
+
data, _status_code, _headers = uploads_create_with_http_info(file, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Start Upload
|
33
|
+
# Start a chunked upload by uploading the first chunk.
|
34
|
+
# @param file [File] A chunk of a file to upload.
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(Upload, Integer, Hash)>] Upload data, response status code and response headers
|
37
|
+
def uploads_create_with_http_info(file, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: UploadsApi.uploads_create ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'file' is set
|
42
|
+
if @api_client.config.client_side_validation && file.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'file' when calling UploadsApi.uploads_create"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/pulp/api/v3/uploads/'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data', 'application/x-www-form-urlencoded'])
|
57
|
+
|
58
|
+
# form parameters
|
59
|
+
form_params = opts[:form_params] || {}
|
60
|
+
form_params['file'] = file
|
61
|
+
|
62
|
+
# http body (model)
|
63
|
+
post_body = opts[:body]
|
64
|
+
|
65
|
+
# return_type
|
66
|
+
return_type = opts[:return_type] || 'Upload'
|
67
|
+
|
68
|
+
# auth_names
|
69
|
+
auth_names = opts[:auth_names] || ['Basic']
|
70
|
+
|
71
|
+
new_options = opts.merge(
|
72
|
+
:header_params => header_params,
|
73
|
+
:query_params => query_params,
|
74
|
+
:form_params => form_params,
|
75
|
+
:body => post_body,
|
76
|
+
:auth_names => auth_names,
|
77
|
+
:return_type => return_type
|
78
|
+
)
|
79
|
+
|
80
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
81
|
+
if @api_client.config.debugging
|
82
|
+
@api_client.config.logger.debug "API called: UploadsApi#uploads_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
83
|
+
end
|
84
|
+
return data, status_code, headers
|
85
|
+
end
|
86
|
+
|
87
|
+
# Create an Upload
|
88
|
+
# Create an upload from a entire file as one chunk.
|
89
|
+
# @param file [File] The full file to upload.
|
90
|
+
# @param md5 [String] The expected MD5 checksum of the file.
|
91
|
+
# @param [Hash] opts the optional parameters
|
92
|
+
# @return [Upload]
|
93
|
+
def uploads_create_and_check(file, md5, opts = {})
|
94
|
+
data, _status_code, _headers = uploads_create_and_check_with_http_info(file, md5, opts)
|
95
|
+
data
|
96
|
+
end
|
97
|
+
|
98
|
+
# Create an Upload
|
99
|
+
# Create an upload from a entire file as one chunk.
|
100
|
+
# @param file [File] The full file to upload.
|
101
|
+
# @param md5 [String] The expected MD5 checksum of the file.
|
102
|
+
# @param [Hash] opts the optional parameters
|
103
|
+
# @return [Array<(Upload, Integer, Hash)>] Upload data, response status code and response headers
|
104
|
+
def uploads_create_and_check_with_http_info(file, md5, opts = {})
|
105
|
+
if @api_client.config.debugging
|
106
|
+
@api_client.config.logger.debug 'Calling API: UploadsApi.uploads_create_and_check ...'
|
107
|
+
end
|
108
|
+
# verify the required parameter 'file' is set
|
109
|
+
if @api_client.config.client_side_validation && file.nil?
|
110
|
+
fail ArgumentError, "Missing the required parameter 'file' when calling UploadsApi.uploads_create_and_check"
|
111
|
+
end
|
112
|
+
# verify the required parameter 'md5' is set
|
113
|
+
if @api_client.config.client_side_validation && md5.nil?
|
114
|
+
fail ArgumentError, "Missing the required parameter 'md5' when calling UploadsApi.uploads_create_and_check"
|
115
|
+
end
|
116
|
+
if @api_client.config.client_side_validation && md5.to_s.length < 1
|
117
|
+
fail ArgumentError, 'invalid value for "md5" when calling UploadsApi.uploads_create_and_check, the character length must be great than or equal to 1.'
|
118
|
+
end
|
119
|
+
|
120
|
+
# resource path
|
121
|
+
local_var_path = '/pulp/api/v3/uploads/'
|
122
|
+
|
123
|
+
# query parameters
|
124
|
+
query_params = opts[:query_params] || {}
|
125
|
+
|
126
|
+
# header parameters
|
127
|
+
header_params = opts[:header_params] || {}
|
128
|
+
# HTTP header 'Accept' (if needed)
|
129
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
130
|
+
# HTTP header 'Content-Type'
|
131
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data', 'application/x-www-form-urlencoded'])
|
132
|
+
|
133
|
+
# form parameters
|
134
|
+
form_params = opts[:form_params] || {}
|
135
|
+
form_params['file'] = file
|
136
|
+
form_params['md5'] = md5
|
137
|
+
|
138
|
+
# http body (model)
|
139
|
+
post_body = opts[:body]
|
140
|
+
|
141
|
+
# return_type
|
142
|
+
return_type = opts[:return_type] || 'Upload'
|
143
|
+
|
144
|
+
# auth_names
|
145
|
+
auth_names = opts[:auth_names] || ['Basic']
|
146
|
+
|
147
|
+
new_options = opts.merge(
|
148
|
+
:header_params => header_params,
|
149
|
+
:query_params => query_params,
|
150
|
+
:form_params => form_params,
|
151
|
+
:body => post_body,
|
152
|
+
:auth_names => auth_names,
|
153
|
+
:return_type => return_type
|
154
|
+
)
|
155
|
+
|
156
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
157
|
+
if @api_client.config.debugging
|
158
|
+
@api_client.config.logger.debug "API called: UploadsApi#uploads_create_and_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
159
|
+
end
|
160
|
+
return data, status_code, headers
|
161
|
+
end
|
162
|
+
|
163
|
+
# Delete an upload
|
164
|
+
# View for chunked uploads.
|
165
|
+
# @param upload_href [String] URI of Upload. e.g.: /pulp/api/v3/uploads/1/
|
166
|
+
# @param [Hash] opts the optional parameters
|
167
|
+
# @return [nil]
|
168
|
+
def uploads_delete(upload_href, opts = {})
|
169
|
+
uploads_delete_with_http_info(upload_href, opts)
|
170
|
+
nil
|
171
|
+
end
|
172
|
+
|
173
|
+
# Delete an upload
|
174
|
+
# View for chunked uploads.
|
175
|
+
# @param upload_href [String] URI of Upload. e.g.: /pulp/api/v3/uploads/1/
|
176
|
+
# @param [Hash] opts the optional parameters
|
177
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
178
|
+
def uploads_delete_with_http_info(upload_href, opts = {})
|
179
|
+
if @api_client.config.debugging
|
180
|
+
@api_client.config.logger.debug 'Calling API: UploadsApi.uploads_delete ...'
|
181
|
+
end
|
182
|
+
# verify the required parameter 'upload_href' is set
|
183
|
+
if @api_client.config.client_side_validation && upload_href.nil?
|
184
|
+
fail ArgumentError, "Missing the required parameter 'upload_href' when calling UploadsApi.uploads_delete"
|
185
|
+
end
|
186
|
+
# resource path
|
187
|
+
local_var_path = '{upload_href}'.sub('{' + 'upload_href' + '}', upload_href.to_s)
|
188
|
+
|
189
|
+
# query parameters
|
190
|
+
query_params = opts[:query_params] || {}
|
191
|
+
|
192
|
+
# header parameters
|
193
|
+
header_params = opts[:header_params] || {}
|
194
|
+
|
195
|
+
# form parameters
|
196
|
+
form_params = opts[:form_params] || {}
|
197
|
+
|
198
|
+
# http body (model)
|
199
|
+
post_body = opts[:body]
|
200
|
+
|
201
|
+
# return_type
|
202
|
+
return_type = opts[:return_type]
|
203
|
+
|
204
|
+
# auth_names
|
205
|
+
auth_names = opts[:auth_names] || ['Basic']
|
206
|
+
|
207
|
+
new_options = opts.merge(
|
208
|
+
:header_params => header_params,
|
209
|
+
:query_params => query_params,
|
210
|
+
:form_params => form_params,
|
211
|
+
:body => post_body,
|
212
|
+
:auth_names => auth_names,
|
213
|
+
:return_type => return_type
|
214
|
+
)
|
215
|
+
|
216
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
217
|
+
if @api_client.config.debugging
|
218
|
+
@api_client.config.logger.debug "API called: UploadsApi#uploads_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
219
|
+
end
|
220
|
+
return data, status_code, headers
|
221
|
+
end
|
222
|
+
|
223
|
+
# Finish an Upload
|
224
|
+
# Mark the Upload as \"complete\". The md5 checksum is used to validate the integrity of the upload.
|
225
|
+
# @param upload_href [String] URI of Upload. e.g.: /pulp/api/v3/uploads/1/
|
226
|
+
# @param md5 [String] The expected MD5 checksum of the file.
|
227
|
+
# @param [Hash] opts the optional parameters
|
228
|
+
# @return [Upload]
|
229
|
+
def uploads_finish(upload_href, md5, opts = {})
|
230
|
+
data, _status_code, _headers = uploads_finish_with_http_info(upload_href, md5, opts)
|
231
|
+
data
|
232
|
+
end
|
233
|
+
|
234
|
+
# Finish an Upload
|
235
|
+
# Mark the Upload as \"complete\". The md5 checksum is used to validate the integrity of the upload.
|
236
|
+
# @param upload_href [String] URI of Upload. e.g.: /pulp/api/v3/uploads/1/
|
237
|
+
# @param md5 [String] The expected MD5 checksum of the file.
|
238
|
+
# @param [Hash] opts the optional parameters
|
239
|
+
# @return [Array<(Upload, Integer, Hash)>] Upload data, response status code and response headers
|
240
|
+
def uploads_finish_with_http_info(upload_href, md5, opts = {})
|
241
|
+
if @api_client.config.debugging
|
242
|
+
@api_client.config.logger.debug 'Calling API: UploadsApi.uploads_finish ...'
|
243
|
+
end
|
244
|
+
# verify the required parameter 'upload_href' is set
|
245
|
+
if @api_client.config.client_side_validation && upload_href.nil?
|
246
|
+
fail ArgumentError, "Missing the required parameter 'upload_href' when calling UploadsApi.uploads_finish"
|
247
|
+
end
|
248
|
+
# verify the required parameter 'md5' is set
|
249
|
+
if @api_client.config.client_side_validation && md5.nil?
|
250
|
+
fail ArgumentError, "Missing the required parameter 'md5' when calling UploadsApi.uploads_finish"
|
251
|
+
end
|
252
|
+
if @api_client.config.client_side_validation && md5.to_s.length < 1
|
253
|
+
fail ArgumentError, 'invalid value for "md5" when calling UploadsApi.uploads_finish, the character length must be great than or equal to 1.'
|
254
|
+
end
|
255
|
+
|
256
|
+
# resource path
|
257
|
+
local_var_path = '{upload_href}'.sub('{' + 'upload_href' + '}', upload_href.to_s)
|
258
|
+
|
259
|
+
# query parameters
|
260
|
+
query_params = opts[:query_params] || {}
|
261
|
+
|
262
|
+
# header parameters
|
263
|
+
header_params = opts[:header_params] || {}
|
264
|
+
# HTTP header 'Accept' (if needed)
|
265
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
266
|
+
# HTTP header 'Content-Type'
|
267
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data', 'application/x-www-form-urlencoded'])
|
268
|
+
|
269
|
+
# form parameters
|
270
|
+
form_params = opts[:form_params] || {}
|
271
|
+
form_params['md5'] = md5
|
272
|
+
|
273
|
+
# http body (model)
|
274
|
+
post_body = opts[:body]
|
275
|
+
|
276
|
+
# return_type
|
277
|
+
return_type = opts[:return_type] || 'Upload'
|
278
|
+
|
279
|
+
# auth_names
|
280
|
+
auth_names = opts[:auth_names] || ['Basic']
|
281
|
+
|
282
|
+
new_options = opts.merge(
|
283
|
+
:header_params => header_params,
|
284
|
+
:query_params => query_params,
|
285
|
+
:form_params => form_params,
|
286
|
+
:body => post_body,
|
287
|
+
:auth_names => auth_names,
|
288
|
+
:return_type => return_type
|
289
|
+
)
|
290
|
+
|
291
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
292
|
+
if @api_client.config.debugging
|
293
|
+
@api_client.config.logger.debug "API called: UploadsApi#uploads_finish\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
294
|
+
end
|
295
|
+
return data, status_code, headers
|
296
|
+
end
|
297
|
+
|
298
|
+
# List uploads
|
299
|
+
# List all the uploads.
|
300
|
+
# @param [Hash] opts the optional parameters
|
301
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
302
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
303
|
+
# @return [InlineResponse2004]
|
304
|
+
def uploads_list(opts = {})
|
305
|
+
data, _status_code, _headers = uploads_list_with_http_info(opts)
|
306
|
+
data
|
307
|
+
end
|
308
|
+
|
309
|
+
# List uploads
|
310
|
+
# List all the uploads.
|
311
|
+
# @param [Hash] opts the optional parameters
|
312
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
313
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
314
|
+
# @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers
|
315
|
+
def uploads_list_with_http_info(opts = {})
|
316
|
+
if @api_client.config.debugging
|
317
|
+
@api_client.config.logger.debug 'Calling API: UploadsApi.uploads_list ...'
|
318
|
+
end
|
319
|
+
# resource path
|
320
|
+
local_var_path = '/pulp/api/v3/uploads/'
|
321
|
+
|
322
|
+
# query parameters
|
323
|
+
query_params = opts[:query_params] || {}
|
324
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
325
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
326
|
+
|
327
|
+
# header parameters
|
328
|
+
header_params = opts[:header_params] || {}
|
329
|
+
# HTTP header 'Accept' (if needed)
|
330
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
331
|
+
|
332
|
+
# form parameters
|
333
|
+
form_params = opts[:form_params] || {}
|
334
|
+
|
335
|
+
# http body (model)
|
336
|
+
post_body = opts[:body]
|
337
|
+
|
338
|
+
# return_type
|
339
|
+
return_type = opts[:return_type] || 'InlineResponse2004'
|
340
|
+
|
341
|
+
# auth_names
|
342
|
+
auth_names = opts[:auth_names] || ['Basic']
|
343
|
+
|
344
|
+
new_options = opts.merge(
|
345
|
+
:header_params => header_params,
|
346
|
+
:query_params => query_params,
|
347
|
+
:form_params => form_params,
|
348
|
+
:body => post_body,
|
349
|
+
:auth_names => auth_names,
|
350
|
+
:return_type => return_type
|
351
|
+
)
|
352
|
+
|
353
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
354
|
+
if @api_client.config.debugging
|
355
|
+
@api_client.config.logger.debug "API called: UploadsApi#uploads_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
356
|
+
end
|
357
|
+
return data, status_code, headers
|
358
|
+
end
|
359
|
+
|
360
|
+
# Inspect an upload
|
361
|
+
# View for chunked uploads.
|
362
|
+
# @param upload_href [String] URI of Upload. e.g.: /pulp/api/v3/uploads/1/
|
363
|
+
# @param [Hash] opts the optional parameters
|
364
|
+
# @return [Upload]
|
365
|
+
def uploads_read(upload_href, opts = {})
|
366
|
+
data, _status_code, _headers = uploads_read_with_http_info(upload_href, opts)
|
367
|
+
data
|
368
|
+
end
|
369
|
+
|
370
|
+
# Inspect an upload
|
371
|
+
# View for chunked uploads.
|
372
|
+
# @param upload_href [String] URI of Upload. e.g.: /pulp/api/v3/uploads/1/
|
373
|
+
# @param [Hash] opts the optional parameters
|
374
|
+
# @return [Array<(Upload, Integer, Hash)>] Upload data, response status code and response headers
|
375
|
+
def uploads_read_with_http_info(upload_href, opts = {})
|
376
|
+
if @api_client.config.debugging
|
377
|
+
@api_client.config.logger.debug 'Calling API: UploadsApi.uploads_read ...'
|
378
|
+
end
|
379
|
+
# verify the required parameter 'upload_href' is set
|
380
|
+
if @api_client.config.client_side_validation && upload_href.nil?
|
381
|
+
fail ArgumentError, "Missing the required parameter 'upload_href' when calling UploadsApi.uploads_read"
|
382
|
+
end
|
383
|
+
# resource path
|
384
|
+
local_var_path = '{upload_href}'.sub('{' + 'upload_href' + '}', upload_href.to_s)
|
385
|
+
|
386
|
+
# query parameters
|
387
|
+
query_params = opts[:query_params] || {}
|
388
|
+
|
389
|
+
# header parameters
|
390
|
+
header_params = opts[:header_params] || {}
|
391
|
+
# HTTP header 'Accept' (if needed)
|
392
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
393
|
+
|
394
|
+
# form parameters
|
395
|
+
form_params = opts[:form_params] || {}
|
396
|
+
|
397
|
+
# http body (model)
|
398
|
+
post_body = opts[:body]
|
399
|
+
|
400
|
+
# return_type
|
401
|
+
return_type = opts[:return_type] || 'Upload'
|
402
|
+
|
403
|
+
# auth_names
|
404
|
+
auth_names = opts[:auth_names] || ['Basic']
|
405
|
+
|
406
|
+
new_options = opts.merge(
|
407
|
+
:header_params => header_params,
|
408
|
+
:query_params => query_params,
|
409
|
+
:form_params => form_params,
|
410
|
+
:body => post_body,
|
411
|
+
:auth_names => auth_names,
|
412
|
+
:return_type => return_type
|
413
|
+
)
|
414
|
+
|
415
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
416
|
+
if @api_client.config.debugging
|
417
|
+
@api_client.config.logger.debug "API called: UploadsApi#uploads_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
418
|
+
end
|
419
|
+
return data, status_code, headers
|
420
|
+
end
|
421
|
+
|
422
|
+
# Continue an Upload
|
423
|
+
# Continue the upload by uploading the next file chunk.
|
424
|
+
# @param upload_href [String] URI of Upload. e.g.: /pulp/api/v3/uploads/1/
|
425
|
+
# @param file [File] A chunk of a file to upload.
|
426
|
+
# @param [Hash] opts the optional parameters
|
427
|
+
# @return [Upload]
|
428
|
+
def uploads_update(upload_href, file, opts = {})
|
429
|
+
data, _status_code, _headers = uploads_update_with_http_info(upload_href, file, opts)
|
430
|
+
data
|
431
|
+
end
|
432
|
+
|
433
|
+
# Continue an Upload
|
434
|
+
# Continue the upload by uploading the next file chunk.
|
435
|
+
# @param upload_href [String] URI of Upload. e.g.: /pulp/api/v3/uploads/1/
|
436
|
+
# @param file [File] A chunk of a file to upload.
|
437
|
+
# @param [Hash] opts the optional parameters
|
438
|
+
# @return [Array<(Upload, Integer, Hash)>] Upload data, response status code and response headers
|
439
|
+
def uploads_update_with_http_info(upload_href, file, opts = {})
|
440
|
+
if @api_client.config.debugging
|
441
|
+
@api_client.config.logger.debug 'Calling API: UploadsApi.uploads_update ...'
|
442
|
+
end
|
443
|
+
# verify the required parameter 'upload_href' is set
|
444
|
+
if @api_client.config.client_side_validation && upload_href.nil?
|
445
|
+
fail ArgumentError, "Missing the required parameter 'upload_href' when calling UploadsApi.uploads_update"
|
446
|
+
end
|
447
|
+
# verify the required parameter 'file' is set
|
448
|
+
if @api_client.config.client_side_validation && file.nil?
|
449
|
+
fail ArgumentError, "Missing the required parameter 'file' when calling UploadsApi.uploads_update"
|
450
|
+
end
|
451
|
+
# resource path
|
452
|
+
local_var_path = '{upload_href}'.sub('{' + 'upload_href' + '}', upload_href.to_s)
|
453
|
+
|
454
|
+
# query parameters
|
455
|
+
query_params = opts[:query_params] || {}
|
456
|
+
|
457
|
+
# header parameters
|
458
|
+
header_params = opts[:header_params] || {}
|
459
|
+
# HTTP header 'Accept' (if needed)
|
460
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
461
|
+
# HTTP header 'Content-Type'
|
462
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data', 'application/x-www-form-urlencoded'])
|
463
|
+
|
464
|
+
# form parameters
|
465
|
+
form_params = opts[:form_params] || {}
|
466
|
+
form_params['file'] = file
|
467
|
+
|
468
|
+
# http body (model)
|
469
|
+
post_body = opts[:body]
|
470
|
+
|
471
|
+
# return_type
|
472
|
+
return_type = opts[:return_type] || 'Upload'
|
473
|
+
|
474
|
+
# auth_names
|
475
|
+
auth_names = opts[:auth_names] || ['Basic']
|
476
|
+
|
477
|
+
new_options = opts.merge(
|
478
|
+
:header_params => header_params,
|
479
|
+
:query_params => query_params,
|
480
|
+
:form_params => form_params,
|
481
|
+
:body => post_body,
|
482
|
+
:auth_names => auth_names,
|
483
|
+
:return_type => return_type
|
484
|
+
)
|
485
|
+
|
486
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
487
|
+
if @api_client.config.debugging
|
488
|
+
@api_client.config.logger.debug "API called: UploadsApi#uploads_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
489
|
+
end
|
490
|
+
return data, status_code, headers
|
491
|
+
end
|
492
|
+
end
|
493
|
+
end
|
@@ -0,0 +1,172 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module PulpcoreClient
|
16
|
+
class WorkersApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List workers
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @option opts [String] :name
|
25
|
+
# @option opts [String] :name__in Filter results where name is in a comma-separated list of values
|
26
|
+
# @option opts [String] :last_heartbeat__lt Filter results where last_heartbeat is less than value
|
27
|
+
# @option opts [String] :last_heartbeat__lte Filter results where last_heartbeat is less than or equal to value
|
28
|
+
# @option opts [String] :last_heartbeat__gt Filter results where last_heartbeat is greater than value
|
29
|
+
# @option opts [String] :last_heartbeat__gte Filter results where last_heartbeat is greater than or equal to value
|
30
|
+
# @option opts [String] :last_heartbeat__range Filter results where last_heartbeat is between two comma separated values
|
31
|
+
# @option opts [String] :online
|
32
|
+
# @option opts [String] :missing
|
33
|
+
# @option opts [String] :last_heartbeat ISO 8601 formatted dates are supported
|
34
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
35
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
36
|
+
# @return [InlineResponse2005]
|
37
|
+
def workers_list(opts = {})
|
38
|
+
data, _status_code, _headers = workers_list_with_http_info(opts)
|
39
|
+
data
|
40
|
+
end
|
41
|
+
|
42
|
+
# List workers
|
43
|
+
# @param [Hash] opts the optional parameters
|
44
|
+
# @option opts [String] :name
|
45
|
+
# @option opts [String] :name__in Filter results where name is in a comma-separated list of values
|
46
|
+
# @option opts [String] :last_heartbeat__lt Filter results where last_heartbeat is less than value
|
47
|
+
# @option opts [String] :last_heartbeat__lte Filter results where last_heartbeat is less than or equal to value
|
48
|
+
# @option opts [String] :last_heartbeat__gt Filter results where last_heartbeat is greater than value
|
49
|
+
# @option opts [String] :last_heartbeat__gte Filter results where last_heartbeat is greater than or equal to value
|
50
|
+
# @option opts [String] :last_heartbeat__range Filter results where last_heartbeat is between two comma separated values
|
51
|
+
# @option opts [String] :online
|
52
|
+
# @option opts [String] :missing
|
53
|
+
# @option opts [String] :last_heartbeat ISO 8601 formatted dates are supported
|
54
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
55
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
56
|
+
# @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers
|
57
|
+
def workers_list_with_http_info(opts = {})
|
58
|
+
if @api_client.config.debugging
|
59
|
+
@api_client.config.logger.debug 'Calling API: WorkersApi.workers_list ...'
|
60
|
+
end
|
61
|
+
# resource path
|
62
|
+
local_var_path = '/pulp/api/v3/workers/'
|
63
|
+
|
64
|
+
# query parameters
|
65
|
+
query_params = opts[:query_params] || {}
|
66
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
67
|
+
query_params[:'name__in'] = opts[:'name__in'] if !opts[:'name__in'].nil?
|
68
|
+
query_params[:'last_heartbeat__lt'] = opts[:'last_heartbeat__lt'] if !opts[:'last_heartbeat__lt'].nil?
|
69
|
+
query_params[:'last_heartbeat__lte'] = opts[:'last_heartbeat__lte'] if !opts[:'last_heartbeat__lte'].nil?
|
70
|
+
query_params[:'last_heartbeat__gt'] = opts[:'last_heartbeat__gt'] if !opts[:'last_heartbeat__gt'].nil?
|
71
|
+
query_params[:'last_heartbeat__gte'] = opts[:'last_heartbeat__gte'] if !opts[:'last_heartbeat__gte'].nil?
|
72
|
+
query_params[:'last_heartbeat__range'] = opts[:'last_heartbeat__range'] if !opts[:'last_heartbeat__range'].nil?
|
73
|
+
query_params[:'online'] = opts[:'online'] if !opts[:'online'].nil?
|
74
|
+
query_params[:'missing'] = opts[:'missing'] if !opts[:'missing'].nil?
|
75
|
+
query_params[:'last_heartbeat'] = opts[:'last_heartbeat'] if !opts[:'last_heartbeat'].nil?
|
76
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
77
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
78
|
+
|
79
|
+
# header parameters
|
80
|
+
header_params = opts[:header_params] || {}
|
81
|
+
# HTTP header 'Accept' (if needed)
|
82
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
83
|
+
|
84
|
+
# form parameters
|
85
|
+
form_params = opts[:form_params] || {}
|
86
|
+
|
87
|
+
# http body (model)
|
88
|
+
post_body = opts[:body]
|
89
|
+
|
90
|
+
# return_type
|
91
|
+
return_type = opts[:return_type] || 'InlineResponse2005'
|
92
|
+
|
93
|
+
# auth_names
|
94
|
+
auth_names = opts[:auth_names] || ['Basic']
|
95
|
+
|
96
|
+
new_options = opts.merge(
|
97
|
+
:header_params => header_params,
|
98
|
+
:query_params => query_params,
|
99
|
+
:form_params => form_params,
|
100
|
+
:body => post_body,
|
101
|
+
:auth_names => auth_names,
|
102
|
+
:return_type => return_type
|
103
|
+
)
|
104
|
+
|
105
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
106
|
+
if @api_client.config.debugging
|
107
|
+
@api_client.config.logger.debug "API called: WorkersApi#workers_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
108
|
+
end
|
109
|
+
return data, status_code, headers
|
110
|
+
end
|
111
|
+
|
112
|
+
# Inspect a worker
|
113
|
+
# @param worker_href [String] URI of Worker. e.g.: /pulp/api/v3/workers/1/
|
114
|
+
# @param [Hash] opts the optional parameters
|
115
|
+
# @return [Worker]
|
116
|
+
def workers_read(worker_href, opts = {})
|
117
|
+
data, _status_code, _headers = workers_read_with_http_info(worker_href, opts)
|
118
|
+
data
|
119
|
+
end
|
120
|
+
|
121
|
+
# Inspect a worker
|
122
|
+
# @param worker_href [String] URI of Worker. e.g.: /pulp/api/v3/workers/1/
|
123
|
+
# @param [Hash] opts the optional parameters
|
124
|
+
# @return [Array<(Worker, Integer, Hash)>] Worker data, response status code and response headers
|
125
|
+
def workers_read_with_http_info(worker_href, opts = {})
|
126
|
+
if @api_client.config.debugging
|
127
|
+
@api_client.config.logger.debug 'Calling API: WorkersApi.workers_read ...'
|
128
|
+
end
|
129
|
+
# verify the required parameter 'worker_href' is set
|
130
|
+
if @api_client.config.client_side_validation && worker_href.nil?
|
131
|
+
fail ArgumentError, "Missing the required parameter 'worker_href' when calling WorkersApi.workers_read"
|
132
|
+
end
|
133
|
+
# resource path
|
134
|
+
local_var_path = '{worker_href}'.sub('{' + 'worker_href' + '}', worker_href.to_s)
|
135
|
+
|
136
|
+
# query parameters
|
137
|
+
query_params = opts[:query_params] || {}
|
138
|
+
|
139
|
+
# header parameters
|
140
|
+
header_params = opts[:header_params] || {}
|
141
|
+
# HTTP header 'Accept' (if needed)
|
142
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
143
|
+
|
144
|
+
# form parameters
|
145
|
+
form_params = opts[:form_params] || {}
|
146
|
+
|
147
|
+
# http body (model)
|
148
|
+
post_body = opts[:body]
|
149
|
+
|
150
|
+
# return_type
|
151
|
+
return_type = opts[:return_type] || 'Worker'
|
152
|
+
|
153
|
+
# auth_names
|
154
|
+
auth_names = opts[:auth_names] || ['Basic']
|
155
|
+
|
156
|
+
new_options = opts.merge(
|
157
|
+
:header_params => header_params,
|
158
|
+
:query_params => query_params,
|
159
|
+
:form_params => form_params,
|
160
|
+
:body => post_body,
|
161
|
+
:auth_names => auth_names,
|
162
|
+
:return_type => return_type
|
163
|
+
)
|
164
|
+
|
165
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug "API called: WorkersApi#workers_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
168
|
+
end
|
169
|
+
return data, status_code, headers
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|