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)
@@ -36,8 +36,10 @@ opts = {
36
36
  artifact: 'artifact_example', # String | Artifact file representing the physical content
37
37
  file: File.new('/path/to/file'), # File | An uploaded file that may be turned into the artifact of the content unit.
38
38
  repository: 'repository_example', # String | A URI of a repository the new content unit should be associated with.
39
+ sha256: '', # String | The SHA256 digest of this package.
39
40
  summary: 'summary_example', # String | A one-line summary of what the package does.
40
41
  description: 'description_example', # String | A longer description of the package that can run to several paragraphs.
42
+ description_content_type: 'description_content_type_example', # String | A string stating the markup syntax (if any) used in the distribution’s description, so that tools can intelligently render the description.
41
43
  keywords: 'keywords_example', # String | Additional keywords to be used to assist searching for the package in a larger catalog.
42
44
  home_page: 'home_page_example', # String | The URL for the package's home page.
43
45
  download_url: 'download_url_example', # String | Legacy field denoting the URL from which this package can be downloaded.
@@ -48,6 +50,7 @@ opts = {
48
50
  license: 'license_example', # String | Text indicating the license covering the distribution
49
51
  requires_python: 'requires_python_example', # String | The Python version(s) that the distribution is guaranteed to be compatible with.
50
52
  project_url: 'project_url_example', # String | A browsable URL for the project and a label for it, separated by a comma.
53
+ project_urls: nil, # Object | A dictionary of labels and URLs for the project.
51
54
  platform: 'platform_example', # String | A comma-separated list of platform specifications, summarizing the operating systems supported by the package.
52
55
  supported_platform: 'supported_platform_example', # String | Field to specify the OS and CPU for which the binary package was compiled.
53
56
  requires_dist: nil, # Object | A JSON list containing names of some other distutils project required by this distribution.
@@ -75,8 +78,10 @@ Name | Type | Description | Notes
75
78
  **artifact** | **String**| Artifact file representing the physical content | [optional]
76
79
  **file** | **File**| An uploaded file that may be turned into the artifact of the content unit. | [optional]
77
80
  **repository** | **String**| A URI of a repository the new content unit should be associated with. | [optional]
81
+ **sha256** | **String**| The SHA256 digest of this package. | [optional] [default to &#39;&#39;]
78
82
  **summary** | **String**| A one-line summary of what the package does. | [optional]
79
83
  **description** | **String**| A longer description of the package that can run to several paragraphs. | [optional]
84
+ **description_content_type** | **String**| A string stating the markup syntax (if any) used in the distribution’s description, so that tools can intelligently render the description. | [optional]
80
85
  **keywords** | **String**| Additional keywords to be used to assist searching for the package in a larger catalog. | [optional]
81
86
  **home_page** | **String**| The URL for the package&#39;s home page. | [optional]
82
87
  **download_url** | **String**| Legacy field denoting the URL from which this package can be downloaded. | [optional]
@@ -87,6 +92,7 @@ Name | Type | Description | Notes
87
92
  **license** | **String**| Text indicating the license covering the distribution | [optional]
88
93
  **requires_python** | **String**| The Python version(s) that the distribution is guaranteed to be compatible with. | [optional]
89
94
  **project_url** | **String**| A browsable URL for the project and a label for it, separated by a comma. | [optional]
95
+ **project_urls** | [**Object**](Object.md)| A dictionary of labels and URLs for the project. | [optional]
90
96
  **platform** | **String**| A comma-separated list of platform specifications, summarizing the operating systems supported by the package. | [optional]
91
97
  **supported_platform** | **String**| Field to specify the OS and CPU for which the binary package was compiled. | [optional]
92
98
  **requires_dist** | [**Object**](Object.md)| A JSON list containing names of some other distutils project required by this distribution. | [optional]
@@ -125,7 +125,7 @@ Name | Type | Description | Notes
125
125
 
126
126
  List python distributions
127
127
 
128
- Pulp Python Distributions are used to distribute Python Publications. Pulp Python Distributions should not be confused with \"Python Distribution\" as defined by the Python community. In Pulp usage, Python content is refered to as Python Package Content.
128
+ Pulp Python Distributions are used to distribute Python content from Python Repositories or Python Publications. Pulp Python Distributions should not be confused with \"Python Distribution\" as defined by the Python community. In Pulp usage, Python content is referred to as Python Package Content.
129
129
 
130
130
  ### Example
131
131
 
@@ -263,7 +263,7 @@ Name | Type | Description | Notes
263
263
 
264
264
  Inspect a python distribution
265
265
 
266
- Pulp Python Distributions are used to distribute Python Publications. Pulp Python Distributions should not be confused with \"Python Distribution\" as defined by the Python community. In Pulp usage, Python content is refered to as Python Package Content.
266
+ Pulp Python Distributions are used to distribute Python content from Python Repositories or Python Publications. Pulp Python Distributions should not be confused with \"Python Distribution\" as defined by the Python community. In Pulp usage, Python content is referred to as Python Package Content.
267
267
 
268
268
  ### Example
269
269
 
@@ -0,0 +1,23 @@
1
+ # PulpPythonClient::PackageMetadataResponse
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **last_serial** | **Integer** | Cache value from last PyPI sync |
8
+ **info** | [**Object**](.md) | Core metadata of the package |
9
+ **releases** | [**Object**](.md) | List of all the releases of the package |
10
+ **urls** | [**Object**](.md) | |
11
+
12
+ ## Code Sample
13
+
14
+ ```ruby
15
+ require 'PulpPythonClient'
16
+
17
+ instance = PulpPythonClient::PackageMetadataResponse.new(last_serial: null,
18
+ info: null,
19
+ releases: null,
20
+ urls: null)
21
+ ```
22
+
23
+
@@ -0,0 +1,21 @@
1
+ # PulpPythonClient::PackageUpload
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **content** | **File** | A Python package release file to upload to the index. |
8
+ **action** | **String** | Defaults to &#x60;file_upload&#x60;, don&#39;t change it or request will fail! | [optional] [default to &#39;file_upload&#39;]
9
+ **sha256_digest** | **String** | SHA256 of package to validate upload integrity. |
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'PulpPythonClient'
15
+
16
+ instance = PulpPythonClient::PackageUpload.new(content: null,
17
+ action: null,
18
+ sha256_digest: null)
19
+ ```
20
+
21
+
@@ -0,0 +1,21 @@
1
+ # PulpPythonClient::PackageUploadTaskResponse
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **session** | **String** | |
8
+ **task** | **String** | |
9
+ **task_start_time** | **DateTime** | |
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'PulpPythonClient'
15
+
16
+ instance = PulpPythonClient::PackageUploadTaskResponse.new(session: null,
17
+ task: null,
18
+ task_start_time: null)
19
+ ```
20
+
21
+
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
10
10
  **name** | **String** | A unique name. Ex, &#x60;rawhide&#x60; and &#x60;stable&#x60;. | [optional]
11
11
  **repository** | **String** | The latest RepositoryVersion for this Repository will be served. | [optional]
12
12
  **publication** | **String** | Publication to be served | [optional]
13
+ **allow_uploads** | **Boolean** | Allow packages to be uploaded to this index. | [optional] [default to true]
13
14
 
14
15
  ## Code Sample
15
16
 
@@ -21,7 +22,8 @@ instance = PulpPythonClient::PatchedpythonPythonDistribution.new(base_path: null
21
22
  pulp_labels: null,
22
23
  name: null,
23
24
  repository: null,
24
- publication: null)
25
+ publication: null,
26
+ allow_uploads: null)
25
27
  ```
26
28
 
27
29
 
@@ -17,7 +17,7 @@ Name | Type | Description | Notes
17
17
  **password** | **String** | The password to be used for authentication when syncing. | [optional]
18
18
  **pulp_labels** | [**Object**](.md) | | [optional]
19
19
  **download_concurrency** | **Integer** | Total number of simultaneous connections. | [optional]
20
- **policy** | [**PolicyEnum**](PolicyEnum.md) | 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. | [optional]
20
+ **policy** | [**PolicyEnum**](PolicyEnum.md) | 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. | [optional]
21
21
  **total_timeout** | **Float** | aiohttp.ClientTimeout.total (q.v.) for download-connections. | [optional]
22
22
  **connect_timeout** | **Float** | aiohttp.ClientTimeout.connect (q.v.) for download-connections. | [optional]
23
23
  **sock_connect_timeout** | **Float** | aiohttp.ClientTimeout.sock_connect (q.v.) for download-connections. | [optional]
@@ -17,7 +17,7 @@ Method | HTTP request | Description
17
17
 
18
18
  Create a python publication
19
19
 
20
- Trigger an asynchronous task to publish python content.
20
+ Dispatches a publish task, which generates metadata that will be used by pip.
21
21
 
22
22
  ### Example
23
23
 
data/docs/PypiApi.md ADDED
@@ -0,0 +1,62 @@
1
+ # PulpPythonClient::PypiApi
2
+
3
+ All URIs are relative to *http://pulp*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**read**](PypiApi.md#read) | **GET** /pypi/{path}/ | Get index summary
8
+
9
+
10
+
11
+ ## read
12
+
13
+ > SummaryResponse read(path, opts)
14
+
15
+ Get index summary
16
+
17
+ Gets package summary stats of index.
18
+
19
+ ### Example
20
+
21
+ ```ruby
22
+ # load the gem
23
+ require 'pulp_python_client'
24
+
25
+ api_instance = PulpPythonClient::PypiApi.new
26
+ path = 'path_example' # String |
27
+ opts = {
28
+ fields: 'fields_example', # String | A list of fields to include in the response.
29
+ exclude_fields: 'exclude_fields_example' # String | A list of fields to exclude from the response.
30
+ }
31
+
32
+ begin
33
+ #Get index summary
34
+ result = api_instance.read(path, opts)
35
+ p result
36
+ rescue PulpPythonClient::ApiError => e
37
+ puts "Exception when calling PypiApi->read: #{e}"
38
+ end
39
+ ```
40
+
41
+ ### Parameters
42
+
43
+
44
+ Name | Type | Description | Notes
45
+ ------------- | ------------- | ------------- | -------------
46
+ **path** | **String**| |
47
+ **fields** | **String**| A list of fields to include in the response. | [optional]
48
+ **exclude_fields** | **String**| A list of fields to exclude from the response. | [optional]
49
+
50
+ ### Return type
51
+
52
+ [**SummaryResponse**](SummaryResponse.md)
53
+
54
+ ### Authorization
55
+
56
+ No authorization required
57
+
58
+ ### HTTP request headers
59
+
60
+ - **Content-Type**: Not defined
61
+ - **Accept**: application/json
62
+
@@ -0,0 +1,70 @@
1
+ # PulpPythonClient::PypiLegacyApi
2
+
3
+ All URIs are relative to *http://pulp*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**create**](PypiLegacyApi.md#create) | **POST** /pypi/{path}/legacy/ | Upload a package
8
+
9
+
10
+
11
+ ## create
12
+
13
+ > PackageUploadTaskResponse create(path, content, sha256_digest, opts)
14
+
15
+ Upload a package
16
+
17
+ Upload package to the index. This is the endpoint that tools like Twine and Poetry use for their upload commands.
18
+
19
+ ### Example
20
+
21
+ ```ruby
22
+ # load the gem
23
+ require 'pulp_python_client'
24
+ # setup authorization
25
+ PulpPythonClient.configure do |config|
26
+ # Configure HTTP basic authorization: basicAuth
27
+ config.username = 'YOUR USERNAME'
28
+ config.password = 'YOUR PASSWORD'
29
+ end
30
+
31
+ api_instance = PulpPythonClient::PypiLegacyApi.new
32
+ path = 'path_example' # String |
33
+ content = File.new('/path/to/file') # File | A Python package release file to upload to the index.
34
+ sha256_digest = 'sha256_digest_example' # String | SHA256 of package to validate upload integrity.
35
+ opts = {
36
+ action: 'file_upload' # String | Defaults to `file_upload`, don't change it or request will fail!
37
+ }
38
+
39
+ begin
40
+ #Upload a package
41
+ result = api_instance.create(path, content, sha256_digest, opts)
42
+ p result
43
+ rescue PulpPythonClient::ApiError => e
44
+ puts "Exception when calling PypiLegacyApi->create: #{e}"
45
+ end
46
+ ```
47
+
48
+ ### Parameters
49
+
50
+
51
+ Name | Type | Description | Notes
52
+ ------------- | ------------- | ------------- | -------------
53
+ **path** | **String**| |
54
+ **content** | **File**| A Python package release file to upload to the index. |
55
+ **sha256_digest** | **String**| SHA256 of package to validate upload integrity. |
56
+ **action** | **String**| Defaults to &#x60;file_upload&#x60;, don&#39;t change it or request will fail! | [optional] [default to &#39;file_upload&#39;]
57
+
58
+ ### Return type
59
+
60
+ [**PackageUploadTaskResponse**](PackageUploadTaskResponse.md)
61
+
62
+ ### Authorization
63
+
64
+ [basicAuth](../README.md#basicAuth)
65
+
66
+ ### HTTP request headers
67
+
68
+ - **Content-Type**: multipart/form-data, application/x-www-form-urlencoded
69
+ - **Accept**: application/json
70
+
@@ -0,0 +1,64 @@
1
+ # PulpPythonClient::PypiMetadataApi
2
+
3
+ All URIs are relative to *http://pulp*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**read**](PypiMetadataApi.md#read) | **GET** /pypi/{path}/pypi/{meta}/ | Get package metadata
8
+
9
+
10
+
11
+ ## read
12
+
13
+ > PackageMetadataResponse read(meta, path, opts)
14
+
15
+ Get package metadata
16
+
17
+ Retrieves the package's core-metadata specified by https://packaging.python.org/specifications/core-metadata/. `meta` must be a path in form of `{package}/json/` or `{package}/{version}/json/`
18
+
19
+ ### Example
20
+
21
+ ```ruby
22
+ # load the gem
23
+ require 'pulp_python_client'
24
+
25
+ api_instance = PulpPythonClient::PypiMetadataApi.new
26
+ meta = 'meta_example' # String |
27
+ path = 'path_example' # String |
28
+ opts = {
29
+ fields: 'fields_example', # String | A list of fields to include in the response.
30
+ exclude_fields: 'exclude_fields_example' # String | A list of fields to exclude from the response.
31
+ }
32
+
33
+ begin
34
+ #Get package metadata
35
+ result = api_instance.read(meta, path, opts)
36
+ p result
37
+ rescue PulpPythonClient::ApiError => e
38
+ puts "Exception when calling PypiMetadataApi->read: #{e}"
39
+ end
40
+ ```
41
+
42
+ ### Parameters
43
+
44
+
45
+ Name | Type | Description | Notes
46
+ ------------- | ------------- | ------------- | -------------
47
+ **meta** | **String**| |
48
+ **path** | **String**| |
49
+ **fields** | **String**| A list of fields to include in the response. | [optional]
50
+ **exclude_fields** | **String**| A list of fields to exclude from the response. | [optional]
51
+
52
+ ### Return type
53
+
54
+ [**PackageMetadataResponse**](PackageMetadataResponse.md)
55
+
56
+ ### Authorization
57
+
58
+ No authorization required
59
+
60
+ ### HTTP request headers
61
+
62
+ - **Content-Type**: Not defined
63
+ - **Accept**: application/json
64
+