pulp_python_client 3.3.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -4
  3. data/build/lib/pulpcore/__init__.py +2 -0
  4. data/build/lib/pulpcore/client/__init__.py +2 -0
  5. data/build/lib/pulpcore/client/pulp_python/__init__.py +75 -0
  6. data/build/lib/pulpcore/client/pulp_python/api/__init__.py +15 -0
  7. data/build/lib/pulpcore/client/pulp_python/api/content_packages_api.py +626 -0
  8. data/build/lib/pulpcore/client/pulp_python/api/distributions_pypi_api.py +830 -0
  9. data/build/lib/pulpcore/client/pulp_python/api/publications_pypi_api.py +566 -0
  10. data/build/lib/pulpcore/client/pulp_python/api/pypi_api.py +162 -0
  11. data/build/lib/pulpcore/client/pulp_python/api/pypi_legacy_api.py +185 -0
  12. data/build/lib/pulpcore/client/pulp_python/api/pypi_metadata_api.py +171 -0
  13. data/build/lib/pulpcore/client/pulp_python/api/pypi_simple_api.py +434 -0
  14. data/build/lib/pulpcore/client/pulp_python/api/remotes_python_api.py +972 -0
  15. data/build/lib/pulpcore/client/pulp_python/api/repositories_python_api.py +1063 -0
  16. data/build/lib/pulpcore/client/pulp_python/api/repositories_python_versions_api.py +614 -0
  17. data/build/lib/pulpcore/client/pulp_python/api_client.py +667 -0
  18. data/build/lib/pulpcore/client/pulp_python/configuration.py +427 -0
  19. data/build/lib/pulpcore/client/pulp_python/exceptions.py +121 -0
  20. data/build/lib/pulpcore/client/pulp_python/models/__init__.py +51 -0
  21. data/build/lib/pulpcore/client/pulp_python/models/async_operation_response.py +124 -0
  22. data/build/lib/pulpcore/client/pulp_python/models/content_summary.py +176 -0
  23. data/build/lib/pulpcore/client/pulp_python/models/content_summary_response.py +176 -0
  24. data/build/lib/pulpcore/client/pulp_python/models/exclude_platforms_enum.py +103 -0
  25. data/build/lib/pulpcore/client/pulp_python/models/package_metadata_response.py +209 -0
  26. data/build/lib/pulpcore/client/pulp_python/models/package_types_enum.py +107 -0
  27. data/build/lib/pulpcore/client/pulp_python/models/package_upload.py +187 -0
  28. data/build/lib/pulpcore/client/pulp_python/models/package_upload_task_response.py +176 -0
  29. data/build/lib/pulpcore/client/pulp_python/models/paginated_repository_version_response_list.py +197 -0
  30. data/build/lib/pulpcore/client/pulp_python/models/paginatedpython_python_distribution_response_list.py +197 -0
  31. data/build/lib/pulpcore/client/pulp_python/models/paginatedpython_python_package_content_response_list.py +197 -0
  32. data/build/lib/pulpcore/client/pulp_python/models/paginatedpython_python_publication_response_list.py +197 -0
  33. data/build/lib/pulpcore/client/pulp_python/models/paginatedpython_python_remote_response_list.py +197 -0
  34. data/build/lib/pulpcore/client/pulp_python/models/paginatedpython_python_repository_response_list.py +197 -0
  35. data/build/lib/pulpcore/client/pulp_python/models/patchedpython_python_distribution.py +286 -0
  36. data/build/lib/pulpcore/client/pulp_python/models/patchedpython_python_remote.py +823 -0
  37. data/build/lib/pulpcore/client/pulp_python/models/patchedpython_python_repository.py +259 -0
  38. data/build/lib/pulpcore/client/pulp_python/models/policy_enum.py +102 -0
  39. data/build/lib/pulpcore/client/pulp_python/models/python_bander_remote.py +181 -0
  40. data/build/lib/pulpcore/client/pulp_python/models/python_python_distribution.py +288 -0
  41. data/build/lib/pulpcore/client/pulp_python/models/python_python_distribution_response.py +368 -0
  42. data/build/lib/pulpcore/client/pulp_python/models/python_python_package_content.py +824 -0
  43. data/build/lib/pulpcore/client/pulp_python/models/python_python_package_content_response.py +933 -0
  44. data/build/lib/pulpcore/client/pulp_python/models/python_python_publication.py +149 -0
  45. data/build/lib/pulpcore/client/pulp_python/models/python_python_publication_response.py +231 -0
  46. data/build/lib/pulpcore/client/pulp_python/models/python_python_remote.py +825 -0
  47. data/build/lib/pulpcore/client/pulp_python/models/python_python_remote_response.py +772 -0
  48. data/build/lib/pulpcore/client/pulp_python/models/python_python_repository.py +260 -0
  49. data/build/lib/pulpcore/client/pulp_python/models/python_python_repository_response.py +366 -0
  50. data/build/lib/pulpcore/client/pulp_python/models/repository_add_remove_content.py +179 -0
  51. data/build/lib/pulpcore/client/pulp_python/models/repository_sync_url.py +151 -0
  52. data/build/lib/pulpcore/client/pulp_python/models/repository_version.py +123 -0
  53. data/build/lib/pulpcore/client/pulp_python/models/repository_version_response.py +257 -0
  54. data/build/lib/pulpcore/client/pulp_python/models/summary_response.py +182 -0
  55. data/build/lib/pulpcore/client/pulp_python/rest.py +292 -0
  56. data/dist/pulp_python-client-3.4.0.tar.gz +0 -0
  57. data/dist/pulp_python_client-3.4.0-py3-none-any.whl +0 -0
  58. data/docs/ContentPackagesApi.md +6 -0
  59. data/docs/DistributionsPypiApi.md +2 -2
  60. data/docs/PackageMetadataResponse.md +23 -0
  61. data/docs/PackageUpload.md +21 -0
  62. data/docs/PackageUploadTaskResponse.md +21 -0
  63. data/docs/PatchedpythonPythonDistribution.md +3 -1
  64. data/docs/PatchedpythonPythonRemote.md +1 -1
  65. data/docs/PublicationsPypiApi.md +1 -1
  66. data/docs/PypiApi.md +62 -0
  67. data/docs/PypiLegacyApi.md +70 -0
  68. data/docs/PypiMetadataApi.md +64 -0
  69. data/docs/PypiSimpleApi.md +190 -0
  70. data/docs/PythonBanderRemote.md +1 -1
  71. data/docs/PythonPythonDistribution.md +3 -1
  72. data/docs/PythonPythonDistributionResponse.md +4 -2
  73. data/docs/PythonPythonPackageContent.md +6 -0
  74. data/docs/PythonPythonPackageContentResponse.md +5 -1
  75. data/docs/PythonPythonRemote.md +1 -1
  76. data/docs/PythonPythonRemoteResponse.md +1 -1
  77. data/docs/RemotesPythonApi.md +3 -3
  78. data/docs/RepositoriesPythonApi.md +4 -4
  79. data/docs/SummaryResponse.md +21 -0
  80. data/lib/pulp_python_client/api/content_packages_api.rb +9 -0
  81. data/lib/pulp_python_client/api/distributions_pypi_api.rb +4 -4
  82. data/lib/pulp_python_client/api/publications_pypi_api.rb +2 -2
  83. data/lib/pulp_python_client/api/pypi_api.rb +90 -0
  84. data/lib/pulp_python_client/api/pypi_legacy_api.rb +111 -0
  85. data/lib/pulp_python_client/api/pypi_metadata_api.rb +96 -0
  86. data/lib/pulp_python_client/api/pypi_simple_api.rb +249 -0
  87. data/lib/pulp_python_client/api/remotes_python_api.rb +4 -4
  88. data/lib/pulp_python_client/api/repositories_python_api.rb +8 -8
  89. data/lib/pulp_python_client/models/package_metadata_response.rb +257 -0
  90. data/lib/pulp_python_client/models/package_upload.rb +268 -0
  91. data/lib/pulp_python_client/models/package_upload_task_response.rb +240 -0
  92. data/lib/pulp_python_client/models/patchedpython_python_distribution.rb +17 -5
  93. data/lib/pulp_python_client/models/patchedpython_python_remote.rb +1 -1
  94. data/lib/pulp_python_client/models/python_bander_remote.rb +1 -1
  95. data/lib/pulp_python_client/models/python_python_distribution.rb +17 -5
  96. data/lib/pulp_python_client/models/python_python_distribution_response.rb +17 -6
  97. data/lib/pulp_python_client/models/python_python_package_content.rb +33 -1
  98. data/lib/pulp_python_client/models/python_python_package_content_response.rb +23 -1
  99. data/lib/pulp_python_client/models/python_python_remote.rb +1 -1
  100. data/lib/pulp_python_client/models/python_python_remote_response.rb +1 -1
  101. data/lib/pulp_python_client/models/summary_response.rb +243 -0
  102. data/lib/pulp_python_client/version.rb +1 -1
  103. data/lib/pulp_python_client.rb +8 -0
  104. data/pulp_python_client.egg-info/PKG-INFO +15 -0
  105. data/pulp_python_client.egg-info/SOURCES.txt +105 -0
  106. data/pulp_python_client.egg-info/dependency_links.txt +1 -0
  107. data/pulp_python_client.egg-info/requires.txt +4 -0
  108. data/pulp_python_client.egg-info/top_level.txt +1 -0
  109. data/pulpcore/__init__.py +2 -0
  110. data/pulpcore/client/__init__.py +2 -0
  111. data/pulpcore/client/pulp_python/__init__.py +75 -0
  112. data/pulpcore/client/pulp_python/api/__init__.py +15 -0
  113. data/pulpcore/client/pulp_python/api/content_packages_api.py +626 -0
  114. data/pulpcore/client/pulp_python/api/distributions_pypi_api.py +830 -0
  115. data/pulpcore/client/pulp_python/api/publications_pypi_api.py +566 -0
  116. data/pulpcore/client/pulp_python/api/pypi_api.py +162 -0
  117. data/pulpcore/client/pulp_python/api/pypi_legacy_api.py +185 -0
  118. data/pulpcore/client/pulp_python/api/pypi_metadata_api.py +171 -0
  119. data/pulpcore/client/pulp_python/api/pypi_simple_api.py +434 -0
  120. data/pulpcore/client/pulp_python/api/remotes_python_api.py +972 -0
  121. data/pulpcore/client/pulp_python/api/repositories_python_api.py +1063 -0
  122. data/pulpcore/client/pulp_python/api/repositories_python_versions_api.py +614 -0
  123. data/pulpcore/client/pulp_python/api_client.py +667 -0
  124. data/pulpcore/client/pulp_python/configuration.py +427 -0
  125. data/pulpcore/client/pulp_python/exceptions.py +121 -0
  126. data/pulpcore/client/pulp_python/models/__init__.py +51 -0
  127. data/pulpcore/client/pulp_python/models/async_operation_response.py +124 -0
  128. data/pulpcore/client/pulp_python/models/content_summary.py +176 -0
  129. data/pulpcore/client/pulp_python/models/content_summary_response.py +176 -0
  130. data/pulpcore/client/pulp_python/models/exclude_platforms_enum.py +103 -0
  131. data/pulpcore/client/pulp_python/models/package_metadata_response.py +209 -0
  132. data/pulpcore/client/pulp_python/models/package_types_enum.py +107 -0
  133. data/pulpcore/client/pulp_python/models/package_upload.py +187 -0
  134. data/pulpcore/client/pulp_python/models/package_upload_task_response.py +176 -0
  135. data/pulpcore/client/pulp_python/models/paginated_repository_version_response_list.py +197 -0
  136. data/pulpcore/client/pulp_python/models/paginatedpython_python_distribution_response_list.py +197 -0
  137. data/pulpcore/client/pulp_python/models/paginatedpython_python_package_content_response_list.py +197 -0
  138. data/pulpcore/client/pulp_python/models/paginatedpython_python_publication_response_list.py +197 -0
  139. data/pulpcore/client/pulp_python/models/paginatedpython_python_remote_response_list.py +197 -0
  140. data/pulpcore/client/pulp_python/models/paginatedpython_python_repository_response_list.py +197 -0
  141. data/pulpcore/client/pulp_python/models/patchedpython_python_distribution.py +286 -0
  142. data/pulpcore/client/pulp_python/models/patchedpython_python_remote.py +823 -0
  143. data/pulpcore/client/pulp_python/models/patchedpython_python_repository.py +259 -0
  144. data/pulpcore/client/pulp_python/models/policy_enum.py +102 -0
  145. data/pulpcore/client/pulp_python/models/python_bander_remote.py +181 -0
  146. data/pulpcore/client/pulp_python/models/python_python_distribution.py +288 -0
  147. data/pulpcore/client/pulp_python/models/python_python_distribution_response.py +368 -0
  148. data/pulpcore/client/pulp_python/models/python_python_package_content.py +824 -0
  149. data/pulpcore/client/pulp_python/models/python_python_package_content_response.py +933 -0
  150. data/pulpcore/client/pulp_python/models/python_python_publication.py +149 -0
  151. data/pulpcore/client/pulp_python/models/python_python_publication_response.py +231 -0
  152. data/pulpcore/client/pulp_python/models/python_python_remote.py +825 -0
  153. data/pulpcore/client/pulp_python/models/python_python_remote_response.py +772 -0
  154. data/pulpcore/client/pulp_python/models/python_python_repository.py +260 -0
  155. data/pulpcore/client/pulp_python/models/python_python_repository_response.py +366 -0
  156. data/pulpcore/client/pulp_python/models/repository_add_remove_content.py +179 -0
  157. data/pulpcore/client/pulp_python/models/repository_sync_url.py +151 -0
  158. data/pulpcore/client/pulp_python/models/repository_version.py +123 -0
  159. data/pulpcore/client/pulp_python/models/repository_version_response.py +257 -0
  160. data/pulpcore/client/pulp_python/models/summary_response.py +182 -0
  161. data/pulpcore/client/pulp_python/rest.py +292 -0
  162. data/requirements.txt +6 -0
  163. data/setup.cfg +2 -0
  164. data/setup.py +42 -0
  165. data/spec/api/content_packages_api_spec.rb +3 -0
  166. data/spec/api/distributions_pypi_api_spec.rb +2 -2
  167. data/spec/api/publications_pypi_api_spec.rb +1 -1
  168. data/spec/api/pypi_api_spec.rb +49 -0
  169. data/spec/api/pypi_legacy_api_spec.rb +50 -0
  170. data/spec/api/pypi_metadata_api_spec.rb +50 -0
  171. data/spec/api/pypi_simple_api_spec.rb +79 -0
  172. data/spec/api/remotes_python_api_spec.rb +2 -2
  173. data/spec/api/repositories_python_api_spec.rb +4 -4
  174. data/spec/models/package_metadata_response_spec.rb +59 -0
  175. data/spec/models/package_upload_spec.rb +53 -0
  176. data/spec/models/package_upload_task_response_spec.rb +53 -0
  177. data/spec/models/patchedpython_python_distribution_spec.rb +6 -0
  178. data/spec/models/python_python_distribution_response_spec.rb +6 -0
  179. data/spec/models/python_python_distribution_spec.rb +6 -0
  180. data/spec/models/python_python_package_content_response_spec.rb +12 -0
  181. data/spec/models/python_python_package_content_spec.rb +18 -0
  182. data/spec/models/summary_response_spec.rb +53 -0
  183. data/test/__init__.py +0 -0
  184. data/test/test_async_operation_response.py +54 -0
  185. data/test/test_content_packages_api.py +55 -0
  186. data/test/test_content_summary.py +70 -0
  187. data/test/test_content_summary_response.py +70 -0
  188. data/test/test_distributions_pypi_api.py +76 -0
  189. data/test/test_exclude_platforms_enum.py +52 -0
  190. data/test/test_package_metadata_response.py +60 -0
  191. data/test/test_package_types_enum.py +52 -0
  192. data/test/test_package_upload.py +57 -0
  193. data/test/test_package_upload_task_response.py +58 -0
  194. data/test/test_paginated_repository_version_response_list.py +64 -0
  195. data/test/test_paginatedpython_python_distribution_response_list.py +68 -0
  196. data/test/test_paginatedpython_python_package_content_response_list.py +88 -0
  197. data/test/test_paginatedpython_python_publication_response_list.py +65 -0
  198. data/test/test_paginatedpython_python_remote_response_list.py +88 -0
  199. data/test/test_paginatedpython_python_repository_response_list.py +68 -0
  200. data/test/test_patchedpython_python_distribution.py +59 -0
  201. data/test/test_patchedpython_python_remote.py +84 -0
  202. data/test/test_patchedpython_python_repository.py +58 -0
  203. data/test/test_policy_enum.py +52 -0
  204. data/test/test_publications_pypi_api.py +62 -0
  205. data/test/test_pypi_api.py +41 -0
  206. data/test/test_pypi_legacy_api.py +41 -0
  207. data/test/test_pypi_metadata_api.py +41 -0
  208. data/test/test_pypi_simple_api.py +55 -0
  209. data/test/test_python_bander_remote.py +57 -0
  210. data/test/test_python_python_distribution.py +61 -0
  211. data/test/test_python_python_distribution_response.py +64 -0
  212. data/test/test_python_python_package_content.py +79 -0
  213. data/test/test_python_python_package_content_response.py +82 -0
  214. data/test/test_python_python_publication.py +54 -0
  215. data/test/test_python_python_publication_response.py +59 -0
  216. data/test/test_python_python_remote.py +86 -0
  217. data/test/test_python_python_remote_response.py +84 -0
  218. data/test/test_python_python_repository.py +59 -0
  219. data/test/test_python_python_repository_response.py +63 -0
  220. data/test/test_remotes_python_api.py +83 -0
  221. data/test/test_repositories_python_api.py +90 -0
  222. data/test/test_repositories_python_versions_api.py +61 -0
  223. data/test/test_repository_add_remove_content.py +59 -0
  224. data/test/test_repository_sync_url.py +54 -0
  225. data/test/test_repository_version.py +53 -0
  226. data/test/test_repository_version_response.py +58 -0
  227. data/test/test_summary_response.py +58 -0
  228. data/test-requirements.txt +3 -0
  229. data/tox.ini +9 -0
  230. metadata +221 -26
