Skip to content

Commit e26f678

Browse files
committed
Update docs for adding/removing repository content
Reflects changes in pulp/pulp-cli#1223. Closes #927
1 parent 20d275c commit e26f678

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

CHANGES/927.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated docs for adding/removing repository content to handle duplicate filenames.

docs/user/guides/upload.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,18 @@ Each artifact in Pulp represents a file. They can be created during sync or crea
8989

9090
## Add content to a repository
9191

92-
Once there is a content unit, it can be added and removed from repositories using the add and remove commands.
92+
Once there is a content unit, it can be added to a repository using the `add` command.
93+
This command requires both the `filename` and `sha256` to ensure that a specific file can be identified,
94+
as Pulp may contain different content units with the same name.
9395

9496
=== "Run"
9597

9698
```bash
97-
# Add created PythonPackage content to repository
98-
pulp python repository content add --repository foo --filename "$PKG"
99+
# Matches shelf-reader-0.1.tar.gz
100+
SHA256="04cfd8bb4f843e35d51bfdef2035109bdea831b55a57c3e6a154d14be116398c"
101+
102+
# Add the created PythonPackage content to the repository
103+
pulp python repository content add --repository foo --filename "$PKG" --sha256 "$SHA256"
99104

100105
# After the task is complete, it gives us a new repository version
101106
pulp python repository version show --repository foo
@@ -129,3 +134,42 @@ Once there is a content unit, it can be added and removed from repositories usin
129134
}
130135
}
131136
```
137+
138+
## Remove content from a repository
139+
140+
A content unit can be removed from a repository using the `remove` command.
141+
This command requires the same options as the `add` command.
142+
143+
=== "Run"
144+
145+
```bash
146+
# Remove the PythonPackage content from the repository
147+
pulp python repository content remove --repository foo --filename "$PKG" --sha256 "$SHA256"
148+
149+
# After the task is complete, it gives us a new repository version
150+
pulp python repository version show --repository foo
151+
```
152+
153+
=== "Output"
154+
155+
```
156+
{
157+
"pulp_href": "/pulp/api/v3/repositories/python/python/0196ba2d-0374-77ef-a4e0-1b5ba5b1ed20/versions/2/",
158+
"prn": "prn:core.repositoryversion:01987e28-c79b-7033-9d5b-8a07cddcc24c",
159+
"pulp_created": "2025-08-06T06:54:18.526088Z",
160+
"pulp_last_updated": "2025-08-06T06:54:18.565594Z",
161+
"number": 2,
162+
"repository": "/pulp/api/v3/repositories/python/python/0196ba2d-0374-77ef-a4e0-1b5ba5b1ed20/",
163+
"base_version": "/pulp/api/v3/repositories/python/python/0196ba2d-0374-77ef-a4e0-1b5ba5b1ed20/versions/1/",
164+
"content_summary": {
165+
"added": {},
166+
"removed": {
167+
"python.python": {
168+
"count": 1,
169+
"href": "/pulp/api/v3/content/python/packages/?repository_version_removed=/pulp/api/v3/repositories/python/python/0196ba2d-0374-77ef-a4e0-1b5ba5b1ed20/versions/2/"
170+
}
171+
},
172+
"present": {}
173+
}
174+
}
175+
```

0 commit comments

Comments
 (0)