pulp_ansible_client 0.2.0b1 → 0.2.0b2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -12
- data/docs/AnsibleDistribution.md +3 -3
- data/docs/CollectionRemote.md +1 -3
- data/docs/CollectionVersion.md +63 -0
- data/docs/ContentCollectionsApi.md +16 -14
- data/docs/{GalaxyCollection.md → GalaxyCollectionVersion.md} +2 -2
- data/docs/InlineResponse200.md +4 -4
- data/docs/InlineResponse2001.md +3 -3
- data/docs/InlineResponse2002.md +3 -3
- data/docs/InlineResponse2003.md +4 -4
- data/docs/InlineResponse2004.md +4 -4
- data/docs/InlineResponse2005.md +4 -4
- data/docs/InlineResponse2006.md +4 -4
- data/docs/InlineResponse2007.md +4 -4
- data/docs/InlineResponse2008.md +23 -0
- data/docs/PulpAnsibleGalaxyApiCollectionsApi.md +64 -6
- data/docs/PulpAnsibleGalaxyApiRolesApi.md +2 -2
- data/docs/PulpAnsibleGalaxyApiV1VersionsApi.md +2 -2
- data/docs/PulpAnsibleGalaxyApiV2VersionsApi.md +6 -6
- data/docs/PulpAnsibleTagsApi.md +66 -0
- data/docs/RemotesAnsibleApi.md +2 -2
- data/docs/RemotesCollectionApi.md +2 -2
- data/docs/Role.md +4 -4
- data/docs/Tag.md +17 -0
- data/docs/TagNested.md +17 -0
- data/lib/pulp_ansible_client/api/ansible_collections_api.rb +2 -2
- data/lib/pulp_ansible_client/api/content_collections_api.rb +19 -16
- data/lib/pulp_ansible_client/api/content_roles_api.rb +3 -3
- data/lib/pulp_ansible_client/api/distributions_ansible_api.rb +6 -6
- data/lib/pulp_ansible_client/api/pulp_ansible_api_api.rb +3 -3
- data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb +79 -15
- data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_roles_api.rb +6 -6
- data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_v1_versions_api.rb +6 -6
- data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_v2_versions_api.rb +14 -14
- data/lib/pulp_ansible_client/api/pulp_ansible_tags_api.rb +84 -0
- data/lib/pulp_ansible_client/api/remotes_ansible_api.rb +10 -10
- data/lib/pulp_ansible_client/api/remotes_collection_api.rb +10 -10
- data/lib/pulp_ansible_client/api_client.rb +77 -62
- data/lib/pulp_ansible_client/api_error.rb +1 -1
- data/lib/pulp_ansible_client/configuration.rb +13 -21
- data/lib/pulp_ansible_client/models/ansible_distribution.rb +15 -30
- data/lib/pulp_ansible_client/models/ansible_remote.rb +1 -1
- data/lib/pulp_ansible_client/models/async_operation_response.rb +1 -1
- data/lib/pulp_ansible_client/models/collection_remote.rb +5 -38
- data/lib/pulp_ansible_client/models/{collection.rb → collection_version.rb} +314 -43
- data/lib/pulp_ansible_client/models/{galaxy_collection.rb → galaxy_collection_version.rb} +4 -4
- data/lib/pulp_ansible_client/models/galaxy_role.rb +1 -1
- data/lib/pulp_ansible_client/models/galaxy_role_version.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response200.rb +12 -12
- data/lib/pulp_ansible_client/models/inline_response2001.rb +11 -11
- data/lib/pulp_ansible_client/models/inline_response2002.rb +11 -11
- data/lib/pulp_ansible_client/models/inline_response2003.rb +12 -12
- data/lib/pulp_ansible_client/models/inline_response2004.rb +12 -12
- data/lib/pulp_ansible_client/models/inline_response2005.rb +12 -12
- data/lib/pulp_ansible_client/models/inline_response2006.rb +12 -12
- data/lib/pulp_ansible_client/models/inline_response2007.rb +12 -12
- data/lib/pulp_ansible_client/models/inline_response2008.rb +235 -0
- data/lib/pulp_ansible_client/models/repository_sync_url.rb +1 -1
- data/lib/pulp_ansible_client/models/role.rb +18 -18
- data/lib/pulp_ansible_client/models/tag.rb +211 -0
- data/lib/pulp_ansible_client/models/tag_nested.rb +212 -0
- data/lib/pulp_ansible_client/version.rb +2 -2
- data/lib/pulp_ansible_client.rb +7 -3
- data/pulp_ansible_client.gemspec +3 -9
- data/spec/api/ansible_collections_api_spec.rb +1 -1
- data/spec/api/content_collections_api_spec.rb +7 -6
- data/spec/api/content_roles_api_spec.rb +1 -1
- data/spec/api/distributions_ansible_api_spec.rb +1 -1
- data/spec/api/pulp_ansible_api_api_spec.rb +1 -1
- data/spec/api/pulp_ansible_galaxy_api_collections_api_spec.rb +16 -3
- data/spec/api/pulp_ansible_galaxy_api_roles_api_spec.rb +2 -2
- data/spec/api/pulp_ansible_galaxy_api_v1_versions_api_spec.rb +2 -2
- data/spec/api/pulp_ansible_galaxy_api_v2_versions_api_spec.rb +3 -3
- data/spec/api/pulp_ansible_tags_api_spec.rb +48 -0
- data/spec/api/remotes_ansible_api_spec.rb +2 -2
- data/spec/api/remotes_collection_api_spec.rb +2 -2
- data/spec/api_client_spec.rb +1 -39
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/ansible_distribution_spec.rb +6 -6
- data/spec/models/ansible_remote_spec.rb +1 -1
- data/spec/models/async_operation_response_spec.rb +1 -1
- data/spec/models/collection_remote_spec.rb +1 -7
- data/spec/models/{collection_spec.rb → collection_version_spec.rb} +77 -11
- data/spec/models/{galaxy_collection_spec.rb → galaxy_collection_version_spec.rb} +7 -7
- data/spec/models/galaxy_role_spec.rb +1 -1
- data/spec/models/galaxy_role_version_spec.rb +1 -1
- data/spec/models/inline_response2001_spec.rb +4 -4
- data/spec/models/inline_response2002_spec.rb +4 -4
- data/spec/models/inline_response2003_spec.rb +4 -4
- data/spec/models/inline_response2004_spec.rb +4 -4
- data/spec/models/inline_response2005_spec.rb +4 -4
- data/spec/models/inline_response2006_spec.rb +4 -4
- data/spec/models/inline_response2007_spec.rb +4 -4
- data/spec/models/inline_response2008_spec.rb +59 -0
- data/spec/models/inline_response200_spec.rb +4 -4
- data/spec/models/repository_sync_url_spec.rb +1 -1
- data/spec/models/role_spec.rb +4 -4
- data/spec/models/tag_nested_spec.rb +41 -0
- data/spec/models/tag_spec.rb +41 -0
- data/spec/spec_helper.rb +1 -1
- metadata +30 -141
- data/Gemfile.lock +0 -79
- data/docs/Collection.md +0 -41
@@ -6,11 +6,11 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module PulpAnsibleClient
|
16
16
|
class PulpAnsibleGalaxyApiV1VersionsApi
|
@@ -25,7 +25,7 @@ module PulpAnsibleClient
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
26
|
# @option opts [Integer] :page A page number within the paginated result set.
|
27
27
|
# @option opts [Integer] :page_size Number of results to return per page.
|
28
|
-
# @return [
|
28
|
+
# @return [InlineResponse2007]
|
29
29
|
def list(path, role_pk, opts = {})
|
30
30
|
data, _status_code, _headers = list_with_http_info(path, role_pk, opts)
|
31
31
|
data
|
@@ -37,7 +37,7 @@ module PulpAnsibleClient
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
38
38
|
# @option opts [Integer] :page A page number within the paginated result set.
|
39
39
|
# @option opts [Integer] :page_size Number of results to return per page.
|
40
|
-
# @return [Array<(
|
40
|
+
# @return [Array<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 data, response status code and response headers
|
41
41
|
def list_with_http_info(path, role_pk, opts = {})
|
42
42
|
if @api_client.config.debugging
|
43
43
|
@api_client.config.logger.debug 'Calling API: PulpAnsibleGalaxyApiV1VersionsApi.list ...'
|
@@ -51,7 +51,7 @@ module PulpAnsibleClient
|
|
51
51
|
fail ArgumentError, "Missing the required parameter 'role_pk' when calling PulpAnsibleGalaxyApiV1VersionsApi.list"
|
52
52
|
end
|
53
53
|
# resource path
|
54
|
-
local_var_path = '/pulp_ansible/galaxy/{path}/api/v1/roles/{role_pk}/versions/'.sub('{' + 'path' + '}', path.to_s).sub('{' + 'role_pk' + '}', role_pk.to_s)
|
54
|
+
local_var_path = '/pulp_ansible/galaxy/{path}/api/v1/roles/{role_pk}/versions/'.sub('{' + 'path' + '}', CGI.escape(path.to_s).gsub('%2F', '/')).sub('{' + 'role_pk' + '}', CGI.escape(role_pk.to_s).gsub('%2F', '/'))
|
55
55
|
|
56
56
|
# query parameters
|
57
57
|
query_params = opts[:query_params] || {}
|
@@ -70,7 +70,7 @@ module PulpAnsibleClient
|
|
70
70
|
post_body = opts[:body]
|
71
71
|
|
72
72
|
# return_type
|
73
|
-
return_type = opts[:return_type] || '
|
73
|
+
return_type = opts[:return_type] || 'InlineResponse2007'
|
74
74
|
|
75
75
|
# auth_names
|
76
76
|
auth_names = opts[:auth_names] || ['Basic']
|
@@ -6,11 +6,11 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module PulpAnsibleClient
|
16
16
|
class PulpAnsibleGalaxyApiV2VersionsApi
|
@@ -20,32 +20,32 @@ module PulpAnsibleClient
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# APIView for Collections by namespace/name.
|
23
|
-
# @param
|
23
|
+
# @param collection_version_href [String] URI of Collection Version. e.g.: /pulp_ansible/galaxy/1/api/v2/collections/1/1/
|
24
24
|
# @param [Hash] opts the optional parameters
|
25
25
|
# @option opts [Integer] :page A page number within the paginated result set.
|
26
26
|
# @option opts [Integer] :page_size Number of results to return per page.
|
27
|
-
# @return [
|
28
|
-
def list(
|
29
|
-
data, _status_code, _headers = list_with_http_info(
|
27
|
+
# @return [InlineResponse2008]
|
28
|
+
def list(collection_version_href, opts = {})
|
29
|
+
data, _status_code, _headers = list_with_http_info(collection_version_href, opts)
|
30
30
|
data
|
31
31
|
end
|
32
32
|
|
33
33
|
# APIView for Collections by namespace/name.
|
34
|
-
# @param
|
34
|
+
# @param collection_version_href [String] URI of Collection Version. e.g.: /pulp_ansible/galaxy/1/api/v2/collections/1/1/
|
35
35
|
# @param [Hash] opts the optional parameters
|
36
36
|
# @option opts [Integer] :page A page number within the paginated result set.
|
37
37
|
# @option opts [Integer] :page_size Number of results to return per page.
|
38
|
-
# @return [Array<(
|
39
|
-
def list_with_http_info(
|
38
|
+
# @return [Array<(InlineResponse2008, Integer, Hash)>] InlineResponse2008 data, response status code and response headers
|
39
|
+
def list_with_http_info(collection_version_href, opts = {})
|
40
40
|
if @api_client.config.debugging
|
41
41
|
@api_client.config.logger.debug 'Calling API: PulpAnsibleGalaxyApiV2VersionsApi.list ...'
|
42
42
|
end
|
43
|
-
# verify the required parameter '
|
44
|
-
if @api_client.config.client_side_validation &&
|
45
|
-
fail ArgumentError, "Missing the required parameter '
|
43
|
+
# verify the required parameter 'collection_version_href' is set
|
44
|
+
if @api_client.config.client_side_validation && collection_version_href.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'collection_version_href' when calling PulpAnsibleGalaxyApiV2VersionsApi.list"
|
46
46
|
end
|
47
47
|
# resource path
|
48
|
-
local_var_path = '{
|
48
|
+
local_var_path = '{collection_version_href}versions/'.sub('{' + 'collection_version_href' + '}', CGI.escape(collection_version_href.to_s).gsub('%2F', '/'))
|
49
49
|
|
50
50
|
# query parameters
|
51
51
|
query_params = opts[:query_params] || {}
|
@@ -64,7 +64,7 @@ module PulpAnsibleClient
|
|
64
64
|
post_body = opts[:body]
|
65
65
|
|
66
66
|
# return_type
|
67
|
-
return_type = opts[:return_type] || '
|
67
|
+
return_type = opts[:return_type] || 'InlineResponse2008'
|
68
68
|
|
69
69
|
# auth_names
|
70
70
|
auth_names = opts[:auth_names] || ['Basic']
|
@@ -0,0 +1,84 @@
|
|
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.1.1-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module PulpAnsibleClient
|
16
|
+
class PulpAnsibleTagsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List tags
|
23
|
+
# ViewSet for Tag models.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
26
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
27
|
+
# @return [InlineResponse2003]
|
28
|
+
def list(opts = {})
|
29
|
+
data, _status_code, _headers = list_with_http_info(opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# List tags
|
34
|
+
# ViewSet for Tag models.
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
37
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
38
|
+
# @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers
|
39
|
+
def list_with_http_info(opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: PulpAnsibleTagsApi.list ...'
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/pulp/api/v3/pulp_ansible/tags/'
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = opts[:query_params] || {}
|
48
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
49
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
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
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:body]
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:return_type] || 'InlineResponse2003'
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:auth_names] || ['Basic']
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:header_params => header_params,
|
70
|
+
:query_params => query_params,
|
71
|
+
:form_params => form_params,
|
72
|
+
:body => post_body,
|
73
|
+
:auth_names => auth_names,
|
74
|
+
:return_type => return_type
|
75
|
+
)
|
76
|
+
|
77
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: PulpAnsibleTagsApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -6,11 +6,11 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module PulpAnsibleClient
|
16
16
|
class RemotesAnsibleApi
|
@@ -107,7 +107,7 @@ module PulpAnsibleClient
|
|
107
107
|
fail ArgumentError, "Missing the required parameter 'ansible_remote_href' when calling RemotesAnsibleApi.delete"
|
108
108
|
end
|
109
109
|
# resource path
|
110
|
-
local_var_path = '{ansible_remote_href}'.sub('{' + 'ansible_remote_href' + '}', ansible_remote_href.to_s)
|
110
|
+
local_var_path = '{ansible_remote_href}'.sub('{' + 'ansible_remote_href' + '}', CGI.escape(ansible_remote_href.to_s).gsub('%2F', '/'))
|
111
111
|
|
112
112
|
# query parameters
|
113
113
|
query_params = opts[:query_params] || {}
|
@@ -158,7 +158,7 @@ module PulpAnsibleClient
|
|
158
158
|
# @option opts [String] :_last_updated ISO 8601 formatted dates are supported
|
159
159
|
# @option opts [Integer] :page A page number within the paginated result set.
|
160
160
|
# @option opts [Integer] :page_size Number of results to return per page.
|
161
|
-
# @return [
|
161
|
+
# @return [InlineResponse2004]
|
162
162
|
def list(opts = {})
|
163
163
|
data, _status_code, _headers = list_with_http_info(opts)
|
164
164
|
data
|
@@ -177,7 +177,7 @@ module PulpAnsibleClient
|
|
177
177
|
# @option opts [String] :_last_updated ISO 8601 formatted dates are supported
|
178
178
|
# @option opts [Integer] :page A page number within the paginated result set.
|
179
179
|
# @option opts [Integer] :page_size Number of results to return per page.
|
180
|
-
# @return [Array<(
|
180
|
+
# @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers
|
181
181
|
def list_with_http_info(opts = {})
|
182
182
|
if @api_client.config.debugging
|
183
183
|
@api_client.config.logger.debug 'Calling API: RemotesAnsibleApi.list ...'
|
@@ -210,7 +210,7 @@ module PulpAnsibleClient
|
|
210
210
|
post_body = opts[:body]
|
211
211
|
|
212
212
|
# return_type
|
213
|
-
return_type = opts[:return_type] || '
|
213
|
+
return_type = opts[:return_type] || 'InlineResponse2004'
|
214
214
|
|
215
215
|
# auth_names
|
216
216
|
auth_names = opts[:auth_names] || ['Basic']
|
@@ -261,7 +261,7 @@ module PulpAnsibleClient
|
|
261
261
|
fail ArgumentError, "Missing the required parameter 'data' when calling RemotesAnsibleApi.partial_update"
|
262
262
|
end
|
263
263
|
# resource path
|
264
|
-
local_var_path = '{ansible_remote_href}'.sub('{' + 'ansible_remote_href' + '}', ansible_remote_href.to_s)
|
264
|
+
local_var_path = '{ansible_remote_href}'.sub('{' + 'ansible_remote_href' + '}', CGI.escape(ansible_remote_href.to_s).gsub('%2F', '/'))
|
265
265
|
|
266
266
|
# query parameters
|
267
267
|
query_params = opts[:query_params] || {}
|
@@ -325,7 +325,7 @@ module PulpAnsibleClient
|
|
325
325
|
fail ArgumentError, "Missing the required parameter 'ansible_remote_href' when calling RemotesAnsibleApi.read"
|
326
326
|
end
|
327
327
|
# resource path
|
328
|
-
local_var_path = '{ansible_remote_href}'.sub('{' + 'ansible_remote_href' + '}', ansible_remote_href.to_s)
|
328
|
+
local_var_path = '{ansible_remote_href}'.sub('{' + 'ansible_remote_href' + '}', CGI.escape(ansible_remote_href.to_s).gsub('%2F', '/'))
|
329
329
|
|
330
330
|
# query parameters
|
331
331
|
query_params = opts[:query_params] || {}
|
@@ -391,7 +391,7 @@ module PulpAnsibleClient
|
|
391
391
|
fail ArgumentError, "Missing the required parameter 'data' when calling RemotesAnsibleApi.sync"
|
392
392
|
end
|
393
393
|
# resource path
|
394
|
-
local_var_path = '{ansible_remote_href}sync/'.sub('{' + 'ansible_remote_href' + '}', ansible_remote_href.to_s)
|
394
|
+
local_var_path = '{ansible_remote_href}sync/'.sub('{' + 'ansible_remote_href' + '}', CGI.escape(ansible_remote_href.to_s).gsub('%2F', '/'))
|
395
395
|
|
396
396
|
# query parameters
|
397
397
|
query_params = opts[:query_params] || {}
|
@@ -461,7 +461,7 @@ module PulpAnsibleClient
|
|
461
461
|
fail ArgumentError, "Missing the required parameter 'data' when calling RemotesAnsibleApi.update"
|
462
462
|
end
|
463
463
|
# resource path
|
464
|
-
local_var_path = '{ansible_remote_href}'.sub('{' + 'ansible_remote_href' + '}', ansible_remote_href.to_s)
|
464
|
+
local_var_path = '{ansible_remote_href}'.sub('{' + 'ansible_remote_href' + '}', CGI.escape(ansible_remote_href.to_s).gsub('%2F', '/'))
|
465
465
|
|
466
466
|
# query parameters
|
467
467
|
query_params = opts[:query_params] || {}
|
@@ -6,11 +6,11 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module PulpAnsibleClient
|
16
16
|
class RemotesCollectionApi
|
@@ -107,7 +107,7 @@ module PulpAnsibleClient
|
|
107
107
|
fail ArgumentError, "Missing the required parameter 'collection_remote_href' when calling RemotesCollectionApi.delete"
|
108
108
|
end
|
109
109
|
# resource path
|
110
|
-
local_var_path = '{collection_remote_href}'.sub('{' + 'collection_remote_href' + '}', collection_remote_href.to_s)
|
110
|
+
local_var_path = '{collection_remote_href}'.sub('{' + 'collection_remote_href' + '}', CGI.escape(collection_remote_href.to_s).gsub('%2F', '/'))
|
111
111
|
|
112
112
|
# query parameters
|
113
113
|
query_params = opts[:query_params] || {}
|
@@ -158,7 +158,7 @@ module PulpAnsibleClient
|
|
158
158
|
# @option opts [String] :_last_updated ISO 8601 formatted dates are supported
|
159
159
|
# @option opts [Integer] :page A page number within the paginated result set.
|
160
160
|
# @option opts [Integer] :page_size Number of results to return per page.
|
161
|
-
# @return [
|
161
|
+
# @return [InlineResponse2005]
|
162
162
|
def list(opts = {})
|
163
163
|
data, _status_code, _headers = list_with_http_info(opts)
|
164
164
|
data
|
@@ -177,7 +177,7 @@ module PulpAnsibleClient
|
|
177
177
|
# @option opts [String] :_last_updated ISO 8601 formatted dates are supported
|
178
178
|
# @option opts [Integer] :page A page number within the paginated result set.
|
179
179
|
# @option opts [Integer] :page_size Number of results to return per page.
|
180
|
-
# @return [Array<(
|
180
|
+
# @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers
|
181
181
|
def list_with_http_info(opts = {})
|
182
182
|
if @api_client.config.debugging
|
183
183
|
@api_client.config.logger.debug 'Calling API: RemotesCollectionApi.list ...'
|
@@ -210,7 +210,7 @@ module PulpAnsibleClient
|
|
210
210
|
post_body = opts[:body]
|
211
211
|
|
212
212
|
# return_type
|
213
|
-
return_type = opts[:return_type] || '
|
213
|
+
return_type = opts[:return_type] || 'InlineResponse2005'
|
214
214
|
|
215
215
|
# auth_names
|
216
216
|
auth_names = opts[:auth_names] || ['Basic']
|
@@ -261,7 +261,7 @@ module PulpAnsibleClient
|
|
261
261
|
fail ArgumentError, "Missing the required parameter 'data' when calling RemotesCollectionApi.partial_update"
|
262
262
|
end
|
263
263
|
# resource path
|
264
|
-
local_var_path = '{collection_remote_href}'.sub('{' + 'collection_remote_href' + '}', collection_remote_href.to_s)
|
264
|
+
local_var_path = '{collection_remote_href}'.sub('{' + 'collection_remote_href' + '}', CGI.escape(collection_remote_href.to_s).gsub('%2F', '/'))
|
265
265
|
|
266
266
|
# query parameters
|
267
267
|
query_params = opts[:query_params] || {}
|
@@ -325,7 +325,7 @@ module PulpAnsibleClient
|
|
325
325
|
fail ArgumentError, "Missing the required parameter 'collection_remote_href' when calling RemotesCollectionApi.read"
|
326
326
|
end
|
327
327
|
# resource path
|
328
|
-
local_var_path = '{collection_remote_href}'.sub('{' + 'collection_remote_href' + '}', collection_remote_href.to_s)
|
328
|
+
local_var_path = '{collection_remote_href}'.sub('{' + 'collection_remote_href' + '}', CGI.escape(collection_remote_href.to_s).gsub('%2F', '/'))
|
329
329
|
|
330
330
|
# query parameters
|
331
331
|
query_params = opts[:query_params] || {}
|
@@ -391,7 +391,7 @@ module PulpAnsibleClient
|
|
391
391
|
fail ArgumentError, "Missing the required parameter 'data' when calling RemotesCollectionApi.sync"
|
392
392
|
end
|
393
393
|
# resource path
|
394
|
-
local_var_path = '{collection_remote_href}sync/'.sub('{' + 'collection_remote_href' + '}', collection_remote_href.to_s)
|
394
|
+
local_var_path = '{collection_remote_href}sync/'.sub('{' + 'collection_remote_href' + '}', CGI.escape(collection_remote_href.to_s).gsub('%2F', '/'))
|
395
395
|
|
396
396
|
# query parameters
|
397
397
|
query_params = opts[:query_params] || {}
|
@@ -461,7 +461,7 @@ module PulpAnsibleClient
|
|
461
461
|
fail ArgumentError, "Missing the required parameter 'data' when calling RemotesCollectionApi.update"
|
462
462
|
end
|
463
463
|
# resource path
|
464
|
-
local_var_path = '{collection_remote_href}'.sub('{' + 'collection_remote_href' + '}', collection_remote_href.to_s)
|
464
|
+
local_var_path = '{collection_remote_href}'.sub('{' + 'collection_remote_href' + '}', CGI.escape(collection_remote_href.to_s).gsub('%2F', '/'))
|
465
465
|
|
466
466
|
# query parameters
|
467
467
|
query_params = opts[:query_params] || {}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,8 +14,7 @@ require 'date'
|
|
14
14
|
require 'json'
|
15
15
|
require 'logger'
|
16
16
|
require 'tempfile'
|
17
|
-
require '
|
18
|
-
require 'uri'
|
17
|
+
require 'faraday'
|
19
18
|
|
20
19
|
module PulpAnsibleClient
|
21
20
|
class ApiClient
|
@@ -47,26 +46,46 @@ module PulpAnsibleClient
|
|
47
46
|
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
48
47
|
# the data deserialized from response body (could be nil), response status code and response headers.
|
49
48
|
def call_api(http_method, path, opts = {})
|
50
|
-
|
51
|
-
|
49
|
+
ssl_options = {
|
50
|
+
:ca_file => @config.ssl_ca_file,
|
51
|
+
:verify => @config.ssl_verify,
|
52
|
+
:verify => @config.ssl_verify_mode,
|
53
|
+
:client_cert => @config.ssl_client_cert,
|
54
|
+
:client_key => @config.ssl_client_key
|
55
|
+
}
|
52
56
|
|
53
|
-
|
54
|
-
|
57
|
+
connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn|
|
58
|
+
conn.basic_auth(config.username, config.password)
|
59
|
+
if opts[:header_params]["Content-Type"] == "multipart/form-data"
|
60
|
+
conn.request :multipart
|
61
|
+
conn.request :url_encoded
|
62
|
+
end
|
63
|
+
conn.adapter(Faraday.default_adapter)
|
55
64
|
end
|
56
65
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
begin
|
67
|
+
response = connection.public_send(http_method.to_sym.downcase) do |req|
|
68
|
+
build_request(http_method, path, req, opts)
|
69
|
+
end
|
70
|
+
|
71
|
+
if @config.debugging
|
72
|
+
@config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
|
73
|
+
end
|
74
|
+
|
75
|
+
unless response.success?
|
76
|
+
if response.status == 0
|
77
|
+
# Errors from libcurl will be made visible here
|
78
|
+
fail ApiError.new(:code => 0,
|
79
|
+
:message => response.return_message)
|
80
|
+
else
|
81
|
+
fail ApiError.new(:code => response.status,
|
82
|
+
:response_headers => response.headers,
|
83
|
+
:response_body => response.body),
|
84
|
+
response.reason_phrase
|
85
|
+
end
|
69
86
|
end
|
87
|
+
rescue Faraday::TimeoutError
|
88
|
+
fail ApiError.new('Connection timed out')
|
70
89
|
end
|
71
90
|
|
72
91
|
if opts[:return_type]
|
@@ -74,7 +93,7 @@ module PulpAnsibleClient
|
|
74
93
|
else
|
75
94
|
data = nil
|
76
95
|
end
|
77
|
-
return data, response.
|
96
|
+
return data, response.status, response.headers
|
78
97
|
end
|
79
98
|
|
80
99
|
# Builds the HTTP request
|
@@ -86,7 +105,7 @@ module PulpAnsibleClient
|
|
86
105
|
# @option opts [Hash] :form_params Query parameters
|
87
106
|
# @option opts [Object] :body HTTP body (JSON/XML)
|
88
107
|
# @return [Typhoeus::Request] A Typhoeus Request
|
89
|
-
def build_request(http_method, path, opts = {})
|
108
|
+
def build_request(http_method, path, request, opts = {})
|
90
109
|
url = build_request_url(path)
|
91
110
|
http_method = http_method.to_sym.downcase
|
92
111
|
|
@@ -96,25 +115,15 @@ module PulpAnsibleClient
|
|
96
115
|
|
97
116
|
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
98
117
|
|
99
|
-
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
100
|
-
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
101
|
-
|
102
118
|
req_opts = {
|
103
119
|
:method => http_method,
|
104
120
|
:headers => header_params,
|
105
121
|
:params => query_params,
|
106
122
|
:params_encoding => @config.params_encoding,
|
107
123
|
:timeout => @config.timeout,
|
108
|
-
:ssl_verifypeer => @config.verify_ssl,
|
109
|
-
:ssl_verifyhost => _verify_ssl_host,
|
110
|
-
:sslcert => @config.cert_file,
|
111
|
-
:sslkey => @config.key_file,
|
112
124
|
:verbose => @config.debugging
|
113
125
|
}
|
114
126
|
|
115
|
-
# set custom cert, if provided
|
116
|
-
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
117
|
-
|
118
127
|
if [:post, :patch, :put, :delete].include?(http_method)
|
119
128
|
req_body = build_request_body(header_params, form_params, opts[:body])
|
120
129
|
req_opts.update :body => req_body
|
@@ -122,12 +131,46 @@ module PulpAnsibleClient
|
|
122
131
|
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
123
132
|
end
|
124
133
|
end
|
125
|
-
|
126
|
-
request =
|
134
|
+
request.headers = header_params
|
135
|
+
request.body = req_body
|
136
|
+
request.url url
|
137
|
+
request.params = query_params
|
127
138
|
download_file(request) if opts[:return_type] == 'File'
|
128
139
|
request
|
129
140
|
end
|
130
141
|
|
142
|
+
# Builds the HTTP request body
|
143
|
+
#
|
144
|
+
# @param [Hash] header_params Header parameters
|
145
|
+
# @param [Hash] form_params Query parameters
|
146
|
+
# @param [Object] body HTTP body (JSON/XML)
|
147
|
+
# @return [String] HTTP body data in the form of string
|
148
|
+
def build_request_body(header_params, form_params, body)
|
149
|
+
# http form
|
150
|
+
if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
|
151
|
+
data = URI.encode_www_form(form_params)
|
152
|
+
elsif header_params['Content-Type'] == 'multipart/form-data'
|
153
|
+
data = {}
|
154
|
+
form_params.each do |key, value|
|
155
|
+
case value
|
156
|
+
when ::File, ::Tempfile
|
157
|
+
# TODO hardcode to application/octet-stream, need better way to detect content type
|
158
|
+
data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
|
159
|
+
when ::Array, nil
|
160
|
+
# let Faraday handle Array and nil parameters
|
161
|
+
data[key] = value
|
162
|
+
else
|
163
|
+
data[key] = value.to_s
|
164
|
+
end
|
165
|
+
end
|
166
|
+
elsif body
|
167
|
+
data = body.is_a?(String) ? body : body.to_json
|
168
|
+
else
|
169
|
+
data = nil
|
170
|
+
end
|
171
|
+
data
|
172
|
+
end
|
173
|
+
|
131
174
|
# Check if the given MIME is a JSON MIME.
|
132
175
|
# JSON MIME examples:
|
133
176
|
# application/json
|
@@ -262,35 +305,7 @@ module PulpAnsibleClient
|
|
262
305
|
def build_request_url(path)
|
263
306
|
# Add leading and trailing slashes to path
|
264
307
|
path = "/#{path}".gsub(/\/+/, '/')
|
265
|
-
|
266
|
-
end
|
267
|
-
|
268
|
-
# Builds the HTTP request body
|
269
|
-
#
|
270
|
-
# @param [Hash] header_params Header parameters
|
271
|
-
# @param [Hash] form_params Query parameters
|
272
|
-
# @param [Object] body HTTP body (JSON/XML)
|
273
|
-
# @return [String] HTTP body data in the form of string
|
274
|
-
def build_request_body(header_params, form_params, body)
|
275
|
-
# http form
|
276
|
-
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
277
|
-
header_params['Content-Type'] == 'multipart/form-data'
|
278
|
-
data = {}
|
279
|
-
form_params.each do |key, value|
|
280
|
-
case value
|
281
|
-
when ::File, ::Array, nil
|
282
|
-
# let typhoeus handle File, Array and nil parameters
|
283
|
-
data[key] = value
|
284
|
-
else
|
285
|
-
data[key] = value.to_s
|
286
|
-
end
|
287
|
-
end
|
288
|
-
elsif body
|
289
|
-
data = body.is_a?(String) ? body : body.to_json
|
290
|
-
else
|
291
|
-
data = nil
|
292
|
-
end
|
293
|
-
data
|
308
|
+
@config.base_url + path
|
294
309
|
end
|
295
310
|
|
296
311
|
# Update hearder and query params based on authentication settings.
|
@@ -6,12 +6,10 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require 'uri'
|
14
|
-
|
15
13
|
module PulpAnsibleClient
|
16
14
|
class Configuration
|
17
15
|
# Defines url scheme
|
@@ -88,33 +86,28 @@ module PulpAnsibleClient
|
|
88
86
|
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
89
87
|
#
|
90
88
|
# @return [true, false]
|
91
|
-
attr_accessor :
|
89
|
+
attr_accessor :ssl_verify
|
92
90
|
|
93
91
|
### TLS/SSL setting
|
94
|
-
#
|
95
|
-
# Default to true.
|
92
|
+
# Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
|
96
93
|
#
|
97
94
|
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
98
95
|
#
|
99
|
-
|
100
|
-
attr_accessor :verify_ssl_host
|
96
|
+
attr_accessor :ssl_verify_mode
|
101
97
|
|
102
98
|
### TLS/SSL setting
|
103
99
|
# Set this to customize the certificate file to verify the peer.
|
104
100
|
#
|
105
101
|
# @return [String] the path to the certificate file
|
106
|
-
|
107
|
-
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
108
|
-
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
109
|
-
attr_accessor :ssl_ca_cert
|
102
|
+
attr_accessor :ssl_ca_file
|
110
103
|
|
111
104
|
### TLS/SSL setting
|
112
105
|
# Client certificate file (for client certificate)
|
113
|
-
attr_accessor :
|
106
|
+
attr_accessor :ssl_client_cert
|
114
107
|
|
115
108
|
### TLS/SSL setting
|
116
109
|
# Client private key file (for client certificate)
|
117
|
-
attr_accessor :
|
110
|
+
attr_accessor :ssl_client_key
|
118
111
|
|
119
112
|
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
120
113
|
# Default to nil.
|
@@ -135,11 +128,11 @@ module PulpAnsibleClient
|
|
135
128
|
@api_key_prefix = {}
|
136
129
|
@timeout = 0
|
137
130
|
@client_side_validation = true
|
138
|
-
@
|
139
|
-
@
|
140
|
-
@
|
141
|
-
@
|
142
|
-
@
|
131
|
+
@ssl_verify = true
|
132
|
+
@ssl_verify_mode = nil
|
133
|
+
@ssl_ca_file = nil
|
134
|
+
@ssl_client_cert = nil
|
135
|
+
@ssl_client_key = nil
|
143
136
|
@debugging = false
|
144
137
|
@inject_format = false
|
145
138
|
@force_ending_format = false
|
@@ -174,8 +167,7 @@ module PulpAnsibleClient
|
|
174
167
|
end
|
175
168
|
|
176
169
|
def base_url
|
177
|
-
|
178
|
-
URI.encode(url)
|
170
|
+
"#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
179
171
|
end
|
180
172
|
|
181
173
|
# Gets API key (with prefix if set).
|