@@ -0,0 +1,292 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Pulp 3 API
5
+
6
+ Fetch, Upload, Organize, and Distribute Software Packages # noqa: E501
7
+
8
+ The version of the OpenAPI document: v3
9
+ Contact: pulp-list@redhat.com
10
+ Generated by: https://openapi-generator.tech
11
+ """
12
+
13
+
14
+ from __future__ import absolute_import
15
+
16
+ import io
17
+ import json
18
+ import logging
19
+ import re
20
+ import ssl
21
+
22
+ import certifi
23
+ # python 2 and python 3 compatibility library
24
+ import six
25
+ from six.moves.urllib.parse import urlencode
26
+ import urllib3
27
+
28
+ from pulpcore.client.pulp_python.exceptions import ApiException, ApiValueError
29
+
30
+
31
+ logger = logging.getLogger(__name__)
32
+
33
+
34
+ class RESTResponse(io.IOBase):
35
+
36
+ def __init__(self, resp):
37
+ self.urllib3_response = resp
38
+ self.status = resp.status
39
+ self.reason = resp.reason
40
+ self.data = resp.data
41
+
42
+ def getheaders(self):
43
+ """Returns a dictionary of the response headers."""
44
+ return self.urllib3_response.getheaders()
45
+
46
+ def getheader(self, name, default=None):
47
+ """Returns a given response header."""
48
+ return self.urllib3_response.getheader(name, default)
49
+
50
+
51
+ class RESTClientObject(object):
52
+
53
+ def __init__(self, configuration, pools_size=4, maxsize=None):
54
+ # urllib3.PoolManager will pass all kw parameters to connectionpool
55
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
56
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
57
+ # maxsize is the number of requests to host that are allowed in parallel # noqa: E501
58
+ # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
59
+
60
+ # cert_reqs
61
+ if configuration.verify_ssl:
62
+ cert_reqs = ssl.CERT_REQUIRED
63
+ else:
64
+ cert_reqs = ssl.CERT_NONE
65
+
66
+ # ca_certs
67
+ if configuration.ssl_ca_cert:
68
+ ca_certs = configuration.ssl_ca_cert
69
+ else:
70
+ # if not set certificate file, use Mozilla's root certificates.
71
+ ca_certs = certifi.where()
72
+
73
+ addition_pool_args = {}
74
+ if configuration.assert_hostname is not None:
75
+ addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
76
+
77
+ if configuration.retries is not None:
78
+ addition_pool_args['retries'] = configuration.retries
79
+
80
+ if maxsize is None:
81
+ if configuration.connection_pool_maxsize is not None:
82
+ maxsize = configuration.connection_pool_maxsize
83
+ else:
84
+ maxsize = 4
85
+
86
+ # https pool manager
87
+ if configuration.proxy:
88
+ self.pool_manager = urllib3.ProxyManager(
89
+ num_pools=pools_size,
90
+ maxsize=maxsize,
91
+ cert_reqs=cert_reqs,
92
+ ca_certs=ca_certs,
93
+ cert_file=configuration.cert_file,
94
+ key_file=configuration.key_file,
95
+ proxy_url=configuration.proxy,
96
+ proxy_headers=configuration.proxy_headers,
97
+ **addition_pool_args
98
+ )
99
+ else:
100
+ self.pool_manager = urllib3.PoolManager(
101
+ num_pools=pools_size,
102
+ maxsize=maxsize,
103
+ cert_reqs=cert_reqs,
104
+ ca_certs=ca_certs,
105
+ cert_file=configuration.cert_file,
106
+ key_file=configuration.key_file,
107
+ **addition_pool_args
108
+ )
109
+
110
+ def request(self, method, url, query_params=None, headers=None,
111
+ body=None, post_params=None, _preload_content=True,
112
+ _request_timeout=None):
113
+ """Perform requests.
114
+
115
+ :param method: http request method
116
+ :param url: http request url
117
+ :param query_params: query parameters in the url
118
+ :param headers: http request headers
119
+ :param body: request json body, for `application/json`
120
+ :param post_params: request post parameters,
121
+ `application/x-www-form-urlencoded`
122
+ and `multipart/form-data`
123
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
124
+ be returned without reading/decoding response
125
+ data. Default is True.
126
+ :param _request_timeout: timeout setting for this request. If one
127
+ number provided, it will be total request
128
+ timeout. It can also be a pair (tuple) of
129
+ (connection, read) timeouts.
130
+ """
131
+ method = method.upper()
132
+ assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
133
+ 'PATCH', 'OPTIONS']
134
+
135
+ if post_params and body:
136
+ raise ApiValueError(
137
+ "body parameter cannot be used with post_params parameter."
138
+ )
139
+
140
+ post_params = post_params or {}
141
+ headers = headers or {}
142
+
143
+ timeout = None
144
+ if _request_timeout:
145
+ if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821
146
+ timeout = urllib3.Timeout(total=_request_timeout)
147
+ elif (isinstance(_request_timeout, tuple) and
148
+ len(_request_timeout) == 2):
149
+ timeout = urllib3.Timeout(
150
+ connect=_request_timeout[0], read=_request_timeout[1])
151
+
152
+ if 'Content-Type' not in headers:
153
+ headers['Content-Type'] = 'application/json'
154
+
155
+ try:
156
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
157
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
158
+ if query_params:
159
+ url += '?' + urlencode(query_params)
160
+ if re.search('json', headers['Content-Type'], re.IGNORECASE):
161
+ request_body = None
162
+ if body is not None:
163
+ request_body = json.dumps(body)
164
+ r = self.pool_manager.request(
165
+ method, url,
166
+ body=request_body,
167
+ preload_content=_preload_content,
168
+ timeout=timeout,
169
+ headers=headers)
170
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
171
+ r = self.pool_manager.request(
172
+ method, url,
173
+ fields=post_params,
174
+ encode_multipart=False,
175
+ preload_content=_preload_content,
176
+ timeout=timeout,
177
+ headers=headers)
178
+ elif headers['Content-Type'] == 'multipart/form-data':
179
+ # must del headers['Content-Type'], or the correct
180
+ # Content-Type which generated by urllib3 will be
181
+ # overwritten.
182
+ del headers['Content-Type']
183
+ r = self.pool_manager.request(
184
+ method, url,
185
+ fields=post_params,
186
+ encode_multipart=True,
187
+ preload_content=_preload_content,
188
+ timeout=timeout,
189
+ headers=headers)
190
+ # Pass a `string` parameter directly in the body to support
191
+ # other content types than Json when `body` argument is
192
+ # provided in serialized form
193
+ elif isinstance(body, str) or isinstance(body, bytes):
194
+ request_body = body
195
+ r = self.pool_manager.request(
196
+ method, url,
197
+ body=request_body,
198
+ preload_content=_preload_content,
199
+ timeout=timeout,
200
+ headers=headers)
201
+ else:
202
+ # Cannot generate the request from given parameters
203
+ msg = """Cannot prepare a request message for provided
204
+ arguments. Please check that your arguments match
205
+ declared content type."""
206
+ raise ApiException(status=0, reason=msg)
207
+ # For `GET`, `HEAD`
208
+ else:
209
+ r = self.pool_manager.request(method, url,
210
+ fields=query_params,
211
+ preload_content=_preload_content,
212
+ timeout=timeout,
213
+ headers=headers)
214
+ except urllib3.exceptions.SSLError as e:
215
+ msg = "{0}\n{1}".format(type(e).__name__, str(e))
216
+ raise ApiException(status=0, reason=msg)
217
+
218
+ if _preload_content:
219
+ r = RESTResponse(r)
220
+
221
+ # log response body
222
+ logger.debug("response body: %s", r.data)
223
+
224
+ if not 200 <= r.status <= 299:
225
+ raise ApiException(http_resp=r)
226
+
227
+ return r
228
+
229
+ def GET(self, url, headers=None, query_params=None, _preload_content=True,
230
+ _request_timeout=None):
231
+ return self.request("GET", url,
232
+ headers=headers,
233
+ _preload_content=_preload_content,
234
+ _request_timeout=_request_timeout,
235
+ query_params=query_params)
236
+
237
+ def HEAD(self, url, headers=None, query_params=None, _preload_content=True,
238
+ _request_timeout=None):
239
+ return self.request("HEAD", url,
240
+ headers=headers,
241
+ _preload_content=_preload_content,
242
+ _request_timeout=_request_timeout,
243
+ query_params=query_params)
244
+
245
+ def OPTIONS(self, url, headers=None, query_params=None, post_params=None,
246
+ body=None, _preload_content=True, _request_timeout=None):
247
+ return self.request("OPTIONS", url,
248
+ headers=headers,
249
+ query_params=query_params,
250
+ post_params=post_params,
251
+ _preload_content=_preload_content,
252
+ _request_timeout=_request_timeout,
253
+ body=body)
254
+
255
+ def DELETE(self, url, headers=None, query_params=None, body=None,
256
+ _preload_content=True, _request_timeout=None):
257
+ return self.request("DELETE", url,
258
+ headers=headers,
259
+ query_params=query_params,
260
+ _preload_content=_preload_content,
261
+ _request_timeout=_request_timeout,
262
+ body=body)
263
+
264
+ def POST(self, url, headers=None, query_params=None, post_params=None,
265
+ body=None, _preload_content=True, _request_timeout=None):
266
+ return self.request("POST", url,
267
+ headers=headers,
268
+ query_params=query_params,
269
+ post_params=post_params,
270
+ _preload_content=_preload_content,
271
+ _request_timeout=_request_timeout,
272
+ body=body)
273
+
274
+ def PUT(self, url, headers=None, query_params=None, post_params=None,
275
+ body=None, _preload_content=True, _request_timeout=None):
276
+ return self.request("PUT", url,
277
+ headers=headers,
278
+ query_params=query_params,
279
+ post_params=post_params,
280
+ _preload_content=_preload_content,
281
+ _request_timeout=_request_timeout,
282
+ body=body)
283
+
284
+ def PATCH(self, url, headers=None, query_params=None, post_params=None,
285
+ body=None, _preload_content=True, _request_timeout=None):
286
+ return self.request("PATCH", url,
287
+ headers=headers,
288
+ query_params=query_params,
289
+ post_params=post_params,
290
+ _preload_content=_preload_content,
291
+ _request_timeout=_request_timeout,
292
+ body=body)
data/requirements.txt ADDED
@@ -0,0 +1,6 @@
1
+ certifi >= 14.05.14
2
+ future; python_version<="2.7"
3
+ six >= 1.10
4
+ python_dateutil >= 2.5.3
5
+ setuptools >= 21.0.0
6
+ urllib3 >= 1.15.1
data/setup.cfg ADDED
@@ -0,0 +1,2 @@
1
+ [flake8]
2
+ max-line-length=99
data/setup.py ADDED
@@ -0,0 +1,42 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Pulp 3 API
5
+
6
+ Fetch, Upload, Organize, and Distribute Software Packages # noqa: E501
7
+
8
+ The version of the OpenAPI document: v3
9
+ Contact: pulp-list@redhat.com
10
+ Generated by: https://openapi-generator.tech
11
+ """
12
+
13
+
14
+ from setuptools import setup, find_packages # noqa: H301
15
+
16
+ NAME = "pulp_python-client"
17
+ VERSION = "3.4.0"
18
+ # To install the library, run the following
19
+ #
20
+ # python setup.py install
21
+ #
22
+ # prerequisite: setuptools
23
+ # http://pypi.python.org/pypi/setuptools
24
+
25
+ REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
26
+ setup(
27
+ name=NAME,
28
+ version=VERSION,
29
+ description="Pulp 3 API",
30
+ author="Pulp Team",
31
+ author_email="pulp-list@redhat.com",
32
+ url="",
33
+ keywords=["pulp", "pulpcore", "client", "Pulp 3 API"],
34
+ install_requires=REQUIRES,
35
+ python_requires='>=3.4', # restrict client usage to Python 3 only
36
+ packages=find_packages(exclude=["test", "tests"]),
37
+ include_package_data=True,
38
+ license="GPLv2+",
39
+ long_description="""\
40
+ Fetch, Upload, Organize, and Distribute Software Packages # noqa: E501
41
+ """
42
+ )
@@ -40,8 +40,10 @@ describe 'ContentPackagesApi' do
40
40
  # @option opts [String] :artifact Artifact file representing the physical content
