Skip to content

ananace/pulp_nupkg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template to create your own plugin

This is the plugin_template repository to help plugin writers get started and write their own plugin for Pulp Project 3.0+.

Clone this repository and run the provided rename.py script to create a skeleton for your plugin with the name of your choice. It will contain setup.py, expected plugin layout and stubs for necessary classes and methods.

$ git clone https://github.com/pulp/plugin_template.git

$ cd plugin_template

$ ./rename.py your_plugin_name

Check Plugin Writer's Guide for more details and suggestions on plugin implementaion.

Below are some ideas for how to document your plugin.

All REST API examples below use httpie to perform the requests.

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 plugin

From source

Define installation steps here.

Install from PyPI

Define installation steps here.

Create a repository foo

$ http POST http://localhost:8000/api/v3/repositories/ name=foo

$ export REPO_HREF=$(http :8000/api/v3/repositories/ | jq -r '.results[] | select(.name == "foo") | ._href')

Add an Importer to repository foo

Add important details about your Importer and provide examples.

$ http POST http://localhost:8000/api/v3/importers/nupkg/ some=params repository=$REPO_HREF

{
    "_href": "http://localhost:8000/api/v3/importers/nupkg/$UUID/",
    ...
}

$ export IMPORTER_HREF=$(http :8000/api/v3/importers/nupkg/ | jq -r '.results[] | select(.name == "bar") | ._href')

Sync repository foo using Importer bar

Use nupkg Importer:

$ http POST $IMPORTER_HREF'sync/'

Add a Publisher to repository foo

$ http POST http://localhost:8000/api/v3/publishers/nupkg/ name=bar repository=$REPO_HREF

{
    "_href": "http://localhost:8000/api/v3/publishers/nupkg/$UUID/",
    ...
}

$ export PUBLISHER_HREF=$(http :8000/api/v3/publishers/file/ | jq -r '.results[] | select(.name == "bar") | ._href')

Create a Publication using Publisher bar

$ http POST http://localhost:8000/api/v3/publications/ publisher=$PUBLISHER_HREF

[
    {
        "_href": "http://localhost:8000/api/v3/tasks/fd4cbecd-6c6a-4197-9cbe-4e45b0516309/",
        "task_id": "fd4cbecd-6c6a-4197-9cbe-4e45b0516309"
    }
]

$ export PUBLICATION_HREF=$(http :8000/api/v3/publications/ | jq -r --arg PUBLISHER_HREF "$PUBLISHER_HREF" '.results[] | select(.publisher==$PUBLISHER_HREF) | ._href')

Add a Distribution to Publisher bar

$ http POST http://localhost:8000/api/v3/distributions/ name='baz' publisher=$PUBLISHER_HREF publication=$PUBLICATION_HREF

Check status of a task

$ http GET http://localhost:8000/api/v3/tasks/82e64412-47f8-4dd4-aa55-9de89a6c549b/

Download foo.tar.gz from Pulp

$ http GET http://localhost:8000/content/foo/foo.tar.gz

Releases

No releases published

Packages

No packages published

Languages