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
Follow the installation instructions provided with pulpcore.
Define installation steps here.
Define installation steps here.
$ 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 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')
Use nupkg
Importer:
$ http POST $IMPORTER_HREF'sync/'
$ 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')
$ 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')
$ http POST http://localhost:8000/api/v3/distributions/ name='baz' publisher=$PUBLISHER_HREF publication=$PUBLICATION_HREF
$ http GET http://localhost:8000/api/v3/tasks/82e64412-47f8-4dd4-aa55-9de89a6c549b/
$ http GET http://localhost:8000/content/foo/foo.tar.gz