41
41
  # @option opts [File] :file An uploaded file that may be turned into the artifact of the content unit.
42
42
  # @option opts [String] :repository A URI of a repository the new content unit should be associated with.
43
+ # @option opts [String] :sha256 The SHA256 digest of this package.
43
44
  # @option opts [String] :summary A one-line summary of what the package does.
44
45
  # @option opts [String] :description A longer description of the package that can run to several paragraphs.
46
+ # @option opts [String] :description_content_type A string stating the markup syntax (if any) used in the distribution’s description, so that tools can intelligently render the description.
45
47
  # @option opts [String] :keywords Additional keywords to be used to assist searching for the package in a larger catalog.
46
48
  # @option opts [String] :home_page The URL for the package&#39;s home page.
47
49
  # @option opts [String] :download_url Legacy field denoting the URL from which this package can be downloaded.
@@ -52,6 +54,7 @@ describe 'ContentPackagesApi' do
52
54
  # @option opts [String] :license Text indicating the license covering the distribution
53
55
  # @option opts [String] :requires_python The Python version(s) that the distribution is guaranteed to be compatible with.
54
56
  # @option opts [String] :project_url A browsable URL for the project and a label for it, separated by a comma.
57
+ # @option opts [Object] :project_urls A dictionary of labels and URLs for the project.
55
58
  # @option opts [String] :platform A comma-separated list of platform specifications, summarizing the operating systems supported by the package.
