33Users can populate their repositories with content from an external source like PyPI by syncing
44their repository.
55
6-
76## Create a Repository
87
98=== "Run"
@@ -17,21 +16,23 @@ their repository.
1716
1817 ```
1918 {
20- "pulp_href": "/pulp/api/v3/repositories/python/python/8fbb24ee-dc91-44f4-a6ee-beec60aa542d/",
21- "pulp_created": "2021-03-09T04:11:54.347921Z",
22- "versions_href": "/pulp/api/v3/repositories/python/python/8fbb24ee-dc91-44f4-a6ee-beec60aa542d/versions/",
23- "pulp_labels": {},
24- "latest_version_href": "/pulp/api/v3/repositories/python/python/8fbb24ee-dc91-44f4-a6ee-beec60aa542d/versions/0/",
25- "name": "foo",
26- "description": null,
27- "remote": null
28- }
19+ "pulp_href": "/pulp/api/v3/repositories/python/python/0196ba2a-f353-736a-854c-2d415389a509/",
20+ "prn": "prn:python.pythonrepository:0196ba2a-f353-736a-854c-2d415389a509",
21+ "pulp_created": "2025-05-10T12:28:19.156941Z",
22+ "pulp_last_updated": "2025-05-10T12:28:19.169190Z",
23+ "versions_href": "/pulp/api/v3/repositories/python/python/0196ba2a-f353-736a-854c-2d415389a509/versions/",
24+ "pulp_labels": {},
25+ "latest_version_href": "/pulp/api/v3/repositories/python/python/0196ba2a-f353-736a-854c-2d415389a509/versions/0/",
26+ "name": "foo",
27+ "description": null,
28+ "retain_repo_versions": null,
29+ "remote": null,
30+ "autopublish": false
31+ }
2932 ```
3033
3134Reference: [ Python Repository Usage] ( site:pulp_python/restapi/#tag/Repositories:-Python )
3235
33-
34-
3536## Create a Remote
3637
3738Creating a remote object informs Pulp about an external content source. In this case, we will be
@@ -49,29 +50,56 @@ itself, a fixture, or even an instance of Pulp 2.
4950
5051 ```
5152 {
52- "pulp_href": "/pulp/api/v3/remotes/python/python/a9bb3a02-c7d2-4b2e-9b66-050a6c9b7cb3/",
53- "pulp_created": "2021-03-09T04:14:02.646835Z",
53+ "pulp_href": "/pulp/api/v3/remotes/python/python/0196ba2b-1461-7d0d-99f6-5f75610abf71/",
54+ "prn": "prn:python.pythonremote:0196ba2b-1461-7d0d-99f6-5f75610abf71",
55+ "pulp_created": "2025-05-10T12:28:27.617672Z",
56+ "pulp_last_updated": "2025-05-10T12:28:27.617697Z",
5457 "name": "bar",
5558 "url": "https://pypi.org/",
5659 "ca_cert": null,
5760 "client_cert": null,
5861 "tls_validation": true,
5962 "proxy_url": null,
6063 "pulp_labels": {},
61- "pulp_last_updated ": "2021-03-09T04:14:02.646845Z" ,
62- "download_concurrency ": 10 ,
64+ "download_concurrency ": null ,
65+ "max_retries ": null ,
6366 "policy": "on_demand",
6467 "total_timeout": null,
6568 "connect_timeout": null,
6669 "sock_connect_timeout": null,
6770 "sock_read_timeout": null,
6871 "headers": null,
6972 "rate_limit": null,
73+ "hidden_fields": [
74+ {
75+ "name": "client_key",
76+ "is_set": false
77+ },
78+ {
79+ "name": "proxy_username",
80+ "is_set": false
81+ },
82+ {
83+ "name": "proxy_password",
84+ "is_set": false
85+ },
86+ {
87+ "name": "username",
88+ "is_set": false
89+ },
90+ {
91+ "name": "password",
92+ "is_set": false
93+ }
94+ ],
7095 "includes": [
7196 "shelf-reader"
7297 ],
7398 "excludes": [],
7499 "prereleases": true,
100+ "package_types": [],
101+ "keep_latest_packages": 0,
102+ "exclude_platforms": []
75103 }
76104 ```
77105
@@ -80,7 +108,7 @@ Reference: [Python Remote Usage](site:pulp_python/restapi/#tag/Remotes:-Python)
80108## A More Complex Remote
81109
82110If only the name of a project is specified, every distribution of every version of that project
83- will be synced. You can use the version_specifier field to ensure only distributions you care
111+ will be synced. You can use the version specifier field to ensure only distributions you care
84112about will be synced:
85113
86114``` bash
@@ -115,22 +143,22 @@ You can also filter packages by their type, platform and amount synced through t
115143"exclude_platforms", and "keep_latest_packages" fields respectively, like so:
116144
117145``` bash
146+ # Sync only sdist and bdist_wheel package types, exclude any packages built
147+ # for windows and keep the five latest versions
118148pulp python remote create \
119149 --name ' complex-filters' \
120150 --url ' https://pypi.org/' \
121151 --includes ' ["django"]' \
122- --package-types ' ["sdist", "bdist-wheel "]' # only sync sdist and bdist-wheel package types \
123- --exclude-platforms ' ["windows"]' # exclude any packages built for windows \
124- --keep-latest-packages 5 # keep the five latest versions
152+ --package-types ' ["sdist", "bdist_wheel "]' \
153+ --exclude-platforms ' ["windows"]' \
154+ --keep-latest-packages 5
125155```
126156
127157Reference: [ Python Remote Usage] ( site:pulp_python/restapi/#tag/Remotes:-Python )
128158
129-
130-
131159### Creating a remote to sync all of PyPI
132160
133- A remote can be setup to sync all of PyPI by not specifying any included packages like so:
161+ A remote can be set up to sync all of PyPI by not specifying any included packages, like so:
134162
135163``` bash
136164pulp python remote create \
@@ -173,22 +201,25 @@ sync with. You are telling pulp to fetch content from the remote and add to the
173201
174202 ```
175203 {
176- "pulp_href": "/pulp/api/v3/repositories/python/python/8fbb24ee-dc91-44f4-a6ee-beec60aa542d/versions/1/",
177- "pulp_created": "2021-03-09T04:20:21.896132Z",
204+ "pulp_href": "/pulp/api/v3/repositories/python/python/0196ba2a-f353-736a-854c-2d415389a509/versions/1/",
205+ "prn": "prn:core.repositoryversion:0196ba2b-655c-7745-b10f-bdde15a941c6",
206+ "pulp_created": "2025-05-10T12:28:48.349938Z",
207+ "pulp_last_updated": "2025-05-10T12:28:49.031497Z",
178208 "number": 1,
209+ "repository": "/pulp/api/v3/repositories/python/python/0196ba2a-f353-736a-854c-2d415389a509/",
179210 "base_version": null,
180211 "content_summary": {
181212 "added": {
182213 "python.python": {
183214 "count": 2,
184- "href": "/pulp/api/v3/content/python/packages/?repository_version_added=/pulp/api/v3/repositories/python/python/8fbb24ee-dc91-44f4-a6ee-beec60aa542d /versions/1/"
215+ "href": "/pulp/api/v3/content/python/packages/?repository_version_added=/pulp/api/v3/repositories/python/python/0196ba2a-f353-736a-854c-2d415389a509 /versions/1/"
185216 }
186217 },
187218 "removed": {},
188219 "present": {
189220 "python.python": {
190221 "count": 2,
191- "href": "/pulp/api/v3/content/python/packages/?repository_version=/pulp/api/v3/repositories/python/python/8fbb24ee-dc91-44f4-a6ee-beec60aa542d /versions/1/"
222+ "href": "/pulp/api/v3/content/python/packages/?repository_version=/pulp/api/v3/repositories/python/python/0196ba2a-f353-736a-854c-2d415389a509 /versions/1/"
192223 }
193224 }
194225 }
0 commit comments