This release is a pre-release and may not be stable for production use.
pulp_file Plugin
This is the pulp_file Plugin for Pulp Project 3.0+. This plugin replaces the ISO support in the pulp_rpm plugin for Pulp 2. This plugin uses the ChangeSet API to add and remove content from a repository.
All REST API examples bellow use httpie to perform the requests. The httpie commands below assume that the user executing the commands has a .netrc file in the home directory. The .netrc should have the following configuration:
machine localhost
login admin
password admin
If you configured the admin user with a different password, adjust the configuration accordingly. If you prefer to specify the username and password with each request, please see httpie documentation on how to do that.
This documentation makes use of the jq library to parse the json received from requests, in order to get the unique urls generated when objects are created. To follow this documentation as-is please install the jq library with:
$ sudo dnf install jq
Install pulpcore
Follow the installation instructions provided with pulpcore.
Install pulp-file from source
sudo -u pulp -i
source ~/pulpvenv/bin/activate
git clone https://github.com/pulp/pulp_file.git
cd pulp_file
python setup.py develop
pulp-manager makemigrations pulp_file
pulp-manager migrate pulp_file
django-admin runserver
sudo systemctl restart pulp_resource_manager
sudo systemctl restart pulp_worker@1
sudo systemctl restart pulp_worker@2
Install pulp-file From PyPI
sudo -u pulp -i
source ~/pulpvenv/bin/activate
pip install pulp-file
pulp-manager makemigrations pulp_file
pulp-manager migrate pulp_file
django-admin runserver
sudo systemctl restart pulp_resource_manager
sudo systemctl restart pulp_worker@1
sudo systemctl restart pulp_worker@2
Create a repository foo
$ http POST http://localhost:8000/pulp/api/v3/repositories/ name=foo
{
"_href": "http://localhost:8000/pulp/api/v3/repositories/8d7cd67a-9421-461f-9106-2df8e4854f5f/",
...
}
$ export REPO_HREF=$(http :8000/pulp/api/v3/repositories/ | jq -r '.results[] | select(.name == "foo") | ._href')
Create a new remote bar
$ http POST http://localhost:8000/pulp/api/v3/remotes/file/ name='bar' url='https://repos.fedorapeople.org/pulp/pulp/demo_repos/test_file_repo/PULP_MANIFEST'
{
"_href": "http://localhost:8000/pulp/api/v3/remotes/file/13ac2d63-7b7b-401d-b71b-9a5af05aab3c/",
...
}
$ export REMOTE_HREF=$(http :8000/pulp/api/v3/remotes/file/ | jq -r '.results[] | select(.name == "bar") | ._href')
Sync repository foo using remote bar
$ http POST $REMOTE_HREF'sync/' repository=$REPO_HREF
Look at the new Repository Version created
$ http GET $REPO_HREF'versions/1/'
{
"_added_href": "http://localhost:8000/pulp/api/v3/repositories/b787e6ad-d6b6-4e3d-ab12-73eba19b42fb/versions/1/added_content/",
"_content_href": "http://localhost:8000/pulp/api/v3/repositories/b787e6ad-d6b6-4e3d-ab12-73eba19b42fb/versions/1/content/",
"_href": "http://localhost:8000/pulp/api/v3/repositories/b787e6ad-d6b6-4e3d-ab12-73eba19b42fb/versions/1/",
"_removed_href": "http://localhost:8000/pulp/api/v3/repositories/b787e6ad-d6b6-4e3d-ab12-73eba19b42fb/versions/1/removed_content/",
"content_summary": {
"file": 3
},
"created": "2018-02-23T20:29:54.499055Z",
"number": 1
}
Upload foo.tar.gz to Pulp
Create an Artifact by uploading the file to Pulp.
$ http --form POST http://localhost:8000/pulp/api/v3/artifacts/ file@./foo.tar.gz
{
"_href": "http://localhost:8000/pulp/api/v3/artifacts/7d39e3f6-535a-4b6e-81e9-c83aa56aa19e/",
...
}
Create file content from an Artifact
Create a content unit and point it to your artifact
$ http POST http://localhost:8000/pulp/api/v3/content/file/ relative_path=foo.tar.gz artifact="http://localhost:8000/pulp/api/v3/artifacts/7d39e3f6-535a-4b6e-81e9-c83aa56aa19e/"
{
"_href": "http://localhost:8000/pulp/api/v3/content/file/a9578a5f-c59f-4920-9497-8d1699c112ff/",
"artifact": "http://localhost:8000/pulp/api/v3/artifacts/7d39e3f6-535a-4b6e-81e9-c83aa56aa19e/",
"relative_path": "foo.tar.gz",
"type": "file"
}
$ export CONTENT_HREF=$(http :8000/pulp/api/v3/content/file/ | jq -r '.results[] | select(.relative_path == "foo.tar.gz") | ._href')
Add content to repository foo
$ http POST $REPO_HREF'versions/' add_content_units:="[\"$CONTENT_HREF\"]"
Create a file Publisher
$ http POST http://localhost:8000/pulp/api/v3/publishers/file/ name=bar
{
"_href": "http://localhost:8000/pulp/api/v3/publishers/file/fd4cbecd-6c6a-4197-9cbe-4e45b0516309/",
...
}
$ export PUBLISHER_HREF=$(http :8000/pulp/api/v3/publishers/file/ | jq -r '.results[] | select(.name == "bar") | ._href')
Use the bar Publisher to create a Publication
$ http POST $PUBLISHER_HREF'publish/' repository=$REPO_HREF
[
{
"_href": "http://localhost:8000/pulp/api/v3/tasks/fd4cbecd-6c6a-4197-9cbe-4e45b0516309/",
"task_id": "fd4cbecd-6c6a-4197-9cbe-4e45b0516309"
}
]
$ export PUBLICATION_HREF=$(http :8000/pulp/api/v3/publications/ | jq -r --arg PUBLISHER_HREF "$PUBLISHER_HREF" '.results[] | select(.publisher==$PUBLISHER_HREF) | ._href')
Create a Distribution for the Publication
$ http POST http://localhost:8000/pulp/api/v3/distributions/ name='baz' base_path='foo' publication=$PUBLICATION_HREF
{
"_href": "http://localhost:8000/pulp/api/v3/distributions/9b29f1b2-6726-40a2-988a-273d3f009a41/",
...
}
Download test.iso from Pulp
$ http GET http://localhost:8000/pulp/content/foo/test.iso
Metadata
Release files for pulp-file 0.0.1b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pulp-file-0.0.1b2.tar.gz | 18.8 kB | Without provenance | Details for pulp-file-0.0.1b2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pulp_file-0.0.1b2-py3-none-any.whl | Python 3 | none | any | Details for pulp_file-0.0.1b2-py3-none-any.whl |
Total release size: 34.1 kB
Release files / pulp-file-0.0.1b2.tar.gz
| Download URL | pulp-file-0.0.1b2.tar.gz |
|---|---|
| Size | 18.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12b3d399acb6048cb68e7cccf068cf6095a21db97f3b787cc9d5570a6fef202b
|
|
BLAKE2b-256 checksum How to use checksums |
d7a00007ea6923f7f817829974092591181c7a6a1af9e121e389af8192259035
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pulp_file-0.0.1b2-py3-none-any.whl
| Download URL | pulp_file-0.0.1b2-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f18f57b9c3c63026c3606ca84dfb7b4f84bb39058fe754221e3d72206cf72e1
|
|
BLAKE2b-256 checksum How to use checksums |
d675d12ffe2e17d0a952fc5a63c338576649896dea9aa54244cab82353d7e434
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pulp-file 0.0.1b2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.