56
59
  # @option opts [String] :supported_platform Field to specify the OS and CPU for which the binary package was compiled.
57
60
  # @option opts [Object] :requires_dist A JSON list containing names of some other distutils project required by this distribution.
@@ -58,7 +58,7 @@ describe 'DistributionsPypiApi' do
58
58
 
59
59
  # unit tests for list
60
60
  # List python distributions
61
- # Pulp Python Distributions are used to distribute Python Publications. Pulp Python Distributions should not be confused with \&quot;Python Distribution\&quot; as defined by the Python community. In Pulp usage, Python content is refered to as Python Package Content.
61
+ # Pulp Python Distributions are used to distribute Python content from Python Repositories or Python Publications. Pulp Python Distributions should not be confused with \&quot;Python Distribution\&quot; as defined by the Python community. In Pulp usage, Python content is referred to as Python Package Content.
62
62
  # @param [Hash] opts the optional parameters
63
63
  # @option opts [String] :base_path
64
64
  # @option opts [String] :base_path__contains Filter results where base_path contains value
@@ -97,7 +97,7 @@ describe 'DistributionsPypiApi' do
97
97
 
98
98
  # unit tests for read
99
99
  # Inspect a python distribution
100
- # Pulp Python Distributions are used to distribute Python Publications. Pulp Python Distributions should not be confused with \&quot;Python Distribution\&quot; as defined by the Python community. In Pulp usage, Python content is refered to as Python Package Content.
100
+ # Pulp Python Distributions are used to distribute Python content from Python Repositories or Python Publications. Pulp Python Distributions should not be confused with \&quot;Python Distribution\&quot; as defined by the Python community. In Pulp usage, Python content is referred to as Python Package Content.
101
101
  # @param python_python_distribution_href
