### Setup Pulp Development Environment Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/tutorials/quickstart.md Clone necessary repositories, install the oci-env client, configure the environment, build images, and start the Pulp service. Ensure pulpcore is added to DEV_SOURCE_PATH. ```bash # 1. clone required repos to the same basedir git clone https://github.com/pulp/oci_env.git git clone https://github.com/pulp/pulpcore.git git clone https://github.com/pulp/pulp-openapi-generator.git # required for 'generate-client' below # 1.1 add more repos as necessary to the same basedir git clone https://github.com/pulp/pulp_rpm.git # 2. install oci-env client cd oci_env pip3 install -e client # 3. use minimal compose.env # At least add pulpcore to DEV_SOURCE_PATH like this: DEV_SOURCE_PATH=pulpcore cp compose.env.example compose.env # 4. build the images and start the service oci-env compose build oci-env compose up # 5. do basic setup oci-env generate-client -i oci-env generate-client -i pulp_file ``` -------------------------------- ### Install pulp-docs with pip Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/tutorials/quickstart-docs.md Installs the pulp-docs tool using pip for user-level installation. ```bash pip install --user git+https://github.com/pulp/pulp-docs ``` -------------------------------- ### Install Documentation Requirements Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/learn/other/documentation.md Install the necessary Python packages for building documentation within your virtual environment. ```bash pip install -r doc_requirements.txt ``` -------------------------------- ### Python Docstring Example Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/reference/code-style-guide.md This example demonstrates the standard format for Python docstrings, including a summary line, detailed explanation, Args, and Returns sections, adhering to Google's style guide for auto-documentation. ```python def example_function(): """ The first section is a summary, which should be restricted to a single line. More detailed information follows the summary after a blank line. This section can be as many lines as necessary. Args: arg1 (str): The argument is visible, and its type is clearly indicated. much_longer_argument (str): Types and descriptions are not aligned. Returns: bool: The return value and type is very clearly visible. """ ``` -------------------------------- ### Install Required Python Modules Source: https://github.com/pulp/pulpcore/blob/main/docs/admin/guides/auth/keycloak.md Install the core libraries for python-social-auth integration. ```bash social-auth-core social-auth-app-Django ``` -------------------------------- ### Install pulp-docs with pip and venv Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/tutorials/quickstart-docs.md Sets up a Python virtual environment and installs pulp-docs within it. ```bash python -m venv venv source venv/bin/activate pip install git+https://github.com/pulp/pulp-docs ``` -------------------------------- ### Full Chunked Upload Example Source: https://github.com/pulp/pulpcore/blob/main/docs/user/guides/upload-publish.md An end-to-end example demonstrating how to download a large file, split it into chunks, upload the chunks, and commit the final artifact using curl and httpie. ```bash curl -O https://fixtures.pulpproject.org/file-large/1.iso split --bytes=6M 1.iso chunk export UPLOAD=$(http POST :24817/pulp/api/v3/uploads/ size=`ls -l 1.iso | cut -d ' ' -f5` | jq -r '.pulp_href') http --form PUT :24817$UPLOAD file@./chunkab 'Content-Range:bytes 6291456-10485759/*' http --form PUT :24817$UPLOAD file@./chunkaa 'Content-Range:bytes 0-6291455/*' http POST :24817${UPLOAD}commit/ sha256=`sha256sum 1.iso | cut -d ' ' -f1` ``` -------------------------------- ### Serve local documentation preview Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/tutorials/quickstart-docs.md Starts a local web server to preview documentation changes made with pulp-docs. ```bash pulp-docs serve ``` -------------------------------- ### Create FileSystem Domain Source: https://github.com/pulp/pulpcore/blob/main/docs/user/guides/create-domains.md Example of creating a domain using the FileSystem storage class. Ensure the MEDIA_ROOT path is correctly configured. ```bash pulp domain create \ --name foo \ --description foo \ --storage-class pulpcore.app.models.storage.FileSystem \ --storage-settings "{\"MEDIA_ROOT\": \"/var/lib/pulp/media/\"}" ``` -------------------------------- ### Install pulp-docs with pipx Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/tutorials/quickstart-docs.md Installs the pulp-docs tool and its dependencies using pipx for managing Python applications. ```bash pipx install git+https://github.com/pulp/pulp-docs --include-deps ``` -------------------------------- ### Distribution Update Task Output Source: https://github.com/pulp/pulpcore/blob/main/pulp_certguard/docs/user/tutorials/quickstart.md Example console output indicating the successful start of a background task to update the distribution with a content guard. ```console Started background task /pulp/api/v3/tasks/018dbdd6-ec6e-7cd9-a49d-1c1a2e55725f/ Done. ``` -------------------------------- ### Example modelresource.py for pulp_file Plugin Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/learn/subclassing/import-export.md This example demonstrates a typical `modelresource.py` for the `pulp_file` plugin, including `FileContentResource` subclassing `BaseContentResource` and defining `IMPORT_ORDER`. ```python from pulpcore.plugin.importexport import BaseContentResource from pulp_file.app.models import FileContent class FileContentResource(BaseContentResource): """ Resource for import/export of file_filecontent entities """ def set_up_queryset(self): """ :return: FileContents specific to a specified repo-version. """ return FileContent.objects.filter(pk__in=self.repo_version.content) class Meta: model = FileContent IMPORT_ORDER = [FileContentResource] ``` -------------------------------- ### Basic Authentication Header Example Source: https://github.com/pulp/pulpcore/blob/main/docs/admin/guides/auth/basic.md This is an example of a Basic Authentication header for the username 'admin' and password 'password'. ```http Authorization: Basic YWRtaW46cGFzc3dvcmQ= ``` -------------------------------- ### Custom Downloader Example Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/reference/code-api/plugins-api/download.md Example of a custom downloader that catches specific error codes like 404 and attempts to use an alternative mirror. This requires subclassing a downloader and overriding the run() method. ```python class MirrorListDownloader(BaseDownloader): async def run(self): try: await super().run() except HttpError as e: if e.status_code == 404: # Try another mirror pass else: raise ``` -------------------------------- ### Create S3 Domain Source: https://github.com/pulp/pulpcore/blob/main/docs/user/guides/create-domains.md Example of creating a domain using the S3Boto3Storage class. Provide necessary AWS credentials and bucket details. ```bash pulp domain create \ --name mydomain \ --storage-class storages.backends.s3boto3.S3Boto3Storage \ --storage-settings "{\"access_key\": \"AcVDppUlVkA6\", \"secret_key\": \"SFviCmMfRT6N\", \"bucket_name\": \"my-unique-bucket-name\", \"region_name\": \"us-east-1\", \"default_acl\": \"private\"}" ``` -------------------------------- ### Create Repository in a Specific Domain Source: https://github.com/pulp/pulpcore/blob/main/docs/user/guides/create-domains.md Example of creating a File Repository named 'foo' within the 'foo' domain. ```bash pulp --domain foo file repository create --name foo ``` -------------------------------- ### Install Yum Client Certificate Source: https://github.com/pulp/pulpcore/blob/main/pulp_certguard/docs/user/tutorials/yum-howto.md Copy the client certificate to the appropriate location for yum to access. Ensure $PATH_TO_EASYRSA points to your EasyRSA directory. ```bash cp $PATH_TO_EASYRSA/yum-client.pem /etc/boomi/yum.pem ``` -------------------------------- ### Set up 'isofile' repository Source: https://github.com/pulp/pulpcore/blob/main/docs/admin/guides/import-export-repos.md Creates a new File repository named 'isofile', adds a remote URL, and syncs content from the remote. This prepares the repository for exporting. ```bash # create the repository ISOFILE_HREF=$(http POST :/pulp/api/v3/repositories/file/file/ name=isofile | jq -r '.pulp_href') # add remote http POST :/pulp/api/v3/remotes/file/file/ name=isofile url=https://fixtures.pulpproject.org/file/PULP_MANIFEST # find remote's href REMOTE_HREF=$(http :/pulp/api/v3/remotes/file/file/ | jq -r ".results[] | select(.name == \"isofile\") | .pulp_href") # sync the repository to give us some content http POST :$ISOFILE_HREF'sync/' remote=$REMOTE_HREF ``` -------------------------------- ### Configure Plugin Entry Point in setup.py Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/learn/other/how-plugins-work.md Register the plugin with Pulp Core by defining the 'pulpcore.plugin' entry point in your setup.py file. ```python entry_points={ 'pulpcore.plugin': [ 'pulp_myplugin = pulp_myplugin:default_app_config', ] } ``` -------------------------------- ### Create and Set Labels on a Repository Source: https://github.com/pulp/pulpcore/blob/main/docs/user/guides/manage-labels.md Use these commands to create a new file repository and then set initial labels for it. The 'show' command displays the repository with its newly added labels. ```bash # create a new repository pulp file repository create --name myrepo # set some labels pulp file repository label set --name myrepo --key environment --value production pulp file repository label set --name myrepo --key reviewed --value true # call show to view the repo's labels pulp file repository show --name myrepo ``` ```json { "pulp_href": "/pulp/api/v3/repositories/file/file/13477a92-b811-4436-a76a-d2469a17a62e/", "pulp_created": "2021-01-29T17:54:17.084105Z", "versions_href": "/pulp/api/v3/repositories/file/file/13477a92-b811-4436-a76a-d2469a17a62e/versions/", "pulp_labels": { "environment": "production", "reviewed": "true" }, "latest_version_href": "/pulp/api/v3/repositories/file/file/13477a92-b811-4436-a76a-d2469a17a62e/versions/0/", "name": "myrepo", "description": null, "remote": null } ``` -------------------------------- ### Set up 'zoo' repository Source: https://github.com/pulp/pulpcore/blob/main/docs/admin/guides/import-export-repos.md Creates a new RPM repository named 'zoo', adds a remote URL, and syncs content from the remote. This prepares the repository for exporting. ```bash # Create the repository export ZOO_HREF=$(http POST :/pulp/api/v3/repositories/rpm/rpm/ name=zoo | jq -r '.pulp_href') # add a remote http POST :/pulp/api/v3/remotes/rpm/rpm/ name=zoo url=https://fixtures.pulpproject.org/rpm-signed/ policy='immediate' # find remote's href export REMOTE_HREF=$(http :/pulp/api/v3/remotes/rpm/rpm/ | jq -r ".results[] | select(.name == \"zoo\") | .pulp_href") # sync the repository to give us some content http POST :$ZOO_HREF'sync/' remote=$REMOTE_HREF ``` -------------------------------- ### Filter Expression Complexity Examples Source: https://github.com/pulp/pulpcore/blob/main/docs/user/guides/use-complex-filters.md These examples illustrate the complexity calculation for various 'q' filter expressions. ```bash pulp_type__in='core.rbac' # complexity: 1 = 1 (filter expression) ``` ```bash NOT pulp_type="core.rbac" # complexity: 2 = 1 (NOT) + 1 (filter expression) ``` ```bash pulp_type__in=core.rbac,core.content_redirect # complexity: 1 = 1 (filter expression) ``` ```bash pulp_type="core.rbac" OR pulp_type="core.content_redirect" pulp_type="core.rbac" AND name__contains=GGGG pulp_type="core.rbac" AND name__iexact=gGgG pulp_type="core.rbac" AND name__contains="naïve" # complexity: 3 = 1 (AND/OR) + 2 (filter expression) ``` ```bash pulp_type="core.rbac" AND name__icontains=gg AND NOT name__contains=HH # complexity: 5 = 1 (AND/OR) + 1 (NOT) + 3 (filter expression) ``` ```bash NOT (pulp_type="core.rbac" AND name__icontains=gGgG) pulp_type="core.rbac" AND NOT name__contains="naïve" # complexity: 4 = 1 (AND/OR) + 1 (NOT) + 2 (filter expression) ``` ```bash pulp_type="core.rbac" AND( name__icontains=gh OR name__contains="naïve") # complexity: 5 = 2 (AND/OR) + 3 (filter expression) ``` ```bash pulp_type="core.rbac" OR name__icontains=gh OR name__contains="naïve" # complexity: 4 = 1 (AND/OR) + 3 (filter expression) ``` -------------------------------- ### Create a File Distribution Source: https://github.com/pulp/pulpcore/blob/main/pulp_file/docs/user/guides/upload.md Create a distribution for the 'foo' repository. This makes the content accessible via a URL. Specify the repository and the desired base path for the distribution. ```bash pulp file distribution create \ --name foo_latest \ --repository file:file:foo \ --base-path file/foo ``` ```bash Started background task /pulp/api/v3/tasks/018db95a-5685-73bb-92f0-b2549483888a/ Done. { "pulp_href": "/pulp/api/v3/distributions/file/file/018db95a-57a6-7f31-9d53-43f277664407/", "pulp_created": "2024-02-17T23:15:22.151052Z", "base_path": "file/foo", "base_url": "http://localhost:5001/pulp/content/file/foo/", "content_guard": null, "hidden": false, "pulp_labels": {}, "name": "foo_latest", "repository": "/pulp/api/v3/repositories/file/file/018db957-1997-78b9-a2db-7754434bdf12/", "publication": null } ``` -------------------------------- ### Build HTML Documentation Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/learn/other/documentation.md Navigate to the docs directory and use the 'make html' command to generate the HTML documentation. ```bash cd docs make html ``` -------------------------------- ### Example Commit Message Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/tutorials/quickstart.md An example of a well-formatted commit message for Pulp, including a title, body, and footer linking to a GitHub issue. ```git Update install and quickstart The install docs and quickstart was leaving out an important step on the worker configuration. closes #1392 ``` -------------------------------- ### Building a Downloader with DownloaderFactory Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/reference/code-api/plugins-api/download.md Demonstrates how to use the DownloaderFactory to construct a downloader for a given URL. The factory handles scheme selection and auto-configuration with remote settings. ```python factory = DownloaderFactory() url = "http://example.com/file.txt" downloader = factory.build(url) ``` -------------------------------- ### RBAC Statement Example with Permissions Source: https://github.com/pulp/pulpcore/blob/main/pulp_file/docs/admin/guides/rbac.md An example of an RBAC statement showing how permissions, conditions, and principals are defined, including model and parameter-level permissions. ```json "statements": [ ... { "action": [ "create" ], "effect": "allow", "condition": [ "has_model_perms:file.add_filerepository", "has_remote_param_model_or_obj_perms:file.view_fileremote" ], "principal": "authenticated" }, ... ], ``` -------------------------------- ### Create Repository Source: https://github.com/pulp/pulpcore/blob/main/pulp_file/docs/user/guides/sync.md Use this command to create a new file repository. The output shows the details of the newly created repository. ```bash #!/usr/bin/env bash export REPO_NAME=$(head /dev/urandom | tr -dc a-z | head -c5) echo "Creating a new repository named $REPO_NAME." pulp file repository create --name $REPO_NAME echo "Inspecting repository." pulp file repository show --name $REPO_NAME ``` ```json { "pulp_created": "2019-05-16T19:23:55.224096Z", "pulp_href": "/pulp/api/v3/repositories/file/file/680f18e7-0513-461f-b067-436b03285e4c/", "latest_version_href": null, "versions_href": "/pulp/api/v3/repositories/file/file/680f18e7-0513-461f-b067-436b03285e4c/versions/", "description": "", "name": "foo" } ``` -------------------------------- ### Example commit message for documentation updates Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/tutorials/quickstart-docs.md An example of a well-formatted commit message for documentation changes, including a title, body, and a reference to a closed GitHub issue. ```git Update install and quickstart documentation The install docs and quickstart was leaving out an important step on the worker configuration. closes #1392 ``` -------------------------------- ### Example RepositorySerializer Representation Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/learn/architecture/rest-api.md This example shows the output of calling repr() on a RepositorySerializer, illustrating the fields automatically generated by DRF for a ModelSerializer. This representation can be used to define explicit serializers. ```python >>> from serializers import RepositorySerializer >>> RepositorySerializer() RepositorySerializer(): pulp_href = HyperlinkedIdentityField(view_name='repositories-detail') name = CharField(style={'base_template': 'textarea.html'}, validators=[]) description = CharField(allow_blank=True, required=False, style={'base_template': 'textarea.html'}) last_content_added = DateTimeField(allow_null=True, required=False) last_content_removed = DateTimeField(allow_null=True, required=False) content = HyperlinkedRelatedField(many=True, read_only=True, view_name='content-detail') ``` -------------------------------- ### Import Failure: Plugin not installed Source: https://github.com/pulp/pulpcore/blob/main/docs/admin/guides/import-export-repos.md This validation error occurs during import if the downstream Pulp instance does not have all the necessary plugins that were included in the export file. Ensure all required plugins are installed on the downstream instance. ```text Export uses pulp_rpm which is not installed. ``` -------------------------------- ### Create Repository with Signing Service (Python) Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/learn/other/metadata-signing.md Associate a signing service with a new repository using Python. ```python signing_service = AsciiArmoredDetachedSigningService.objects.get(name='sign-metadata') FileRepository.objects.create(name='foo', metadata_signing_service=signing_service) ``` -------------------------------- ### Pulp Analytics Payload Example Source: https://github.com/pulp/pulpcore/blob/main/docs/admin/learn/architecture.md This JSON object represents an example payload of the anonymous analytics data collected by Pulp. It includes system information, component versions, and counts of various entities. ```json { "systemId": "a6d91458-32e8-4528-b608-b2222ede994e", "onlineContentApps": { "processes": 2, "hosts": 1 }, "onlineWorkers": { "processes": 2, "hosts": 1 }, "components": [ { "name": "core", "version": "3.21.0" }, { "name": "file", "version": "1.12.0" } ], "postgresqlVersion": 90200 } ``` -------------------------------- ### Create Repository with Signing Service (HTTP) Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/learn/other/metadata-signing.md Associate a signing service with a new repository using an HTTP POST request. ```bash http POST :24817/pulp/api/v3/repositories/file/file/ name=foo metadata_signing_service=http://localhost:24817/pulp/api/v3/signing-services/5506c8ac-8eae-4f34-bb5a-3bc08f82b088/ ``` -------------------------------- ### RHSM ContentGuard Output Source: https://github.com/pulp/pulpcore/blob/main/pulp_certguard/docs/user/tutorials/quickstart.md Example JSON output when creating an RHSM Content Guard. ```json { "pulp_href": "/pulp/api/v3/contentguards/certguard/rhsm/018dbddd-1894-7658-ab8f-1f33b544f2fc/", "pulp_created": "2024-02-18T20:16:40.085402Z", "name": "my-rhsm-guard", "description": null, "ca_certificate": "-----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----" } ``` -------------------------------- ### X509 ContentGuard Output Source: https://github.com/pulp/pulpcore/blob/main/pulp_certguard/docs/user/tutorials/quickstart.md Example JSON output when creating an X509 Content Guard. ```json { "pulp_href": "/pulp/api/v3/contentguards/certguard/x509/018dbdce-83c8-7602-ae8f-e8d5262d3cb8/", "pulp_created": "2024-02-18T20:00:44.489636Z", "name": "my-509-guard", "description": null, "ca_certificate": "-----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----" } ``` -------------------------------- ### Initialize and Build CA with easy_rsa Source: https://github.com/pulp/pulpcore/blob/main/pulp_certguard/docs/user/tutorials/yum-howto.md Initializes the Public Key Infrastructure (PKI) and builds a Certificate Authority (CA) using easy_rsa. The CA certificate is then converted to PEM format for use with Pulp. ```bash cp -r /usr/share/easy-rsa . cd easy-rsa git init git add * git commit -m 'pristine start' -a cd 3 ./easyrsa init-pki ./easyrsa build-ca # now convert your crt to a pem # you will use this later as a content guard in pulp cd pki openssl x509 -in ca.crt -out ca.pem -outform PEM cd .. ``` -------------------------------- ### Run Database Migrations Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/learn/subclassing/models.md After adding or modifying models, use `pulpcore-manager` to create and apply database migrations. ```bash pulpcore-manager makemigrations $PLUGIN_APP_LABEL pulpcore-manager migrate ``` -------------------------------- ### Example JSON Payload Source: https://github.com/pulp/pulpcore/blob/main/docs/admin/guides/auth/json_header.md Illustrates the structure of a JSON payload that can be filtered using JQ. ```json { identity: { user: { username: "user" } } } ``` -------------------------------- ### ViewSet with filterset_fields Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/learn/architecture/rest-api.md Example of a ViewSet configuration that allows filtering by the 'name' field using equality. ```python class RepositoryViewSet(viewsets.ModelViewSet): queryset = models.Repository.objects.all() serializer_class = serializers.RepositorySerializer filterset_fields = ('name',) ``` -------------------------------- ### Run Release Checker Script Source: https://github.com/pulp/pulpcore/blob/main/releasing.md Execute this script to determine if a new release is required. Ensure GitPython is installed. ```bash python3 .ci/scripts/check_release.py ``` -------------------------------- ### Create a Checkpoint Distribution Source: https://github.com/pulp/pulpcore/blob/main/docs/user/guides/checkpoint.md Use this command to create a distribution that will serve checkpoint publications for a repository. Ensure you replace placeholders with your specific names and paths. ```bash pulp file distribution create \ --name \ --repository \ --base-path \ --checkpoint ``` -------------------------------- ### Create Repository in a Different Domain Source: https://github.com/pulp/pulpcore/blob/main/docs/user/guides/create-domains.md Demonstrates creating a File Repository named 'foo' in the 'boo' domain, highlighting domain isolation. ```bash pulp --domain boo file repository create --name foo ``` -------------------------------- ### Example Commit Message Source: https://github.com/pulp/pulpcore/blob/main/docs/dev/guides/git.md A well-formatted commit message includes a subject line and a detailed body, referencing any related issues. ```git Update install and quickstart The install docs and quickstart was leaving out an important step on the worker configuration. closes #1392 ``` -------------------------------- ### Configure Allowed Content Checksums Source: https://github.com/pulp/pulpcore/blob/main/docs/admin/reference/settings.md Set the list of content-checksums Pulp is allowed to use. 'sha256' is required for Pulp to start. ```python ALLOWED_CONTENT_CHECKSUMS = ["sha224", "sha256", "sha384", "sha512"] ``` -------------------------------- ### Verify Yum Access with Certguard Source: https://github.com/pulp/pulpcore/blob/main/pulp_certguard/docs/user/tutorials/yum-howto.md After installing the certificate and enabling the plugin, this command verifies that yum can now access the protected repository successfully. ```bash # kick the tires [root@ip-10-76-7-46 yum-plugins]# yum makecache Loaded plugins: amazon-id, certguard, rhui-lb, search-disabled-repos boomi-epel | 3.5 kB 00:00:00 (1/4): boomi-epel/updateinfo | 71 B 00:00:00 (2/4): boomi-epel/filelists | 11 MB 00:00:00 (3/4): boomi-epel/primary | 3.7 MB 00:00:00 (4/4): boomi-epel/other | 2.3 MB 00:00:00 boomi-epel 13215/13215 boomi-epel 13215/13215 boomi-epel 13215/13215 Metadata Cache Created [root@ip-10-76-7-46 yum-plugins]# ``` -------------------------------- ### Create an Upstream Pulp Server Configuration Source: https://github.com/pulp/pulpcore/blob/main/docs/user/guides/replication.md Use this command to register an upstream Pulp server. Provide the name, base URL, and authentication credentials. ```bash pulp upstream-pulp create \ --name "my-upstream" \ --base-url "https://upstream.example.com" \ --username "admin" \ --password "password" ``` -------------------------------- ### Download File from Pulp Distribution (after sync) Source: https://github.com/pulp/pulpcore/blob/main/pulp_file/docs/user/guides/publish-host.md Downloads a file (e.g., '1.iso') from a Pulp distribution using its base URL. This example assumes the content was added via a sync operation. ```bash #!/usr/bin/env bash DISTRIBUTION_BASE_URL=$(pulp file distribution show --name $DIST_NAME | jq -r '.base_url') # Next we download a file from the distribution echo "Downloading file from Distribution via the content app." echo ${DISTRIBUTION_BASE_URL}1.iso http -d ${DISTRIBUTION_BASE_URL}1.iso ``` -------------------------------- ### Get RPM Repository Metadata Source: https://github.com/pulp/pulpcore/blob/main/pulp_certguard/docs/user/tutorials/yum-howto.md Fetches the repomd.xml file from the published RPM endpoint, which is used by yum/dnf to discover repository metadata. ```bash # Get the repo metadata from the published end point on the yum side http GET http://localhost:24816/pulp/content/boomi-epel-2/repodata/repomd.xml ``` -------------------------------- ### Create a File Repository Source: https://github.com/pulp/pulpcore/blob/main/pulp_file/docs/user/guides/upload.md Use this command to create a new file repository named 'foo'. The --autopublish flag ensures that new content is automatically published. ```bash pulp file repository create \ --name foo \ --autopublish ``` ```json { "pulp_href": "/pulp/api/v3/repositories/file/file/018db957-1997-78b9-a2db-7754434bdf12/", "pulp_created": "2024-02-17T23:11:49.656603Z", "versions_href": "/pulp/api/v3/repositories/file/file/018db957-1997-78b9-a2db-7754434bdf12/versions/", "pulp_labels": {}, "latest_version_href": "/pulp/api/v3/repositories/file/file/018db957-1997-78b9-a2db-7754434bdf12/versions/0/", "name": "foo", "description": null, "retain_repo_versions": null, "remote": null, "autopublish": true, "manifest": "PULP_MANIFEST" } ``` -------------------------------- ### Pulp Repair All Artifacts Task Output Source: https://github.com/pulp/pulpcore/blob/main/docs/user/guides/repair-pulp.md Example output of a repair task for all of Pulp's content, showing progress and completion status. ```json { "child_tasks": [], "created_resources": [], "error": null, "finished_at": "2020-04-07T08:36:52.373633Z", "name": "pulpcore.app.tasks.repository.repair_all_artifacts", "parent_task": null, "progress_reports": [ { "code": "repair.repaired", "done": 2, "message": "Repair corrupted units", "state": "completed", "suffix": null, "total": null }, { "code": "repair.corrupted", "done": 2, "message": "Identify corrupted units", "state": "completed", "suffix": null, "total": null } ], "pulp_created": "2020-04-07T08:36:52.274985Z", "pulp_href": "/pulp/api/v3/tasks/530302b4-8674-4db3-8a13-99febef80830/", "reserved_resources_record": [], "started_at": "2020-04-07T08:36:52.348381Z", "state": "completed", "task_group": null, "worker": "/pulp/api/v3/workers/f2fe2811-74a1-463f-93d2-53c7b302115c/" } ```