-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add beginnings of @addons endpoint * Add @addon get response * Add header * Add @addons list response * Add install, upgrade, uninstall on addons * Add addons to toctree * Don’t include paths. * Add @id element to addons with url of its record * Fix false, null. * Status 200 doesn’t return content. * 204 instead of 200 * Fix false/null * Add get for @addons * Add upgrade/install/uninstall methods to @addons * Reorganize * Move request/response examples * Update example locations * No need to batch the results * Remove reinstall_products * Handle product upgrade * Remove unused method * Add changelog entry. * Move addon-lookup code into addons.py * Flesh out tests some more * Fix test values * Check for prefer header, return all addons if set. * Working install/uninstall test * Remove unused imports * Handle not-found addon * Clean up Flake8 errors * Sort imports * Remove unused plone import from addons.py. * Remove changelog merge message * py3 fix. * Flake 8 * Black * Flake 8 * Fix tests * Add upgrade tests * Add upgrade tests * Disable for Plone 4.3 Co-authored-by: Timo Stollenwerk <[email protected]> Co-authored-by: Rodrigo Ferreira de Souza <[email protected]> Co-authored-by: Victor Fernandez de Alba <[email protected]>
- Loading branch information
1 parent
db18b17
commit 0e27a03
Showing
21 changed files
with
1,018 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ | |
- Luca Bellenghi | ||
- Giacomo Monari | ||
- Alin Voinea | ||
- Rodrigo Ferreira de Souza |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
Add-ons | ||
======== | ||
|
||
Addon product records can be addressed through the ``@addons`` endpoint on the | ||
Plone site. In order to address a specific record, the profile id has to be | ||
passed as a path segment (e.g. `/plone/@addons/plone.session`). | ||
|
||
Reading or writing addons metadata require the ``cmf.ManagePortal`` | ||
permission. | ||
|
||
Reading add-ons records | ||
----------------------- | ||
|
||
Reading a single record: | ||
|
||
.. http:example:: curl httpie python-requests | ||
:request: ../../src/plone/restapi/tests/http-examples/addons_get.req | ||
|
||
Example Response: | ||
|
||
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/addons_get.resp | ||
:language: http | ||
|
||
|
||
Listing add-ons records | ||
----------------------- | ||
|
||
A list of all add-ons in the portal can be retrieved by | ||
sending a GET request to the @addons endpoint: | ||
|
||
.. http:example:: curl httpie python-requests | ||
:request: ../../src/plone/restapi/tests/http-examples/addons_get_list.req | ||
|
||
Response: | ||
|
||
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/addons_get_list.resp | ||
:language: http | ||
|
||
The following fields are returned: | ||
|
||
- @id: hypermedia link to the control panel | ||
- id: the name of the add-on package | ||
- title: the friendly name of the add-on package | ||
- description: description of the add-on | ||
- version: the current version of the add-on | ||
- is_installed: is the add-on installed? | ||
- has_uninstall_profile: does the add-on have an uninstall profile | ||
|
||
|
||
Installing an addon | ||
------------------- | ||
|
||
An individual addon can be installed by issuing a ``POST`` to the given URL: | ||
|
||
.. http:example:: curl httpie python-requests | ||
:request: ../../src/plone/restapi/tests/http-examples/addons_install.req | ||
|
||
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/addons_install.resp | ||
:language: http | ||
|
||
|
||
Uninstalling an addon | ||
------------------- | ||
|
||
An individual addon can be uninstalled by issuing a ``POST`` to the given URL: | ||
|
||
.. http:example:: curl httpie python-requests | ||
:request: ../../src/plone/restapi/tests/http-examples/addons_uninstall.req | ||
|
||
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/addons_uninstall.resp | ||
:language: http | ||
|
||
|
||
Upgrading an addon | ||
------------------- | ||
|
||
An individual addon can be upgraded by issuing a ``POST`` to the given URL: | ||
|
||
.. http:example:: curl httpie python-requests | ||
:request: ../../src/plone/restapi/tests/http-examples/addons_upgrade.req | ||
|
||
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/addons_upgrade.resp | ||
:language: http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ Contents | |
blocks | ||
history | ||
batching | ||
addons | ||
comments | ||
copymove | ||
expansion | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add endpoints for managing addons. [esteele] |
Empty file.
Oops, something went wrong.