102
102
  # @param [Hash] opts the optional parameters
103
103
  # @option opts [String] :fields A list of fields to include in the response.
@@ -34,7 +34,7 @@ describe 'PublicationsPypiApi' do
34
34
 
35
35
  # unit tests for create
36
36
  # Create a python publication
37
- # Trigger an asynchronous task to publish python content.
37
+ # Dispatches a publish task, which generates metadata that will be used by pip.
38
38
  # @param python_python_publication
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [AsyncOperationResponse]
@@ -0,0 +1,49 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for PulpPythonClient::PypiApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'PypiApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = PulpPythonClient::PypiApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of PypiApi' do
30
+ it 'should create an instance of PypiApi' do
31
+ expect(@api_instance).to be_instance_of(PulpPythonClient::PypiApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for read
36
+ # Get index summary
37
+ # Gets package summary stats of index.
38
+ # @param path
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :fields A list of fields to include in the response.
41
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
42
+ # @return [SummaryResponse]
43
+ describe 'read test' do
44
+ it 'should work' do
45
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
46
+ end
47
+ end
48
+
49
+ end
@@ -0,0 +1,50 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for PulpPythonClient::PypiLegacyApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'PypiLegacyApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = PulpPythonClient::PypiLegacyApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of PypiLegacyApi' do
30
+ it 'should create an instance of PypiLegacyApi' do
31
+ expect(@api_instance).to be_instance_of(PulpPythonClient::PypiLegacyApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for create
36
+ # Upload a package
37
+ # Upload package to the index. This is the endpoint that tools like Twine and Poetry use for their upload commands.
38
+ # @param path
39
+ # @param content A Python package release file to upload to the index.
40
+ # @param sha256_digest SHA256 of package to validate upload integrity.
41
+ # @param [Hash] opts the optional parameters
42
+ # @option opts [String] :action Defaults to &#x60;file_upload&#x60;, don&#39;t change it or request will fail!
43
+ # @return [PackageUploadTaskResponse]
44
+ describe 'create test' do
45
+ it 'should work' do
46
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
47
+ end
48
+ end
49
+
50
+ end
@@ -0,0 +1,50 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for PulpPythonClient::PypiMetadataApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'PypiMetadataApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = PulpPythonClient::PypiMetadataApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of PypiMetadataApi' do
30
+ it 'should create an instance of PypiMetadataApi' do
31
+ expect(@api_instance).to be_instance_of(PulpPythonClient::PypiMetadataApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for read
36
+ # Get package metadata
37
+ # Retrieves the package&#39;s core-metadata specified by https://packaging.python.org/specifications/core-metadata/. &#x60;meta&#x60; must be a path in form of &#x60;{package}/json/&#x60; or &#x60;{package}/{version}/json/&#x60;
38
+ # @param meta
39
+ # @param path
40
+ # @param [Hash] opts the optional parameters
41
+ # @option opts [String] :fields A list of fields to include in the response.
42
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
43
+ # @return [PackageMetadataResponse]
44
+ describe 'read test' do
45
+ it 'should work' do
46
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
47
+ end
48
+ end
49
+
50
+ end
@@ -0,0 +1,79 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for PulpPythonClient::PypiSimpleApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'PypiSimpleApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = PulpPythonClient::PypiSimpleApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of PypiSimpleApi' do
30
+ it 'should create an instance of PypiSimpleApi' do
31
+ expect(@api_instance).to be_instance_of(PulpPythonClient::PypiSimpleApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for create
36
+ # Upload a package
37
+ # Upload package to the index. This endpoint has the same functionality as the upload endpoint at the &#x60;/legacy&#x60; url of the index. This is provided for convenience for users who want a single index url for all their Python tools. (pip, twine, poetry, pipenv, ...)
38
+ # @param path
39
+ # @param content A Python package release file to upload to the index.
40
+ # @param sha256_digest SHA256 of package to validate upload integrity.
41
+ # @param [Hash] opts the optional parameters
42
+ # @option opts [String] :action Defaults to &#x60;file_upload&#x60;, don&#39;t change it or request will fail!
43
+ # @return [PackageUploadTaskResponse]
44
+ describe 'create test' do
45
+ it 'should work' do
46
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
47
+ end
48
+ end
49
+
50
+ # unit tests for read
51
+ # Get index simple page
52
+ # Gets the simple api html page for the index.
53
+ # @param path
54
+ # @param [Hash] opts the optional parameters
55
+ # @option opts [String] :fields A list of fields to include in the response.
56
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
57
+ # @return [nil]
58
+ describe 'read test' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
+ end
62
+ end
63
+
64
+ # unit tests for read_0
65
+ # Get package simple page
66
+ # Retrieves the simple api html page for a package.
67
+ # @param package
68
+ # @param path
69
+ # @param [Hash] opts the optional parameters
70
+ # @option opts [String] :fields A list of fields to include in the response.
71
+ # @option opts [String] :exclude_fields A list of fields to exclude from the response.
72
+ # @return [nil]
73
+ describe 'read_0 test' do
74
+ it 'should work' do
75
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
76
+ end
77
+ end
78
+
79
+ end
@@ -58,11 +58,11 @@ describe 'RemotesPythonApi' do
58
58
 
59
59
  # unit tests for from_bandersnatch
60
60
  # Create from Bandersnatch
61
- # Create a remote from a Bandersnatch config
61
+ # Takes the fields specified in the Bandersnatch config and creates a Python Remote from it.
62
62
  # @param config A Bandersnatch config that may be used to construct a Python Remote.
63
63
  # @param name A unique name for this remote
64
64
  # @param [Hash] opts the optional parameters
65
- # @option opts [PolicyEnum] :policy The policy to use when downloading content. The possible values include: &#39;immediate&#39;, &#39;on_demand&#39;, and &#39;cache_only&#39;. &#39;immediate&#39; is the default.
65
+ # @option opts [PolicyEnum] :policy The policy to use when downloading content. The possible values include: &#39;immediate&#39;, &#39;on_demand&#39;, and &#39;streamed&#39;. &#39;on_demand&#39; is the default.
66
66
  # @return [PythonPythonRemoteResponse]
67
67
  describe 'from_bandersnatch test' do
68
68
  it 'should work' do
@@ -34,7 +34,7 @@ describe 'RepositoriesPythonApi' do
34
34
 
35
35
  # unit tests for create
36
36
  # Create a python repository
37
- # A ViewSet for PythonRepository.
37
+ # PythonRepository represents a single Python repository, to which content can be synced, added, or removed.
38
38
  # @param python_python_repository
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [PythonPythonRepositoryResponse]
@@ -58,7 +58,7 @@ describe 'RepositoriesPythonApi' do
58
58
 
59
59
  # unit tests for list
60
60
  # List python repositorys
61
- # A ViewSet for PythonRepository.
61
+ # PythonRepository represents a single Python repository, to which content can be synced, added, or removed.
62
62
  # @param [Hash] opts the optional parameters
63
63
  # @option opts [Integer] :limit Number of results to return per page.
64
64
  # @option opts [String] :name
@@ -106,7 +106,7 @@ describe 'RepositoriesPythonApi' do
106
106
 
107
107
  # unit tests for read
108
108
  # Inspect a python repository
109
- # A ViewSet for PythonRepository.
109
+ # PythonRepository represents a single Python repository, to which content can be synced, added, or removed.
110
110
  # @param python_python_repository_href
111
111
  # @param [Hash] opts the optional parameters
112
112
  # @option opts [String] :fields A list of fields to include in the response.
@@ -120,7 +120,7 @@ describe 'RepositoriesPythonApi' do
120
120
 
121
121
  # unit tests for sync
122
122
  # Sync from remote
123
- # Trigger an asynchronous task to sync Python content.
123
+ # Trigger an asynchronous task to sync python content. The sync task will retrieve Python content from the specified &#x60;Remote&#x60; and update the specified &#x60;Respository&#x60;, creating a new &#x60;RepositoryVersion&#x60;.
124
124
  # @param python_python_repository_href
125
125
  # @param repository_sync_url
126
126
  # @param [Hash] opts the optional parameters